Repository navigation
Closed
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
tsserverfor 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).
Reacted by Ryan Cavanaugh
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
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
Ryan Cavanaugh (@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.
mkantor commentedon Aug 1, 2025
I've opened another pull request which includes the aforementioned enhancements along with the fix for this issue.