Open API request
Hi guys,
I'm implementing a Mybatis plugin. There are some annotations (@Select, @Delete, etc. ) in Mybatis that accept an array of strings as arguments, these strings are concatenated with a single space to form a complete SQL statement. I want to inject SQL language into these strings. Currently, SQL can only be injected in a string separately, which is not the Mybatis case.
So I have to find a way to concatenate the strings as single SQL. After a look at the open source code, I think I know that com.intellij.psi.impl.source.tree.injected.JavaConcatenationInjectorManager$Concatenation2InjectorAdapter does something like that. But this class has the first order without an id, so I have no chance to interact with the injection subsystem.
Can anyone help me a little bit, please?
Please sign in to leave a comment.
I think you'll need to implement com.intellij.lang.injection.MultiHostInjector
and in its com.intellij.lang.injection.MultiHostInjector#getLanguagesToInject method call
several times for each annotation.
Thank you so much for your tip, I tried it and it did work. Thank you again.