Skip to content

Code completion regression in language server in dev branchΒ #61472

@helomri

Description

@helomri

Dart fails to provide correct code completion on "obvious" cases in the latest versions of Dart on the master branch (3.9.2 is unaffected), multiple tries are required for the correct completions to be returned.

I've first reported the issue on IntelliJ's bug tracker but it was determined that this is a regression from the Dart SDK.

Here's the (modified) initial bug report:

Steps to reproduce

  1. Create a new Dart project with an empty main and import dart:async (Flutter not required) ;
  2. Write the following in the main function: Future.value().then ;
  3. Try to open the parentheses to open the code completion box (or press Ctrl+Space if it doesn't) for (value) => .

Expected result (correct result):
(value) => and (value) {} are the first available options.

Actual result (faulty result):
Seemingly random objects are suggested. To see the "correct" options, you need to press a few times Ctrl+Space.

Environment

  • Dart 3.10.0-181.0.dev (dev) (Mon Sep 8 05:09:33 2025 -0700) on "linux_x64"
  • on linux / Linux 6.16.5-200.fc42.x86_64 SMP PREEMPT_DYNAMIC Thu Sep 4 16:37:21 UTC 2025
  • locale is fr_FR.UTF-8

Additional information

Video showing the issue (each time the suggestions change, I have pressed Ctrl+Space)

2025-09-06.16-31-19.mp4

And I'm including here the problematic request sent to the analysis server (by Alexander Doroshko) :

{"id":"50","method":"completion.getSuggestions2","params":{"file":"file:///Users/alexander.doroshko/dart_projects/DartSample2/example/web/foo.dart","offset":53,"maxResults":100,"completionCaseMatchingMode":"FIRST_CHAR","completionMode":"BASIC","invocationCount":1},"clientRequestTime":1757498553723}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-completionIssues with the analysis server's code completion featuretype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions