user14036065
user14036065

Reputation:

Autocomplete/Intellisense not working for dart/flutter in VSCode

Even with the CTRL+SPACE shortcut, the options I get are nowhere near relevant to the code.

I created a new file named questions.dart in the lib folder along with main.dart. In main.dart the code autocomplete works fine but in question.dart, it doesn't. Also, the syntax is not getting highlighted as well in the new file.

For questions.dart https://i.sstatic.net/aCHkJ.png

For main.dart https://i.sstatic.net/kJ96q.png

Upvotes: 1

Views: 5881

Answers (2)

Matheus Neumann
Matheus Neumann

Reputation: 11

I'm facing the same issue here. I managed to solve it by switching flutter channel from master to beta. Now autocomplete works, but sometimes things still get crazy.

Upvotes: 1

ambiguous58
ambiguous58

Reputation: 1411

Restart the Dart Analysis Server. If that doesn't work, restart your IDE.

This happens to me occasionally. I believe it's an issue with the Dart Analysis Server. Usually, restarting the Dart Analysis Server fixes it.

To restart the Dart Analysis Server. Press ctrl + shift + p. Then search look for a command called Dart: Restart Analysis Server. If it doesn't work restart your IDE.

Upvotes: 14

Related Questions