Closed lehni closed 6 years ago
In short, this is because this package was originally ported from the atom equivalent that uses source.js.jsx
. I can take a closer look at this sometime this week, but I'm guessing that this would have some unintended side-effects with the react .jsx
extension.
I'm not sure, but we can easily test this. Here's the reason I doubt it may have effects:
"name": "JavaScript (with React support)",
"scopeName": "source.js",
Emphasis on (with React support)
. This is from the file linked to above.
I've just tested this by manually altering the version installed in ~/.vscode/mgmcdermott.vscode-language-babel-0.0.15
, restarting VSCode and then editing a JSX file.
It works without any problems, and Vetur is now also picking it up for syntax highlighting!
I've pushed out 0.0.16 with a fix for this. From my research of VSCode doing this, they only added source.js.jsx
to prevent all JavaScript files from being named JavaScript React
. Hopefully this doesn't have any unintended side-effects, but it seems to be working based on my testing.
That’s great! Thanks so much. I’ll test in a moment also.
I just tested and it works as expected. Thanks!
See https://github.com/vuejs/vetur/issues/825 for an issue I am encountering because vscode-language-babel uses the
source.js.jsx
identifier instead ofsource.js
for the JavaScript scope.What is the reason behind this difference to VSCode's own highlighter? (See https://github.com/Microsoft/vscode/blob/442e5e202a89c1f8efe642c89c0554cab1f15a9e/extensions/javascript/syntaxes/JavaScript.tmLanguage.json#L9)
Could a change to
source.js
be considered to make this extension compatible with Vetur?