Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight inline templates (jsx/hxx/html, etc) #28

Closed
kevinresol opened this issue Jun 8, 2017 · 11 comments
Closed

Highlight inline templates (jsx/hxx/html, etc) #28

kevinresol opened this issue Jun 8, 2017 · 11 comments

Comments

@kevinresol
Copy link

kevinresol commented Jun 8, 2017

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.

@Gama11
Copy link
Member

Gama11 commented Jun 8, 2017

I'm not sure that should be part of this repo, it's not exactly part of Haxe, rather third-party frameworks.

@kevinresol
Copy link
Author

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?

@Gama11
Copy link
Member

Gama11 commented Jun 8, 2017

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:

- include: 'source.hx'

There's another (simple) example here:

https://github.com/vshaxe/vshaxe-debug-tools/blob/master/syntaxes/hxtest.json

@Gama11
Copy link
Member

Gama11 commented Jun 8, 2017

Note: separate language IDs seems to be the approach that VSCode has taken for JS / TS as well:

@kevinresol
Copy link
Author

Thanks for the info. I will take care of them :)

@nadako
Copy link
Member

nadako commented Jun 8, 2017

But will vshaxe activate for custom langs?

@Gama11
Copy link
Member

Gama11 commented Jun 8, 2017

@nadako Why does it need to activate if this is implemented via a separate extension?

@Gama11
Copy link
Member

Gama11 commented Jun 8, 2017

Oh, for completion etc of course. Hm...

@Gama11
Copy link
Member

Gama11 commented Jun 29, 2017

Considering #30 is closed, this can probably be closed too.

@Gama11 Gama11 closed this as completed Jun 29, 2017
@kevinresol
Copy link
Author

kevinresol commented Aug 10, 2017

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?

@djaonourside
Copy link

djaonourside commented Nov 10, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants