Skip to content

Basic JSX attribute snippet fixes #51855

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 9, 2023

Conversation

zardoy
Copy link
Contributor

@zardoy zardoy commented Dec 11, 2022

Fixes #51845
Fixes #47302

It wasn't working in the following cases:

;<SomeElem foo={''} [||] />
;<SomeElem foo={''} [||] x />
;<SomeElem foo={''} x[||] />
;<SomeElem foo={''} x[||] f />

(see linked issue with playground link)

On that line:

if (previousToken.kind === SyntaxKind.CloseBraceToken && currentToken.kind === SyntaxKind.GreaterThanToken) {

;<div foo={''} [||] /> // currentToken.kind = Slash
;<div foo={''} [||] test /> // currentToken.kind = Identifier

I couldn't figure out why currentToken.kind === SyntaxKind.GreaterThanToken is being used here, documentation comment doesn't state why this restriction is required. Also I saw all tests are passing locally.

hope doesn't break anything else
@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 11, 2022
@zardoy
Copy link
Contributor Author

zardoy commented Dec 13, 2022

It also seems to be fixing #47302 not sure why, but I added tests and updated body

@typescript-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 Dec 13, 2022
@andrewbranch andrewbranch merged commit 4b69e13 into microsoft:main Jan 9, 2023
@andrewbranch
Copy link
Member

Thanks @zardoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

No JSX attributes snippets after curly JSX attribute Completion Detection
4 participants