Skip to content

Conversation

@jakebailey
Copy link
Member

Fixes #47416

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jan 19, 2022
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

Looks good, although I have one question about the existing code.

}

if (contextToken.kind === SyntaxKind.GreaterThanToken && contextToken.parent) {
// <Component<string> /**/ />
Copy link
Member

Choose a reason for hiding this comment

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

on its own, this fix makes sense to me. How does it relate to the next comment, which says there are two possibilities -- jsxtext inside a <div> and non-jsxtext inside a type-argument-having <Component<T>? It seems like the second case might be handled entirely by the new code, but I'm not sure.

If it is, then the following check could be simplified.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought the same thing, but removing it breaks the test added in the original "don't do completions in JsxText" PR; I can't remember if I figured out why or not at this point, though, so can go double check.

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems like it's the comment that needs to be updated; the second listed possibility is no longer accurate as location in this case isn't GreaterThanToken, it's the entire element. I'll change the comment to reflect that it's only handling the first case.

@jakebailey jakebailey merged commit 3718182 into microsoft:main Jan 26, 2022
@jakebailey jakebailey deleted the fix-47416 branch January 26, 2022 22:45
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSX attribute completions sometimes don't work when tag type arguments are specified

3 participants