Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code actions not provided if code action provider takes ~2 seconds or longer #232679

Closed
dibarbet opened this issue Oct 30, 2024 · 5 comments · Fixed by #232690
Closed

Code actions not provided if code action provider takes ~2 seconds or longer #232679

dibarbet opened this issue Oct 30, 2024 · 5 comments · Fixed by #232690
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release editor-code-actions Editor inplace actions (Ctrl + .) insiders-released Patch has been released in VS Code Insiders regression Something that used to work is now broken verified Verification succeeded

Comments

@dibarbet
Copy link
Member

dibarbet commented Oct 30, 2024

Does this issue occur when all extensions are disabled?: No

  • VS Code Version: 1.95.0
  • OS Version: Win 11 24h2

Issue:
If a code action provider takes ~2 seconds (or longer) to provide code actions, actions from that provider will not be shown in the lightbulb. This seems to be a behavior change between 1.94.2 and 1.95.0.

Image

I suspect that this will be a fairly impactful issue for the C# extension. We first noticed this when all our code action integration tests started failing after the update to 1.95.0 with all our code actions missing from the lightbulb (we 'fixed' it by rolling back the vscode version temporarily - dotnet/vscode-csharp#7708).

This vscode side change looks potentially related - 7f269ef#diff-de403ad3613f99afdc0e0c040d79b78e556bbd6bdc462cfb40bd857e354f0a43L122

I'm not sure if this was intentionally applied to all lightbulb invocations (instead of just on save), but if it was I would ask to reconsider. While we endeavor to provide code actions quickly, there are many scenarios where it can take additional time. For example, slow analyzers, running source generators, or during project loading. The timeout is quite short, and I have hit this at least a few times already today while using our extension.

Steps to Reproduce:

For a repro, see this commit - dibarbet/vscode-extension-samples@18b3a30

@dibarbet dibarbet changed the title Code actions not provided if code action provider takes ~2 seconds Code actions not provided if code action provider takes ~2 seconds or longer Oct 30, 2024
@mjbvz mjbvz assigned justschen and unassigned mjbvz Oct 31, 2024
@gjsjohnmurray
Copy link
Contributor

This seems to be a behavior change between 1.94.2 and 1.95.0.

Do you not routinely test/use your extensions with Insiders? The commit you mention happened on October 4 so will have been present in Insiders for more than three weeks.

@jrieken jrieken added editor-code-actions Editor inplace actions (Ctrl + .) bug Issue identified by VS Code Team member as probable bug regression Something that used to work is now broken labels Oct 31, 2024
@benasher44
Copy link

Can this timeout be configurable? The result for us on 1.95 is that now some files that are complex randomly don't auto-fix because they cause eslint to take just a little too long.

@justschen justschen added the candidate Issue identified as probable candidate for fixing in the next release label Oct 31, 2024
@justschen justschen added this to the October 2024 Recovery 2 milestone Oct 31, 2024
@vs-code-engineering vs-code-engineering bot added the unreleased Patch has not yet been released in VS Code Insiders label Oct 31, 2024
@vs-code-engineering vs-code-engineering bot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Oct 31, 2024
@justschen
Copy link
Contributor

justschen commented Oct 31, 2024

@dibarbet @benasher44 this fix is in our nightly Insiders build. Please try it out and let me know if you're still encountering this issue! thanks 👍

@dibarbet
Copy link
Member Author

dibarbet commented Nov 1, 2024

Thanks, tried it out locally and in tests (dotnet/vscode-csharp#7717) and seems to be working. When should I expect this to go into the main release build?

@gjsjohnmurray
Copy link
Contributor

https://github.com/microsoft/vscode/milestone/290

The date on that milestone indicates 1.95.2 should be out on November 6.

@rzhao271 rzhao271 added the verified Verification succeeded label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release editor-code-actions Editor inplace actions (Ctrl + .) insiders-released Patch has been released in VS Code Insiders regression Something that used to work is now broken verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants