Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode Flutter Dart slow suggestions

I'm using Visual Studio Code for flutter programming and using less extension, I loved the code completion but usually too slow. it took around 1-2 seconds for showing all suggestions. Is there any solution to this problem? here is my list of installed extensions https://i.stack.imgur.com/jfrD7.png

like image 573
Ahmed Yusuf Avatar asked Dec 20 '20 01:12

Ahmed Yusuf


2 Answers

I was told to add this config:

"dart.previewLsp": true,

which would put the plug-in into speaking the Language Server Protocol rather than a proprietary protocol, and it seems to have sped things up.

like image 178
Randal Schwartz Avatar answered Oct 06 '22 22:10

Randal Schwartz


Accepted answer and resetting the recommended language settings haven't worked out for me.

Although, I've continued to research a bit more and the LSP part seemed promising simply because it popped out in a bunch of unrelated sources too. But instead of enabling LSP to speed things up, people suggest going in the opposite direction and disabling LSP. Specifically, a person from the Dart VSCode team (at GitHub):

The only other thing I could suggest is disabling LSP but also disabling auto-import completions

Said settings can be set from settings.json like below:

"dart.useLsp": false,
"dart.autoImportCompletions": false

Update on 14.09.2022
dart.useLsp key is no longer valid: v3.48 release notes

Use this instead:

"dart.useLegacyAnalyzerProtocol": true
like image 1
KHAN Avatar answered Oct 06 '22 23:10

KHAN