Skip to content

Add setting to turn inlay hints (inferred variable types) on or off #1512

Open
@rbenegal

Description

@rbenegal

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:

Image

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:

    "[swift]": {
        "editor.inlayHints.enabled": "off"
    },

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions