Problem with injecting EL-Language into XML

This code always produces the exception below, tried XmlText as well..


PsiManager psiManager = PsiManager.getInstance(project);
psiManager.registerLanguageInjector(new LanguageInjector() {

public void getLanguagesToInject(@NotNull PsiLanguageInjectionHost host,
@NotNull InjectedLanguagePlaces injectionPlacesRegistrar) {
if (host.getLanguage() == StdLanguages.XML && host.getOriginalElement() instanceof XmlAttributeValue) {
injectionPlacesRegistrar.addPlace(StdLanguages.EL,
new TextRange(1, host.getOriginalElement().getTextLength() - 1),
"",
"");
}
}
});

No message
java.lang.NullPointerException
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.a(InjectedLanguageUtil.java:97)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.access$300(InjectedLanguageUtil.java:119)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil$InjectedPsiProvider$1.addPlace(InjectedLanguageUtil.java:1)
at de.lineas.lit.integralreport.plugin.PsiInjector$1.getLanguagesToInject(PsiInjector.java:32)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil$InjectedPsiProvider.b(InjectedLanguageUtil.java:23)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil$InjectedPsiProvider.compute(InjectedLanguageUtil.java:21)
at com.intellij.psi.impl.CachedValueImpl.getValue(CachedValueImpl.java:42)
at com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil.getInjectedPsiFiles(InjectedLanguageUtil.java:129)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.getInjectedPsi(XmlAttributeValueImpl.java:16)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.a(HighlightVisitorImpl.java:168)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitElement(HighlightVisitorImpl.java:115)
at com.intellij.psi.XmlElementVisitor.visitXmlElement(XmlElementVisitor.java:22)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitXmlElement(HighlightVisitorImpl.java:338)
at com.intellij.psi.XmlElementVisitor.visitXmlAttributeValue(XmlElementVisitor.java:62)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visitXmlAttributeValue(HighlightVisitorImpl.java:553)
at com.intellij.psi.impl.source.xml.XmlAttributeValueImpl.accept(XmlAttributeValueImpl.java:11)
at com.intellij.codeInsight.daemon.impl.analysis.HighlightVisitorImpl.visit(HighlightVisitorImpl.java:371)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.a(GeneralHighlightingPass.java:15)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.doCollectInformation(GeneralHighlightingPass.java:119)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:59)
at com.intellij.codeInsight.daemon.impl.UpdateThread$2.run(UpdateThread.java:6)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:121)
at com.intellij.codeInsight.daemon.impl.UpdateThread.a(UpdateThread.java:2)
at com.intellij.codeInsight.daemon.impl.UpdateThread.access$100(UpdateThread.java:34)
at com.intellij.codeInsight.daemon.impl.UpdateThread$1.run(UpdateThread.java:3)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcess(ProgressManagerImpl.java:57)
at com.intellij.codeInsight.daemon.impl.UpdateThread.run(UpdateThread.java:13)

2 comments
Comment actions Permalink

Looks like EL Language cannot be injected anywhere. File a bug, you won't get any further help here... :(

Sascha

0
Comment actions Permalink

this is real bad news :( there's lot of usecases for this

anyone from JB?

0

Please sign in to leave a comment.