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

Class cast exception when using language injections #24

Open
Flynamic opened this issue Mar 27, 2022 · 1 comment
Open

Class cast exception when using language injections #24

Flynamic opened this issue Mar 27, 2022 · 1 comment
Labels

Comments

@Flynamic
Copy link

Flynamic commented Mar 27, 2022

When injecting my language into other file types such as XML or JSON, the IDE throws an error everytime I type:

class com.intellij.psi.impl.source.xml.XmlTextImpl cannot be cast to class org.antlr.intellij.adaptor.psi.ScopeNode
java.lang.ClassCastException: class com.intellij.psi.impl.source.xml.XmlTextImpl cannot be cast to class org.antlr.intellij.adaptor.psi.ScopeNode (com.intellij.psi.impl.source.xml.XmlTextImpl is in unnamed module of loader com.intellij.util.lang.PathClassLoader @67b64c45; org.antlr.intellij.adaptor.psi.ScopeNode is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @5466ba6)
	at org.antlr.intellij.adaptor.SymtabUtils.getContextFor(SymtabUtils.java:51)
	at org.antlr.intellij.adaptor.psi.ANTLRPsiNode.getContext(ANTLRPsiNode.java:53)
	at org.antlr.intellij.adaptor.psi.ANTLRPsiNode.getContext(ANTLRPsiNode.java:31)
	at org.antlr.intellij.adaptor.SymtabUtils.getContextFor(SymtabUtils.java:51)
	at org.antlr.intellij.adaptor.psi.ANTLRPsiNode.getContext(ANTLRPsiNode.java:53)
	at org.antlr.intellij.adaptor.psi.ANTLRPsiNode.getContext(ANTLRPsiNode.java:31)
	at org.antlr.intellij.adaptor.SymtabUtils.getContextFor(SymtabUtils.java:51)
	at org.antlr.intellij.adaptor.psi.ANTLRPsiNode.getContext(ANTLRPsiNode.java:53)
	at org.antlr.intellij.adaptor.psi.ANTLRPsiNode.getContext(ANTLRPsiNode.java:31)
	at com.intellij.psi.util.PsiTreeUtil.getContextOfType(PsiTreeUtil.java:570)
	at com.intellij.lang.javascript.intentions.JSIntroduceVariableIntention.findExpression(JSIntroduceVariableIntention.java:149)
	at com.intellij.lang.javascript.intentions.JSIntroduceVariableIntention.isAvailable(JSIntroduceVariableIntention.java:180)
	...

This seems to get triggered by JavaScript code insights.

@parrt parrt added the bug label Mar 27, 2022
@parrt
Copy link
Member

parrt commented Mar 27, 2022

Hi. Thanks for reporting. I'm just now starting to get back into the plug in stuff after many years so might take me a while to get to this.

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

No branches or pull requests

2 participants