Closed kevinresol closed 7 years ago
I'm not sure that should be part of this repo, it's not exactly part of Haxe, rather third-party frameworks.
I'm not sure that should be part of this repo, it's not exactly part of Haxe, rather third-party frameworks.
No problem, but I wonder if I create a new extension for that, will it be able to coexist with vshaxe?
That's a good question. I think you may be able override the Haxe grammar if you have an extension that is loaded after vshaxe, but extension loading order is undefined. It would be cleaner to create a new language ID (haxe-react
or whatever) and then remap .hx
to that in haxe-react projects in settings.json
.
https://github.com/vshaxe/vshaxe/blob/1.7.0/package.json#L197-L230
"files.associations": {
"*.hx": "haxe-react"
}
Also, I don't think it's necessary to duplicate the entire Haxe grammar - you can include reference / include other grammars (there may even be a jsx one you can reuse that way). For instance, we do that to achieve Haxe highlighting in .hxml files after --macro
:
There's another (simple) example here:
https://github.com/vshaxe/vshaxe-debug-tools/blob/master/syntaxes/hxtest.json
Note: separate language IDs seems to be the approach that VSCode has taken for JS / TS as well:
Thanks for the info. I will take care of them :)
But will vshaxe activate for custom langs?
@nadako Why does it need to activate if this is implemented via a separate extension?
Oh, for completion etc of course. Hm...
Considering #30 is closed, this can probably be closed too.
I don't mind if this extension doesn't do the actual highlighting. But at least we need a mechanism. Especially when inline markup may become a standard feature. Shall we reopen and let the discussion go on?
Hi, guys! A supporting jsx hightlight and go to definition action is very necessary. So it's unconvenient to use vscode in haxe-react projects. HaxeDevelop can do this things but it runs on windows only.
I see language-haxe (atom) did it (screenshot) So I think it is possible to do.
Or let me know where to start from, I may give it a try.