Skip to content
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

Scoping JSX comment brackets #279

Closed
LeonardoGentile opened this issue Aug 31, 2016 · 6 comments
Closed

Scoping JSX comment brackets #279

LeonardoGentile opened this issue Aug 31, 2016 · 6 comments

Comments

@LeonardoGentile
Copy link

It would be nice if jsx comment could be scoped as comment somehow:

{/* comment */}

The opening bracket is scoped as:

source.js
meta.class.js
meta.group.braces.curly.js
meta.group.braces.round.js
meta.jsx.js
meta.embedded.expression.jsx
punctuation.section.embedded.begin.jsx

I am using a custom color for highlight the opening and closing brackets for JSX expressions to make them more visible.

But I would also like to render the two blocks {/* and */} (and all their contents) with the same colors of all the other comments in js. This is not possible because the the block {/* */} are not scoped. While the inner content {/* CONTENT */} is correctly scoped as comment.

Would it be possible to scope the opening and closing jsx comment brackets? Thansk

@LeonardoGentile LeonardoGentile changed the title Scoping JSX comment Scoping JSX comment brackets Aug 31, 2016
@zertosh
Copy link
Member

zertosh commented Nov 28, 2016

Hmm, I'm not sure I understand what you're asking. Using this notation, what is it you'd like to see?

<div>{/* comment */}</div>
//^ meta.jsx meta.tag entity.name.tag
//<- meta.jsx meta.tag punctuation.definition.tag.begin
//  ^ meta.jsx meta.tag punctuation.definition.tag.end
//   ^ meta.jsx meta.embedded.expression punctuation.section.embedded.begin
//    ^^^^^^^^^^^^^ meta.jsx meta.embedded.expression comment.block
//    ^^ meta.jsx meta.embedded.expression comment.block punctuation.definition.comment.begin
//               ^^ meta.jsx meta.embedded.expression comment.block punctuation.definition.comment.end
//                 ^ meta.jsx meta.embedded.expression punctuation.section.embedded.end
//                  ^^ meta.jsx meta.tag punctuation.definition.tag.begin
//                    ^^^ meta.jsx meta.tag entity.name.tag
//                       ^ meta.jsx meta.tag punctuation.definition.tag.end

@LeonardoGentile
Copy link
Author

I'd like the entire block {/*(including the bracket) to be scoped as

source.js 
meta.jsx.js
meta.embedded.expression.jsx
comment.block.js
punctuation.definition.comment.begin.js

and the entire closing block */} (including the bracket) to be scoped as

source.js
meta.jsx.js
meta.embedded.expression.jsx
comment.block.js
punctuation.definition.comment.end.js

@zertosh
Copy link
Member

zertosh commented Nov 28, 2016

Hmm, this may fix an issue with uncommenting. I'll circle back to this in #293.

@jcrben
Copy link

jcrben commented May 4, 2017

@zertosh do you mean this could fix the issue with the keyboard shortcut toggling comments discussed in #262?

@ukazap
Copy link

ukazap commented May 30, 2017

any news on this?

@Thom1729
Copy link
Contributor

This should be fixed in v10.0.0-beta.1. See #379 for more information on the new release. Please report any problems with v10 in a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants