Suggestion
π Search Terms
- inlay hints
- return type
- function like
- JavaScript
β Suggestion
Currently the javascript.inlayHints.functionLikeReturnTypes.enabled setting in VS Code adds inlay hints to JS functions that do not have an explicit @return annotation:
// Shown here
function foo() /* : number */ {
return 1;
}
// But not here here
/** @return {number} */
function foo() {
return 1;
}
This feels inconsistent, since I now have to look in different locations for the type information
I propose adding a new option that always enables these return types in JS files, even if there is an @return type annotation.
In the example above, this would result in the inlay hints showing on both functions:
function foo() /* : number */ {
return 1;
}
/** @return {number} */
function foo() /* : number */ {
return 1;
}
This lets me read the code more like standard TypeScript