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

Several scope names per pattern #365

Closed
pchaigno opened this issue Oct 2, 2018 · 3 comments
Closed

Several scope names per pattern #365

pchaigno opened this issue Oct 2, 2018 · 3 comments

Comments

@pchaigno
Copy link

pchaigno commented Oct 2, 2018

Some of the patterns in the grammar file have several scope names:

'1': {name: meta.tag.jsx punctuation.definition.tag.begin.jsx}
'2': {name: meta.tag.jsx entity.name.tag.jsx}
end: (</)(\2)(>)|(/>)
endCaptures:
'1': {name: meta.tag.jsx punctuation.definition.tag.begin.jsx}
'2': {name: meta.tag.jsx entity.name.tag.jsx}

I don't know whether this works in Sublime Text, but when using this grammar to highlight files on GitHub.com (cf. github-linguist/linguist#4223), it causes HTML highlighting to break inside JSX files, as shown in this Ligthshow example.

@Thom1729
Copy link
Contributor

Can you provide more context on how you are using babel-sublime outside Sublime? I am currently working on a complete replacement of the syntax definition with a new .sublime-syntax, and this will probably not be compatible with tools other than Sublime.

@pchaigno
Copy link
Author

We use a fork of babel-sublime in Linguist to highlight JSX code on GitHub.com (cf. github-linguist/linguist#4223). Linguist doesn't support .sublime-syntax unfortunately (cf. github-linguist/linguist#3214).

@Thom1729
Copy link
Contributor

Unfortunately, I don't think it will be practical to maintain the old tmLanguage definition going forward. It's very badly out of date, and .sublime-syntax is capable of providing much better highlighting. If Linguist is using a fork, then it probably makes the most sense to maintain that fork to serve Linguist's needs without worrying about divergence from babel-sublime.

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

No branches or pull requests

2 participants