-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Help WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone
Description
π Search Terms
generic, function, class, call, apply, construct, "type parameter", "type argument", completion, suggestion, autocomplete, intellisense
β Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
β Suggestion
#43526 implemented completions within type arguments of generic types. It would be nice to extend that behavior to the expression level, suggesting completions within type arguments of generic function calls, new
expressions, etc.
π Motivating Example
In this code, foo
is suggested:
type A<T extends { foo: unknown }> = T
type _ = A<{/* trigger completions here */}>
In this code it's not:
function f<T extends { foo: unknown }>() {}
f<{/* trigger completions here */}>()
Related Issues
- No string completions in type arguments where constrained to string literal unionΒ #52898 and No IntelliSense for generic literal typesΒ #34771 both focus specifically on completions in string literals within type arguments.
- No completions from
tsserver
for property values in generic type argumentsΒ #56299 is about completions of property values within type arguments, which Completion list for type literals in type argumentsΒ #43526 did not implement (it only handled property names).
RyanCavanaugh
Metadata
Metadata
Assignees
Labels
Help WantedYou can do thisYou can do thisPossible ImprovementThe current behavior isn't wrong, but it's possible to see that it might be better in some casesThe current behavior isn't wrong, but it's possible to see that it might be better in some cases