Dart-code: "dart.previewLsp": true slows down VSCode Intellisense

Created on 10 Mar 2021  Β·  6Comments  Β·  Source: Dart-Code/Dart-Code

Describe the bug
The latest update caused my VSCode's Intellisense to slow down. Disabling the new setting "dart.previewLsp": false fixes the issue.

To Reproduce
set "dart.previewLsp": true

Versions:

βœ“] Flutter (Channel stable, 2.0.1, on macOS 11.1 20C69 darwin-x64, locale en-PH)
    β€’ Flutter version 2.0.1 at /Users/nemoryoliver/fvm/versions/stable
    β€’ Framework revision c5a4b4029c (5 days ago), 2021-03-04 09:47:48 -0800
    β€’ Engine revision 40441def69
    β€’ Dart version 2.12.0

[βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    β€’ Android SDK at /Users/nemoryoliver/Library/Android/sdk
    β€’ Platform android-30, build-tools 30.0.1
    β€’ ANDROID_HOME = /Users/nemoryoliver/Library/Android/sdk
    β€’ Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    β€’ All Android licenses accepted.

[βœ“] Xcode - develop for iOS and macOS
    β€’ Xcode at /Applications/Xcode.app/Contents/Developer
    β€’ Xcode 12.4, Build version 12D4e
    β€’ CocoaPods version 1.10.1

[βœ“] Chrome - develop for the web
    β€’ Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[βœ“] Android Studio (version 4.1)
    β€’ Android Studio at /Applications/Android Studio.app/Contents
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[βœ“] VS Code (version 1.54.1)
    β€’ VS Code at /Applications/Visual Studio Code.app/Contents
    β€’ Flutter extension version 3.20.0

[βœ“] Connected device (3 available)
    β€’ IN2010 (mobile) β€’ 022666eb β€’ android-arm64  β€’ Android 11 (API 30)
    β€’ macOS (desktop) β€’ macos    β€’ darwin-x64     β€’ macOS 11.1 20C69 darwin-x64
    β€’ Chrome (web)    β€’ chrome   β€’ web-javascript β€’ Google Chrome 89.0.4389.72 beta

β€’ No issues found!
awaiting info is performance stale

All 6 comments

The latest update caused my VSCode's Intellisense to slow down

Can you be specific about what you're seeing? Do you mean specifically the code completion suggestions? What sort of slowdown are you seeing? Does it happen every time, or intermittently?

There is a known issue in current Flutter stable where after opening a new file or holding Cmd/Ctrl while hovering a symbol, it can trigger some work that will slow things down for a short period. That's been fixed in Flutter dev/master but didn't make the stable release. I'm unsure if it's the same issue you're seeing though.

The latest update caused my VSCode's Intellisense to slow down

Can you be specific about what you're seeing? Do you mean specifically the code completion suggestions? What sort of slowdown are you seeing? Does it happen every time, or intermittently?

There is a known issue in current Flutter stable where after opening a new file or holding Cmd/Ctrl while hovering a symbol, it can trigger some work that will slow things down for a short period. That's been fixed in Flutter dev/master but didn't make the stable release. I'm unsure if it's the same issue you're seeing though.

It happens actually everytime VSCode tries to give suggestions. As well as saving a file, renaming a file is super slow.

I'm using Flutter stable and actually used to press (CMD + .) to tell VSCode to give me suggestions. So maybe it does relate to Flutter's issue you mentioned. But saving and renaming a file doesn't involve that but still super slow.

@nemoryoliver exactly! I have same issue and working in this situation is very difficult.

With previewLsp: true the status bar shows "Analysing" spinner for tens of seconds up to a minute for every change. Project has 17Kloc of Dart code, it's not that big. So you click on a warning, wait 30-40 seconds, apply the suggestion (or make the change manually), wait 20-40 seconds more, rinse, repeat.
I was running LSP preview for a long time, but this radical slow down happened only after the switch to Flutter 2.0 and Dart 2.12

with previewLsp: true the status bar shows "Analysing" spinner for tens of seconds up to a minute for every change.

So you click on a warning, wait 30-40 seconds, apply the suggestion (or make the change manually), wait 20-40 seconds more, rinse, repeat.

Are you able to capture a log of these happening using the Dart: Capture Analysis Server Logs command? ​Note: It will include parts of your source code/edits, so if doing this on a private project you may want to trim down the log. You can share logs with me via email ([email protected]) but don't send anything sensitive.

I'm also curious if anyone seeing these issues is able to easily switch to the dev/master branch temporarily and see whether it changes anything? (note: the first load after changing Flutter branch will take longer for the initial analysis as the SDK is parsed). dev/master include the perf fix I mentioned above, however it should not be triggered just be changing a file - it was only triggered when opening new files (including where you cmd/ctrl+hover a symbol - which triggers VS Code's "document opened" API because it shows a preview).

This issue has been marked stale because it is tagged awaiting-info for 30 days with no activity. Remove the stale label or comment to prevent the issue being closed in 10 days.

Was this page helpful?
0 / 5 - 0 ratings