-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
JSX support breaks in v2.1.4 #60
Comments
Did you tried to start abbreviation with |
@sergeche More info: I've tried it in both function and class components. With and without parent, and with shorter syntax of React Fragments Do you mean with: |
Which syntax do you use for JSX? |
The one in top 100: https://packagecontrol.io/packages/JSX |
I mean this: https://github.com/emmetio/sublime-text-plugin#jsx-support Check out v2.1.6, it might fix this issue with JS syntax. It looks like you’re using some JS syntax for JSX highlighting. |
@sergeche Will check it out, can't see v2.1.6 on Command Pallette search yet. Though yes, I'm getting the same problem in v2.1.4 w/ this as well. |
Try to restart editor, package might be updated automatically |
Just updated to v2.1.7 - same issue. |
I also updated to v2.1.7 this morning and have the same issue |
Please describe precisely what you do and what abbreviation you type. What syntax do you set, sample files etc. And check ST console if there are any errors |
My Emmet Plugin got updated today and I'm also noticing some weird behavior. Usually I was able to expand with I had this keybinding set up before but now it's not working with or without the keybinding added. keybinding{ // put comma-separated syntax selectors for which
] |
@asumaran you should prefix JSX abbreviations with And you should remove this keybinding, it’s no longer valid |
@sergeche Thanks! It seems to be working fine the way it says in the Readme. I'll remove the keybinding. |
@sergeche It suddenly works now today. I haven't updated Emmet v2.1.7 today and yet typing |
I guess there was some kind of invalid update. I’ve released a few versions more recently, might be automagically fixed |
Oh damn, is it not possible anymore to just start with a dot and press tab and get a div with className? How can I restore this behaviour? |
@h0jeZvgoxFepBQ2C works for me. Make sure you set document syntax to HTML |
In a JSX File? |
In JSX, it’s |
Yeah, but my question was how I can restore the old behaviour? Before the update it worked without writing |
If you don’t want to use native ST snippets in JSX, you can mimic old behaviour |
Thanks, I really prefer the old way more :) |
@sergeche Doing what you suggested above overrides the snippets outside of markup in Javascript/JSX files as well. import React from "react"
fun<tab> // Exapands to <fun></fun> here.
export default () => {
return <>
fun<tab> // Also expands to <fun></fun> here.
</>
} Desired: import React from "react"
fun<tab> // Should expand to
function () {
}
// Also emmet autocomplete shouldn't be present here.
export default () => {
return <>
fun<tab> // Also expands to <fun></fun> here.
</>
} I googled a bit and tried changing some scope to |
@a-y-u-s-h that’s the reason why Emmet v2 required |
@sergeche Could difference of scopes be one or are there any edge cases in this as well?: scopes on both of those places are different. Hitting |
@a-y-u-s-h there’s lots of edge cases here. For example, you can’t have proper scope for cases like this: const elem = div| // Tab should convert to <div> |
I see. Yeah you're right. But I think keeping the parens scope (or the longer one with In my experience, this actually a very rare usecase (though I completely get it that this is a valid edge case): const elem = div| I think this is much more common (and it has almost same scope) in: const elem = props => div| And these are just function components. Usually you always return JSX instead of assigning it to a variable. I'm a sucker for generalization as well. And I won't insist on it, but will let you decide if you think it's easy to implement |
Added |
After adding:
JSX
document syntax - undesirable, because syntax highlighters for JSX syntax aren't feature-rich, whereas others are (Javascript, Typescript) so it should support them all.<h1 class="name"></h1>
inside JSX - undesirable because it's still behaving like HTML expansions.Would be awesome if somehow reverting to older version works or maybe a newer update is published with older code (since too many people will face issues with so many things breaking).
The text was updated successfully, but these errors were encountered: