-
Notifications
You must be signed in to change notification settings - Fork 3
Add Babel JSX support and syntax highlighting #9
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
Conversation
Update README with a link to the original repository. Remove: -Tests -Screenshots -Theme files -packson.json -Version update messages
With sublime_syntax_convertor, convert .tmLanguage files for JSX to .sublime-syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks.
So I'm guessing that the sublime-syntax
files are derived from the .tmLanguage
files. In this case, we don't need both. Would you like to try removing the .tmLanguage
files and seeing if this still works as expected?
All the other files are good to include, we do use tmPreferences
for doing auto-indent, for instance.
In any case, this seems like a good addition, thanks!
-Having used them to generate .sublime-syntax files, the .tmLanguage files can be removed.
Just added a commit removing the I confirmed that removing the I am a little curious about the theme files. Including them caused Xi-Mac's Theme dropdown to be empty. This suggests that Xi does look at them, but also that they're not supposed to be there. I just removed the .tmTheme files, because that makes it work. |
Hmm I'm slightly confused between your usage of
Let's tall both These files describe a way of associating 'scope tags' with regions of a file. You can sort of think of these as being souped up css selectors; there are fuller docs here.
So: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, looking through this again: There are also the .YAML-tmXXXX
files. Would you double check and see if these are included in other syntaxes in this repo, and remove them if they aren't?
Okay, that makes sense. There were some The YAML language files appear to also be some translation of the .tmLangauge file into yaml, although not in the same format as .sublime-syntax. When I get a chance, I’ll double check and remove them. |
These files were YAML translations of .tmLanguage files, but in a different syntax than .submlime-syntax. I think they were used for generating the .tmLanguage files. Regardless, they were not being used.
I removed the YAML files here, @cmyr. No rush, but wanted to make sure you saw. |
Okay, going to merge this. It looks like the auto-indent rules aren't quite complete (e.g. in the following snippet the line after the conditional is not auto-indented) but the highlighting seems fine: if (i % 15 == 0)
log "FizzBuzz"; |
This adds the Babel ES6, JSX syntax definitions. This allows Xi to have syntax highlighting for .jsx files, popularly used by React.
Theoretically, Xi only needs the single
JavaScript (Babel).sublime-syntax
file. I opted to include other files from the original repository which have information relevant to the language in case a future (or current that I'm unaware of) frontend implements them. I removed other files relevant to the original repository, like.git
,package.json
, and tests. However, I can imagine reasons to re-evaluate this choice.I also plan on making PRs for Swift and Typescript, the other languages I've noticed are conspicuously absent from Xi.