You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently the default behaviour of the extension is to turn on inlay hints. This adds inferred types with grey text, and the user can double click on the text to insert it into the code. For example the inlay hint for the Package variable type:
While many users like this feature, some may not appreciate it as much and feel like it affects the readability of the code. Additionally, they may not know where this text is coming from if they are new and what they should do to turn it on/off.
Describe the solution you'd like
We should add a setting to turn inlay hints on and off. For now we can turn it off by default and when we add a walkthrough mode we should give the user the option to turn inlay hints on or off by default for swift projects. As well, we can update the documentation to tell users how to turn this feature on/off.
Describe alternatives you've considered
It is possible to turn off inlay hints on or off for swift with the following setting in the settings.json file:
Thank you! Yes, can definitely turn off inlay hints through the global settings as well (which would set "editor.inlayHints.enabled": "off" globally or for settings.json if done for the workspace I believe) but was thinking the Swift specific setting would be good when the extension is run for the first time and there is some sort of a walkthrough mode to help users configure preferences. New users may not know the setting name to search for and they could be new to VS Code in general as well.
Possibly inlay hints should have been called "variable type hints" or "variable type suggestions" or something to make it easier to find. Also instead of just "Double-click to insert" on hover perhaps it could say "Double-click to insert inlay hint" or show a link to the setting to hide it, but I'm not sure if that text can be overwritten.
rbenegal
added a commit
to rbenegal/vscode-swift
that referenced
this issue
Apr 28, 2025
Add an extension setting that controls `[swift]` inlay hints so that
hints can be disabled by default for now. Most other language extensions
have inlay hints turned off by default, likely because it is tricky to
figure out how to turn them off/on otherwise.
Later on, when there is a walkthrough mode, we can provide users with
an option to set inlay hints on or off when the extension runs for the
first time.
Issue: swiftlang#1512
Is your feature request related to a problem? Please describe.
Currently the default behaviour of the extension is to turn on inlay hints. This adds inferred types with grey text, and the user can double click on the text to insert it into the code. For example the inlay hint for the
Package
variable type:While many users like this feature, some may not appreciate it as much and feel like it affects the readability of the code. Additionally, they may not know where this text is coming from if they are new and what they should do to turn it on/off.
Describe the solution you'd like
We should add a setting to turn inlay hints on and off. For now we can turn it off by default and when we add a walkthrough mode we should give the user the option to turn inlay hints on or off by default for swift projects. As well, we can update the documentation to tell users how to turn this feature on/off.
Describe alternatives you've considered
It is possible to turn off inlay hints on or off for swift with the following setting in the settings.json file:
But users may not know that the inferred types are coming from "inlay hints".
Additional context
We can possibly add a setting that will modify the settings.json to set the right editor.inlayHints.enabled values.
The text was updated successfully, but these errors were encountered: