Skip to content

Code actions menu is no available when the cursor is inside the highlighted zone  #4462

Closed

Description

@incendial

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.

Activity

  1. added this to the v3.62.0 milestone on Mar 27, 2023
  2. added
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    on Mar 27, 2023
  3. DanTup commented on Mar 27, 2023

    @DanTup
    Member

    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.

  4. added
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Mar 27, 2023
  5. DanTup commented on Mar 27, 2023

    @DanTup
    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions