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 menu is no available when the cursor is inside the highlighted zone #4462

Closed
incendial opened this issue Mar 26, 2023 · 2 comments
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Milestone

Comments

@incendial
Copy link

Describe the bug
Noticed that the code actions menu does not appear neither on the shortcut, nor via the button.
It can only be called via the diagnostic tooltip or if the cursor in on the first line (where the method signature is):

Screen.Recording.2023-03-26.at.22.00.55.mov

To Reproduce
Steps to reproduce the behavior:

  1. enable prefer_expression_function_bodies
  2. create a method with a single return statement
  3. try to call the code actions menu

Expected behavior
Code actions menu appears.

@DanTup DanTup added this to the v3.62.0 milestone Mar 27, 2023
@DanTup DanTup added in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server labels Mar 27, 2023
@DanTup
Copy link
Member

DanTup commented Mar 27, 2023

Good catch. We show quick-fixes for the whole line of a diagnostic (for convenience), but apparently only looked at the first line (which is the one with the {) and not the whole range.

Fix open at https://dart-review.googlesource.com/c/sdk/+/291281.

@DanTup DanTup added the relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available label Mar 27, 2023
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Mar 27, 2023
…ines other than the first

Fixes Dart-Code/Dart-Code#4462.

Change-Id: Ie932a5cce64d98bf5177c28207f94b9f34b0b7ce
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/291281
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
@DanTup
Copy link
Member

DanTup commented Mar 27, 2023

Fixed by dart-lang/sdk@7ce6c20, ships in the SDK :-)

@DanTup DanTup closed this as completed Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Projects
None yet
Development

No branches or pull requests

2 participants