Reputation: 3580
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.
Upvotes: 4
Views: 14149
Reputation: 1
So what for worked for me was that I have to delete everything in dart settings which you can open it using CTRL + SHIFT + P or in the bottom left corner there is a gear icon, click it, then go to Command palette and search for Dart: User Recommended settings a box will pop-up in the bottom right corner then click Open settings file after it is opened copy-paste the json code below inside setting file
{
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [
80
],
"editor.selectionHighlight": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false
}}
Upvotes: 0
Reputation: 11
I ran into this problem, my solution was:
And voilà ;)
Upvotes: 1
Reputation: 523
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.
Upvotes: 1
Reputation: 71
I also had success removing an empty dart-specific block from my settings and restarting VSCode.
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
Upvotes: 4
Reputation: 5395
In my case I removed the dart
block from settings.json
. Restarted VS and voila!
Upvotes: 3
Reputation: 4809
I had this problem but just for one project. My solution was as follows:
Flutter Web
project and somehow my channel got switch back to the master channel. So I switched it back to flutter channel beta
.Flutter upgrade
.Once I did this, intellisense came back but only 1 line. I was able to fix that by expanding the intellisense pop-up by dragging and expanding the tooltip pop-up. This is a new feature added in VS Code 1.5.1
and could possibly be the underlying issue to this problem. Explanation of this feature is here:
https://code.visualstudio.com/updates/v1_51#_intellisense
In the end I was able to fix it without having to add anything to my settings.json
file.
Upvotes: 0
Reputation: 5115
Try enabling the "Preview LSP" option in the VS Code/Dart settings and then reload VS Code.
Upvotes: 3
Reputation: 1167
In case "editor.quickSuggestions": true," didn't work for you, try adding the below statement too in the [dart] section of your settings.json
"editor.suggestOnTriggerCharacters": true
Upvotes: 0
Reputation: 692
The same happened with me yesterday, dart analysis server was not working,i tried restarting VS Code, tried using Android Studio nothing worked, used the flutter doctor
command to check what happened, it downloaded the new Dart SDK and hence after the problem was solved.
Upvotes: 1
Reputation: 3165
It could be that you need to update Flutter. I have seen issues like this before and an update has solved the problem. However, I recommend that you follow this link https://gitter.im/dart-code/Dart-Code and chat to Danny Tuppeny who I believe develops the Dart extension for VSCode. I'm sure he can help.
Upvotes: 0
Reputation: 3580
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.
Upvotes: 4