Intellisense not triggering in VSCode for Dart/Flutter

8,423

Solution 1

Somewhere along the road my workspace setting was created with just this line in it:

"editor.quickSuggestions": false,

Which obviously caused quick suggestions to stop showing. This was not in the general vscode settings so I didn't even notice it.

No idea how this was added.

Solution 2

I also had success removing an empty dart-specific block from my settings and restarting VSCode.

  1. Cmd+Shift+P
  2. type "settings.json"
  3. select "Open Settings (JSON)"

My dart entry looked like this:

  "[dart]": {
       // "editor.tabSize": 2,
       // "editor.insertSpaces": true,
       // "editor.detectIndentation": false,
    },

After removing, saving, then restarting everything works as expected

Mac OS Big Sur: 11.2.3 VSCode: 1.54.1 Flutter 1.22.6 • channel stable • https://github.com/flutter/flutter.git Framework • revision 9b2d32b605 (7 weeks ago) • 2021-01-22 14:36:39 -0800 Engine • revision 2f0af37152 Tools • Dart 2.10.5

Solution 3

Try enabling the "Preview LSP" option in the VS Code/Dart settings and then reload VS Code.

Solution 4

In my case I removed the dart block from settings.json. Restarted VS and voila!

Solution 5

In VsCode, at the bottom of it there's a blue line, in which language mode is not selected. hovering throught the icons and texts you fill find this and selecting on it will display popup "select Language Mode"... just select Dart from it and intellisense will start to work. you don't have to remove any dart settings.

Share:
8,423
Craigt
Author by

Craigt

Updated on December 13, 2022

Comments

  • Craigt
    Craigt over 1 year

    In the last week or two IntelliSense has just stopped automatically triggering for the flutter project that I'm working on. If I hit cmd+space the IntelliSense menu will pop up with the correct items given the context. But it just does not show by itself

    I don't remember changing any settings but it's super annoying and I'm looking for a way to get back to the old behavior.

    An example, when in the constructor of a widget, IntelliSense will not pop up for named parameters.

    Or simply being on a new line and start typing a few characters, nothing pops up, even though there are valid IntelliSense items.

    • Thor
      Thor over 4 years
      I am using VSCode and have the same problem. It does not give me items in the context, just everything to do with that widget/method...
    • Thor
      Thor over 4 years
      I found this, maybe this can help you?
    • Craigt
      Craigt over 4 years
      I tried restarting, even restarting macos. Nothing seems to fix it for me :(
  • jennie788
    jennie788 over 3 years
    Where do you add this? Thanks
  • jaredbaszler
    jaredbaszler over 3 years
    @jennie788 - you would include this in the "[dart]": section of the settings.json file.
  • Vilmir
    Vilmir over 3 years
    For the record, my quickSuggestions was set to null for a reason I don't know, and putting back to true and restarting VSCode had 0 effect. Intellisense is still broken on my macos for Dart :(