I just updated Flutter and Dart to the newest versions. I upgraded Flutter on the master branch and it automatically updated Dart too. There is now a serious problem. In all of my files, every time I declared a type before the name of a variable or parameter etc, they all now appear in a way that's almost highlighted but not? It's like a phantom part of the code. Can't click it or select it. Cursor skips over it. Help.


Dart: v3.48.3 Flutter: v3.48.0 VS Code: v1.71.2

Side note, all these ghosted types will completely disappear if I uninstall Dart, then they come back and do the same thing on re-install.

Solution 1: Danny Tuppeny

We recently added support for "Inlay Hints" in the Dart language server. This allows you to see inferred types and parameter names in the source.

It was intended to be opt-in, but the global VS Code setting for inlay hints was on by default so this showed up for users on the Flutter master branch.

As long as you're on the latest version of the Dart extension this should now be fixed, and the inlay hints will only be shown while you're holding down the shortcut key (Ctrl+Option/Alt). This behaviour can be changed in your Dart-specific setting of your VS Code settings.