How to inject a language with nested injections

Answered

In my plugin, I'm working on adding support for the syntax of some sort of selectors defined within string literals of the host language. A selector can mix some well known languages like CSS and XPath as well as some custom notations.
My plan is to make some sort of composite language for the selector which the user of plugin can apply to a string literal in their code (for example, using a @Language annotation)
Is it possible to somehow reuse existing CSS and XPath languages from the platform?
I tried to use nested injection but it seems this is not supported by the platform, right?
Could you suggest any other approach?

1 comment
Comment actions Permalink

You can inject different languages in different "parts" of the InjectionHost, but it seems this is not what you want here.

Technically, you could build your own custom language and re-use/delegate it to existing language's parsing/PSI, but this might be quite tricky and require quite some efforts.

0

Please sign in to leave a comment.