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
Sometimes Inlay hints are too long and get cut off at some point (after 30 characters) and having the array braces at the end makes them very likely to be cut off despite it being the outer-most structure,
making it almost impossible to tell from the hint that this function returns an array (only from the leading (), whereas this would be easy if instead it showed : Array<{ key: string; tdC....
For reference, rust-analyzer does this more elegantly by leaving out details in the inner element if a configurable threshold of characters would otherwise be exceeded while still including all relevant punctuation for the outer types:
For this example, that would probably become : Array<{ key: string; β¦ }> or : ({ key: string; β¦ })[] (depending on a configurable threshold).
π Motivating Example
The following example illustrates the current problem with not being able to tell (quickly) that the return type is an array.
Rereading this, I missed to stress the point that I generally prefer the generic syntax for arrays, so making that configurable (like you can for eslint, for example) would be appreciated because I'm sure some people will think otherwise.
Suggestion
π Search Terms
Related: #45295
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
I've been told that this repo is the correct place to suggest such a feature (via typescript-language-server/typescript-language-server#639).
Sometimes Inlay hints are too long and get cut off at some point (after 30 characters) and having the array braces at the end makes them very likely to be cut off despite it being the outer-most structure,
making it almost impossible to tell from the hint that this function returns an array (only from the leading
(
), whereas this would be easy if instead it showed: Array<{ key: string; tdC...
.For reference, rust-analyzer does this more elegantly by leaving out details in the inner element if a configurable threshold of characters would otherwise be exceeded while still including all relevant punctuation for the outer types:
For this example, that would probably become
: Array<{ key: string; β¦ }>
or: ({ key: string; β¦ })[]
(depending on a configurable threshold).π Motivating Example
The following example illustrates the current problem with not being able to tell (quickly) that the return type is an array.
π» Use Cases
See above.
The text was updated successfully, but these errors were encountered: