Skip to content

Commit

Permalink
Auto select correct language for JSX files
Browse files Browse the repository at this point in the history
  • Loading branch information
joshpeng committed Oct 23, 2016
1 parent 3fea81d commit 201113b
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 50 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ When using your favorite theme, Visual Studio Code doesn't always display syntax

1. Uninstall any preexisting JavaScript grammar extensions (e.g. [Latest TypeScript and JavaScript Grammar](https://marketplace.visualstudio.com/items?itemName=ms-vscode.typescript-javascript-grammar), [Babel ES6/ES7](https://marketplace.visualstudio.com/items?itemName=dzannotti.vscode-babel-coloring)) to prevent conflicts
2. Install Sublime Babel via `ext install vscode-eslint` in Command Palette
3. When opening a `.js` or `.jsx` file, ensure the language mode is set to `JavaScript (Babel)`
3. When opening a `.js` or `.jsx` file, ensure the language mode is set to `JavaScript (Babel)` or `JavaScript React (Babel)`

![statusbar](https://raw.githubusercontent.com/joshpeng/Sublime-Babel-VSCode/master/images/statusbar.png)

Expand Down
116 changes: 67 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,69 @@
{
"name": "sublime-babel-vscode",
"displayName": "Sublime Babel",
"description": "Sublime Text's babel-sublime grammar in VS Code.",
"version": "0.2.0",
"publisher": "joshpeng",
"engines": {
"vscode": "^1.5.0"
},
"categories": [
"Languages"
],
"repository": {
"type": "git",
"url": "https://github.com/joshpeng/Sublime-Babel-VSCode"
},
"icon": "images/Babel.png",
"galleryBanner": {
"color": "#f5da55",
"theme": "light"
},
"license": "MIT",
"contributes": {
"languages": [
{
"id": "javascript",
"aliases": [
"JavaScript (Babel)"
],
"extensions": [
".js",
".jsx",
".babel",
".es6"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "javascript",
"scopeName": "source.js",
"path": "./syntaxes/sublime-babel.json"
},
{
"scopeName": "source.regexp.js",
"path": "./syntaxes/regex.json"
}
]
}
"name": "sublime-babel-vscode",
"displayName": "Sublime Babel",
"description": "Sublime Text's babel-sublime grammar in VS Code.",
"version": "0.2.1",
"publisher": "joshpeng",
"engines": {
"vscode": "^1.5.0"
},
"categories": [
"Languages"
],
"repository": {
"type": "git",
"url": "https://github.com/joshpeng/Sublime-Babel-VSCode"
},
"icon": "images/Babel.png",
"galleryBanner": {
"color": "#f5da55",
"theme": "light"
},
"license": "MIT",
"contributes": {
"languages": [
{
"id": "javascript",
"aliases": [
"JavaScript (Babel)"
],
"extensions": [
".js",
".jsx",
".babel",
".es6"
],
"configuration": "./language-configuration.json"
},
{
"id": "javascriptreact",
"aliases": [
"JavaScript React (Babel)"
],
"extensions": [
".js",
".jsx",
".babel",
".es6"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "javascript",
"scopeName": "source.js",
"path": "./syntaxes/sublime-babel.json"
},
{
"language": "javascriptreact",
"scopeName": "source.js",
"path": "./syntaxes/sublime-babel.json"
},
{
"scopeName": "source.regexp.js",
"path": "./syntaxes/regex.json"
}
]
}
}

0 comments on commit 201113b

Please sign in to comment.