New JSX language under JavaScript group

A specific grammar is needed to highlight .jsx files
Thus, there are now in a distinct language but still in the JavaScript group
This commit is contained in:
Paul Chaignon
2015-09-05 13:31:17 +02:00
parent 61102812a0
commit 1f46cfafa7
5 changed files with 38 additions and 1 deletions

3
.gitmodules vendored
View File

@@ -677,3 +677,6 @@
[submodule "vendor/grammars/X10"]
path = vendor/grammars/X10
url = git@github.com:x10-lang/x10-highlighting.git
[submodule "vendor/grammars/language-babel"]
path = vendor/grammars/language-babel
url = https://github.com/gandm/language-babel

View File

@@ -314,6 +314,9 @@ vendor/grammars/json.tmbundle:
- source.json
vendor/grammars/kotlin-sublime-package:
- source.Kotlin
vendor/grammars/language-babel/:
- source.js.jsx
- source.regexp.babel
vendor/grammars/language-clojure:
- source.clojure
vendor/grammars/language-coffee-script:

View File

@@ -1575,6 +1575,14 @@ JSONiq:
- .jq
tm_scope: source.jq
JSX:
type: programming
group: JavaScript
extensions:
- .jsx
tm_scope: source.js.jsx
ace_mode: javascript
Jade:
group: HTML
type: markup
@@ -1628,7 +1636,6 @@ JavaScript:
- .jsfl
- .jsm
- .jss
- .jsx
- .njs
- .pac
- .sjs

23
samples/JSX/sample.jsx Normal file
View File

@@ -0,0 +1,23 @@
'use strict';
const React = require('react')
module.exports = React.createClass({
render: function() {
let {feeds, log} = this.props;
log.info(feeds);
return <div className="feed-list">
<h3>News Feed's</h3>
<ul>
{feeds.map(function(feed) {
return <li key={feed.name} className={feed.fetched ? 'loaded' : 'loading'}>
{feed.data && feed.data.length > 0 ?
<span>{feed.name} <span className='light'>({feed.data.length})</span></span>
: 'feed.name' }
</li>
})}
</ul>
</div>;
}
});