I´ve installed Babel JSX support in my Sublime Text 3.
It works fine, but sometimes I loose formatting os certaing pieces of the code.
To recover the correct coloring and highlightining, I just go View->Syntax->Babel->Javascript (Babel).
At the end of the day I keep doing this procedure tons of times, as I´m always loosing formatting.
I need to solve 2 problems:
a) I want to put operation in a F key. I´ve tried with no success the following key binding:
{ "keys": ["f11"], "command": "set_file_type", "args": { "syntax": "Packages/JavaScript (Babel).tmlanguage"}}
It gives me an error saying it cannot find the package and loosing all formatting.
How to put the View->Syntax->Babel->Javascript (Babel) to a function key ?
b) Does anyone knows why Sublime Text 3 loose formatting with JSX code ? This happens when I open a saved file or when I create an arrow function. Just after selecting View->Syntax->Babel->Javascript (Babel) it turns to highlight correctly.
Any ideas if this is a package bug and how to solve it ?
Thanks for helping.