Skip to content

Code Preview Broken for Multi-Line Compound Declaration #4968

@Number-3434

Description

@Number-3434

The Issue

The Code Preview (shown by moving the cursor over a symbol whilst holding Cmd ⌘) shows the code preview for the first symbol in a multiline compound declartion.

To Reproduce

Copy the following:

late final textAnimationController = AnimationController(
      vsync: this,
      duration: const Duration(milliseconds: 500),
    ),
    healthAnimationController = AnimationController(
      vsync: this,
      duration: const Duration(milliseconds: 200),
      reverseDuration: const Duration(milliseconds: 100),
    ),
    playPauseButtonAnimationController = AnimationController(
      vsync: this,
      duration: const Duration(milliseconds: 400),
    ),
    uiAnimationController = AnimationController(
      vsync: this,
      duration: const Duration(milliseconds: 1000),
    ),
    menuAnimationController = AnimationController(
      vsync: this,
      duration: const Duration(milliseconds: 150),
    ),
    endScreenAnimationController = AnimationController(
      vsync: this,
      duration: const Duration(milliseconds: 400),
    );

Then, type endScreenAnimationController, and move the cursor over a symbol whilst holding Cmd ⌘ to show the symbol preview. The symbol preview will show the first line of compound declaration, instead of the line where endScreenAnimationController is declared.

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