Skip to content

fix(3410): preserve type arguments in hover for qualified names#3412

Merged
weswigham merged 7 commits intomicrosoft:mainfrom
a-tarasyuk:fix/3410
Apr 21, 2026
Merged

fix(3410): preserve type arguments in hover for qualified names#3412
weswigham merged 7 commits intomicrosoft:mainfrom
a-tarasyuk:fix/3410

Conversation

@a-tarasyuk
Copy link
Copy Markdown
Contributor

Fixes #3410

@a-tarasyuk a-tarasyuk marked this pull request as ready for review April 15, 2026 20:03
Copy link
Copy Markdown
Member

@weswigham weswigham left a comment

Choose a reason for hiding this comment

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

This is technically an abuse of the AST - ExpressionWithTypeArguments is only naturally parsed in the context of class extends clauses, however it's probably fine for making hover match up better, and AFAIK nothing in the emit pipeline relies on ExpressionWithTypeArguments only appearing in class extends positions (I would feel better about this with a strong type system, but alas).

Instantiation expression type arguments normally live exclusively on the TypeQuery itself, which is something we need to double check isn't being doubled up on here; if we go to put an ExpressionWithTypeArguments into a TypeQuery in the node builder, we probably should swap the type arguments up into the type query. I'll also be surprised if you don't need to update failing fourslash tests.

Comment thread internal/nodebuilder/types.go Outdated
Comment thread internal/ast/precedence.go
@ahejlsberg
Copy link
Copy Markdown
Member

ahejlsberg commented Apr 16, 2026

This is technically an abuse of the AST - ExpressionWithTypeArguments is only naturally parsed in the context of class extends clauses

That used to be the case, but these days we parse ExpressionWithTypeArguments for instantiation expressions, so they can definitely occur in regular expressions.

@weswigham
Copy link
Copy Markdown
Member

weswigham commented Apr 16, 2026

Expressions, yes, not usually arbitrary expressions within type nodes, though - only at the end of a typeof query. declare const x: typeof Something<string>.Other does not parse (yet is what we're emitting here), but declare const x: typeof Something<string> does.

Comment thread internal/checker/nodebuilderimpl.go Outdated
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 7.0 RC milestone Apr 17, 2026
@a-tarasyuk a-tarasyuk requested a review from weswigham April 20, 2026 17:58
@weswigham weswigham added this pull request to the merge queue Apr 21, 2026
Merged via the queue into microsoft:main with commit 6b8645e Apr 21, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Type serializer omits type arguments of outer functions

4 participants