-
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 codeThis wouldn't change the runtime behavior of existing JavaScript codeThis could be implemented without emitting different JS based on the types of the expressionsThis 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-TypesThis feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-GoalsTo pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
β 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
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
mkantor commentedon May 22, 2025
I've started working on this already, but couldn't find an open issue about it so figured I ought to file one.
mkantor commentedon Jul 3, 2025
@RyanCavanaugh sorry for the direct mention, but since you tagged this as "help wanted", did you miss the pull request I'd opened?
I have some other completion enhancements that I'm eager to submit, but they're based on the changes in that pull request.