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
Change the typescript.inlayHints.variableTypes.enabled setting from a boolean to a enumeration, with options:
none
non-literals
all
It may make sense to apply this same treatment to typescript.inlayHints.propertyDeclarationTypes.enabled as well.
π Motivating Example
Here is a screenshot of the snippet in my codebase that was the direct inspiration for this request:
The inlay hints are, to me, pretty noisy here.
It's obvious what the inferred type of the string literal and object literal will be. The function literal as well, though if I were to remove the type annotations I would be relying on other inlay hints to help me there.
The hints for the object literal and function literal are almost useless, even if I wanted to be told the type. It does not take a particularly large object or complex function definition to hit the ellipsis limit for unnamed/unaliased object/function types.
However, I don't want to disable it for all implicitly-typed variables. This inlay hint from later in the same file is very non-obvious because it's behind a wordy function call:
π» Use Cases
n/a? I think the motivating example section covers this.
The text was updated successfully, but these errors were encountered:
This might be tangential, but as a user it feels related, so I'll add it here anyway:
Maybe lump constructors in with "literals" so they don't appear when non-literals is set?
But of course, this is only redundant and not useful because the type parameters are explicitly specified. If they weren't, I'd probably like to know that the inferred type would be, e.g., Set<unknown>. π€
Suggestion
π Search Terms
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
Change the
typescript.inlayHints.variableTypes.enabled
setting from a boolean to a enumeration, with options:It may make sense to apply this same treatment to
typescript.inlayHints.propertyDeclarationTypes.enabled
as well.π Motivating Example
Here is a screenshot of the snippet in my codebase that was the direct inspiration for this request:
The inlay hints are, to me, pretty noisy here.
However, I don't want to disable it for all implicitly-typed variables. This inlay hint from later in the same file is very non-obvious because it's behind a wordy function call:
π» Use Cases
n/a? I think the motivating example section covers this.
The text was updated successfully, but these errors were encountered: