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
Can't uncomment HTML in JSX files #248
Comments
Could you please tell me, at each step, the result of |
Scenario import React, { Component } from 'react';
class Test extends Component {
render() {
return (
|<div className="Test" />
);
}
}
export default Test; Debug
Scenario (pressed import React, { Component } from 'react';
class Test extends Component {
render() {
return (
|{/* <div className="Test" /> */}
);
}
}
export default Test; Debug
I think this should already give you enough information. |
So the braces are recognized as javascript braces which is why it uses
the wrong comment definition. This is a weird special case. I don't know
yet how, if at all, tcomment should handle this. IMHO it would be better
to adapt the jsx syntax definition to highlight {/* ... */} as comment
but I don't know jsx and I cannot tell if this would make sense.
|
BTW what software did you use to create the screencast? |
@tomtom It does makes sense, but here's the thing: JSX should use I used Kap to record a part of the screen. |
I closed the issue because the latest commit should fix the uncommenting
issue, doesn't it. It's beyond the scope of tcomment to check the
context (previous syntax name) of a syntax. This should be done in the
syntax vim file that should assign a different syntax name to braces
within html comments. vim's syntax definitions provide a way to define
hierachies of syntax groups (i.e. one group following another), tcomment
does not.
|
@tomtom I pulled from master and this is indeed fixed. Thanks! |
@tomtom thanks for another improvement! Sadly, this doesn't seem to be working for me. Can we reopen?
Same for tsx files. Let me know if I can be of any more help! |
@kkoomen this Kap thing is neat by the way. If I can ever offer you a hot thank you beverage of choice let me know! |
@alextes I am on |
@kkoomen yup, neovim, I'll try and rule out plugins. |
|
Are you certain, you use the HEAD version from github?
|
Yup, certain @tomtom , but a friendly person already pointed out it's plugins interfering. To be specific |
@alextes I had some issues once using I am using |
Recently I've come across the same issue. Except that I've tried pretty much every jsx syntax plugin and it still gives me the behavior described by OP. Using
|
I'm sorry but I cannot follow the thread that closely. Could you please describe exactly what you're trying to achieve. JSX files seem to work fine with the default vim plugins. But I don't do jsx and I need some help to find out what's going wrong. It would also help if you installed tlib and the run |
@tomtom It's the same issue with uncommenting discussed earlier (gif originally by alextes): Here's the output of running As of jsx-plugins I'm using |
No matter which keystroke I use, I can't uncomment HTML in JSX files.
The text was updated successfully, but these errors were encountered: