Skip to content

Enhance type argument completions - #62170

Merged
Jake Bailey (jakebailey) merged 6 commits into
microsoft:mainfrom
mkantor:type-argument-completions
Sep 30, 2025
Merged

Enhance type argument completions#62170
Jake Bailey (jakebailey) merged 6 commits into
microsoft:mainfrom
mkantor:type-argument-completions

Conversation

@mkantor

@mkantorMatt Kantor (mkantor) commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

#43526 implemented limited support for completions within type arguments, but only for type arguments of types (not values like generic function calls), and only for specific locations within the type literal (e.g. property names of object types). This pull request generalizes type argument completions such that suggestions now appear in many more scenarios, including:

  • Type arguments of expressions:
    • function calls (f<…>())
    • new expressions (new Foo<…>())
    • tagged templates (tag<…>`blah`)
    • JSX elements (<Component<…>/>)
    • decorators (@decorator<…> class {})
    • instantiation expressions (f<…>)
  • Types of property values within type arguments (Foo<{ x: … }>)
  • String literal types (Foo<"…">)
  • Tuple types (Foo<[…]>)

Suggested completions are derived from the relevant type parameter's constraint.

This pull request subsumes #61758 and includes the additional enhancements mentioned in that pull request's description.

Fixes#61751.
Fixes#56299.
Fixes#52898.
Fixes#34771.

@i-ayushh18

Copy link
Copy Markdown

🤖 AI Assistant: Task completed: PR #62170: Enhance type argument completions

URL: #6217...

1 similar comment
@i-ayushh18

Copy link
Copy Markdown

🤖 AI Assistant: Task completed: PR #62170: Enhance type argument completions

URL: #6217...

@mkantor

Copy link
Copy Markdown
ContributorAuthor

Ayush Verma (@i-ayushh18) I don't know if this is intentional, but it seems that you have a bot which is spamming a bunch of nonsense comments across many pull requests. If it is intentional, please cut it out.

@i-ayushh18

Copy link
Copy Markdown

Ayush Verma (@i-ayushh18) I don't know if this is intentional, but it seems that you have a bot which is spamming a bunch of nonsense comments across many pull requests. If it is intentional, please cut it out.

Sorry for the thing,a bot was responsible for that,will suspend that at latest!

@edperetokin

Copy link
Copy Markdown

I have tested this changes locally, and it works well for me.

Looking forward to seeing it merged and released soon.

Comment threadsrc/compiler/checker.ts Outdated
Comment threadsrc/compiler/checker.ts Outdated
@typescript-botTypeScript Bot (typescript-bot) added the For Backlog Bug PRs that fix a backlog bug label Aug 13, 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
@jakebailey

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) pack this

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 8, 2025

Copy link
Copy Markdown
Contributor

Starting jobs; this comment will be updated as builds start and complete.

CommandStatusResults
pack this✅ Started✅ Results

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 8, 2025

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
"devDependencies": {
"typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/166007/artifacts?artifactName=tgz&fileId=408A29254ED740790FC36224712B5EECC5FE4E3336E5E99904E2F4F26D2F388802&fileName=/typescript-6.0.0-insiders.20250908.tgz"
}
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@6.0.0-pr-62170-7".;

@jakebaileyJake Bailey (jakebailey) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I'm concerned, this seems fine to me.

@github-project-automationgithub-project-automationBot moved this from Not started to Needs merge in PR BacklogSep 30, 2025
@jakebailey
Jake Bailey (jakebailey) merged commit d4b15eb into microsoft:mainSep 30, 2025
33 checks passed
@github-project-automationgithub-project-automationBot moved this from Needs merge to Done in PR BacklogSep 30, 2025
@mkantor

Copy link
Copy Markdown
ContributorAuthor

Thanks for reviewing/merging!

@mkantor
Matt Kantor (mkantor) deleted the type-argument-completions branch September 30, 2025 21:51
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

6 participants

@mkantor@i-ayushh18@edperetokin@jakebailey@typescript-bot@andrewbranch