Skip to content

Autocomplete/IntelliSense does not work for functions that return a record with named fields when using an expression body. #5162

@GiancarloCante

Description

@GiancarloCante

Describe the bug
Autocomplete/IntelliSense does not work for functions that return a record with named fields when using an expression body.

Expression body:
image
Block body:
image

To Reproduce

void fun(({int anInt}) Function() callback) {}

void main() {
  fun(() => ());

  fun(() {
    return ();
  });
}

Trigger the autocompletion inside the returned record and you can see that only show the suggestions in the block body, and not in expression body.

Expected behavior
Should show the named fields suggestions.

Please complete the following information:

You can run the Dart: Collect Diagnostic Information command from the VS Code command palette (F1) to easily capture this information or provide it manually.

Dart Code extension: 3.90.0
Flutter extension: 3.90.0
Dart: 3.4.1
Flutter: 3.22.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    in 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