IntelliJ 2020.3: Dart code completion really bad

Answered

I use IntelliJ IDEA 2020.3.1 (Ultimate Edition), build #IU-203.6682.168, built on December 29, 2020. It runs with the JetBrains JDK 11.0.9.1+11-b1207.1 x86_64. My Mac runs Big Sur 11.1. 

I work on a Flutter project. Flutter uses Dart. I got both plug-ins in the latest versions installed: Flutter 52.1.5, Dart 203.6912.

For me, Dart code completion is often laughably bad. Here I type `this`. Code completion then inserts `JsFunction.withThis` as the first hit. `this` isn't even in the first page of suggestions:

Here I type `true` which turns int `MouseTrackerUpdateDetails.byPointerEvent()`:

I found two code completion options for Dart. On or off, neither makes a difference for me:

  • Editor - General - Code Completion - Dart: Insert default argument values in completions
  • Editor - Intentions - Dart: Quick assist powered by the Dart Analysis Server

I don't recall the code completion sucking so much, say, a couple of months ago. What am I doing wrong here? 

 

0
7 comments

What Dart SDK version do you use? Code ompletion in Dart is powered by the Dart Analysis Server, a tool from the Dart SDK. 

Please try to remove the Analysis Server caches (close the IDE and delete the ~/.dartServer folder), open the project and wait for the initial warm-up. Will the completion work after that?

0
  • Closed IntelliJ
  • Deleted ~/.dartServer
  • Started IntelliJ
  • Selected File - Invalidate Caches / Restart - Invalidate and Restart
  • No changes: In the same place in the code, the same two errors above still show up 😞

 

0

Here's another example: My method has a parameter called "file". But when I type "file", the correct code completion "file" is only listed as the fourth entry:

0

IntelliJ uses the Dart SDK that comes with Flutter 1.22.5 (the current production release). The Dart SDK version is 2.10.4.

0

I'd suggest filing an issue (with exact code snippets it can be repeated with) to https://github.com/dart-lang/sdk/issues

0

@...: I did create a brand-new project. I had the same issues there. See the Dart issue for details.

0

Please sign in to leave a comment.