Skip to content

Suggest completions for type arguments of expressions - #61758

Closed
Matt Kantor (mkantor) wants to merge 1 commit into
microsoft:mainfrom
mkantor:completions-of-type-arguments-in-more-places
Closed

Suggest completions for type arguments of expressions#61758
Matt Kantor (mkantor) wants to merge 1 commit into
microsoft:mainfrom
mkantor:completions-of-type-arguments-in-more-places

Conversation

@mkantor

@mkantorMatt Kantor (mkantor) commented May 23, 2025

Copy link
Copy Markdown
Contributor

Completions are now suggested within type arguments of the following expression types (based on type parameter constraints):

  • function calls (f<…>())
  • new expressions (new Foo<…>())
  • tagged templates (tag<…>`blah`)
  • JSX elements (<Component<…>/>)
  • decorators (@decorator<…> class {})
  • instantiation expressions (f<…>)

Fixes#61751.

Limitations

This comment may also be useful reading.

@github-project-automationgithub-project-automationBot moved this to Not started in PR BacklogMay 23, 2025
@typescript-botTypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label May 23, 2025
@typescript-bot

Copy link
Copy Markdown
Contributor

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page.

Also, please make sure Daniel Rosenwasser (@DanielRosenwasser) and Ryan Cavanaugh (@RyanCavanaugh) are aware of the changes, just as a heads up.

Comment threadsrc/compiler/utilities.ts
Comment threadsrc/compiler/types.ts
@mkantor

Matt Kantor (mkantor) commented Jun 2, 2025

Copy link
Copy Markdown
ContributorAuthor

After some consideration I removed 53d3f29 from this branch, since it's pretty tangential. If there's appetite for it I could submit another pull request.

This means @typescript-bot's comment is no longer relevant.

@mkantor
Matt Kantor (mkantor)force-pushed the completions-of-type-arguments-in-more-places branch from 04bc7b4 to a3778dcCompareJuly 3, 2025 11:18
@typescript-botTypeScript Bot (typescript-bot) added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jul 3, 2025
Previously, `getTypeArgumentConstraint` could only find constraints for
type arguments of generic type instantiations. Now it additionally
supports type arguments of the following expression kinds:
- function calls
- `new` expressions
- tagged templates
- JSX expressions
- decorators
- instantiation expressions
@mkantor
Matt Kantor (mkantor)force-pushed the completions-of-type-arguments-in-more-places branch from a3778dc to 4bf65ffCompareJuly 11, 2025 20:21
@mkantor

Matt Kantor (mkantor) commented Aug 1, 2025

Copy link
Copy Markdown
ContributorAuthor

I got nervous about keeping all of the stacked improvements to myself, so opened #62170 which includes them (along with the changes from this pull request). I'll probably close this one under the assumption that these enhancements are all desirable (if only loosely coupled to one another).

@mkantor

Copy link
Copy Markdown
ContributorAuthor

As mentioned above, see #62170 instead. If you'd prefer that I instead submit each of those commits as a separate pull request (as was my original intention), please let me know.

@github-project-automationgithub-project-automationBot moved this from Not started to Done in PR BacklogAug 2, 2025
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Feb 3, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog BugPRs that fix a backlog bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Completions for type arguments of expressions

2 participants

@mkantor@typescript-bot