-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Emmet not working in JSX statement when condition contains less than #55411
Comments
Thanks for reporting @mathdeziel @JacksonKearl Can you take a look at this next week? https://github.com/Microsoft/vscode/blob/master/extensions/emmet/src/defaultCompletionProvider.ts would be the place to start. |
Looks like the real culprit is the
|
Good catch @JacksonKearl, you're right! I should've tested that... Here is a GIF attesting this hypothesis (PS: don't look at the typo in the comment...) I also retitled the issue to better reflect the real problem. Thanks! |
This was likely caused by #35128, where we wanted to disable emmet inside tags:
I'll have to think about what the best solution here is. An obvious one would be to disable backtracking to look for opening brackets once you reach some set of characters (maybe semicolon, end paren, or newline?). But I'm not convinced that's the right fix. |
When backtracking, if we reach |
But in this case, the character after is a space, which is valid as a tag too |
space is not valid in a tag name as far as I know... |
Based on the W3C recommendation, spaces are valid in a tag name but only after the tag name itself, even if there are no attributes. From my understanding,
So I would guess @ramya-rao-a's solution would work. |
Looks like you’re right. I thought |
I took the liberty to create a PR since it seemed to be an easy fix for a first OSS contribution with the help of @ramya-rao-a's recommendations -- which were spot on 😉 . |
PR has been merged, closing the issue. |
1.25.1
(also tried w/1.26.0-insider
)Windows_NT ia32 10.0.17134
I was going through an intro course to React and stumbled on some issues with Emmet. After reading the documentation, I got it to work for the most part, but I couldn't find anything regarding to my issue.
There seems to be a bug with emmet in
else if
blocks with JSX in .JS and .JSX files.Edit: A member of the community pointed out that the issue was related to the less than sign (
<
) and not to theelse if
and so the issue was renamed. Pleased read through the other comments for more information.In short, the tab completion will work in a
return
if it is located in anif
or anelse
, but will not work if it is located in anelse if
block (please refer to the GIF below).Steps to Reproduce:
renderChangePercent
around line 19 of the file, the comments will show where emmet works and where is located the bug.Here is a GIF of the issue :
Here is my emmet config :
And here is the file for testing :
The text was updated successfully, but these errors were encountered: