-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inlay hints disappear after going to definition #60145
Comments
@benthillerkus can you confirm what your inlay hint settings are? By default (for Dart) they are only shown while you are holding down the key combination, so it's expected that they're not there as standard. There was a bug in VS Code recently that could cause them to appear when they shouldn't after reloading the window. If you have changed your settings deliverately so they usually show up all the time, can you confirm where you've set this? (it would probably need to be in the |
Wow, you're right; I somehow forgot that you can trigger them with a key combination. The key combination seems to work (and that it would initially show them anyways would be a VS Code bug). I do have them set to After reading your comment I then added this "[dart]": {
///....
"editor.inlayHints.enabled": "on"
}, to the Dart block of the settings -- which didn't change the behaviour. Curiously when I added that block to my VS Code workspace settings block the behaviour seems to be correct. So somehow changing it in the user profile settings was being overridden, but changing it inside the workspace has the final say. So I guess this is a VS Code bug? |
The Dart extension sets a language-specific default. That means that our default (which is "editor.inlayHints.enabled": "on" Then it will be overriden for Dart. However, if you set your own for Dart specifically: "[dart]": {
"editor.inlayHints.enabled": "on"
} Then that should override our default. This should be the case for User or Workspace settings. I did some testing, but was not able to reproduce what you're seeing. If I add:
To my User Settings, then I see inlay hints always shown. Are you able to test this in a new project and see if you see the same behaviour there? Is it possible you had both a User and Workspace setting at the time you tested it, so the User Setting was ignored?
This is just how VS Code works. Language-specific settings (whether they're defaults contributed by an extension, or set by a user) always override any non-language-specific settings. While I don't think it's very obvious, I think it probably does make the most sense. In order to make this more discoverable (because they question has come up a few times), they did add a "Modified Elsewhere" tag in the settings editor that shows where it's being overridden (if you click on it, you'll get a popup like the one here): |
It could be, although without knowing why you see a difference in your user settings, I'm not sure. I presume this has something to do with Profiles. Is it possible you have that setting set explicitly in your profile, so the change in User Settings was overridden by the profile (but the workspace settings are not)? I don't use profiles much so I'm not sure how the settings in them interact, but it seems logical that Workspace Settings would override Profile Settings, which override User Settings - however the UI above isn't very clear to me (are you modifying User or Profile settings?). I would check your profile settings (although I don't know how you'd do that) to see if it's being set there. If not, it may be worth opening a VS Code issue (and you're welcome to CC me if I might be able to help describe how Dart is configured or answer questions). |
If you have a profile the user setting is the profile setting - atleast as far as I understand it. I think I'll open an issue for VS Code later, ty |
When I open my project in VS Code I can see the type inlay hints, but as soon as I start doing stuff like go-to-definition the hints disappear.
Screen.Recording.2025-02-15.at.21.49.43.mov
Infodump
Workspace Environment
Output from 'dart info'
/Users/bent/.puro/shared/caches/010c8a806bccad64ab9972286b85dd24ca98441f/dart-sdk/bin/dart info
If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.
General info
Project info
Process info
Output from 'flutter doctor'
/Users/bent/.puro/envs/stable/flutter/bin/flutter doctor -v
dart_analyzer_diagnostics_report.json
The text was updated successfully, but these errors were encountered: