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

com.intellij.diagnostic.PluginException: Element: class glslplugin.lang.parser.GLSLFile #GLSL because: different providers #179

Open
hamoid opened this issue Apr 25, 2023 · 1 comment
Labels

Comments

@hamoid
Copy link

hamoid commented Apr 25, 2023

Describe the bug
The IDE is complaining about exceptions with the GLSL plugin.

com.intellij.diagnostic.PluginException: Element: class glslplugin.lang.parser.GLSLFile #GLSL  because: different providers: com.intellij.psi.SingleRootFileViewProvider{vFile=jar:///home/funpro/.local/share/JetBrains/IdeaIC2023.1/GLSL4Idea/lib/GLSL4Idea-1.24.jar!/glsl/builtin.glsl, vFileId=1267040, content=VirtualFileContent{size=97756}, eventSystemEnabled=true}(5ee6b4b3); com.intellij.psi.SingleRootFileViewProvider{vFile=jar:///home/funpro/.local/share/JetBrains/IdeaIC2023.1/GLSL4Idea/lib/GLSL4Idea-1.24.jar!/glsl/builtin.glsl, vFileId=1267040, content=VirtualFileContent{size=97756}, eventSystemEnabled=true}(765a03b5)
invalidated at: see attachment [Plugin: GLSL]
	at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
	at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:99)
	at com.intellij.psi.util.PsiUtilCore.ensureValid(PsiUtilCore.java:482)
	at com.intellij.psi.impl.source.PsiFileImpl.loadTreeElement(PsiFileImpl.java:192)
	at com.intellij.psi.impl.source.PsiFileImpl.calcTreeElement(PsiFileImpl.java:734)
	at com.intellij.psi.impl.source.PsiFileImpl.getNode(PsiFileImpl.java:937)
	at com.intellij.psi.impl.source.PsiFileImpl.getFirstChild(PsiFileImpl.java:744)
	at glslplugin.lang.parser.GLSLFile.processDeclarations(GLSLFile.java:69)
	at glslplugin.lang.parser.GLSLFile.processDeclarations(GLSLFile.java:85)
	at com.intellij.psi.util.PsiTreeUtil.treeWalkUp(PsiTreeUtil.java:1257)
	at glslplugin.lang.elements.expressions.GLSLVariableExpression$VariableWalkResult.walkPossibleReferences(GLSLVariableExpression.java:117)
	at glslplugin.lang.elements.expressions.GLSLVariableExpression$VariableReference.resolve(GLSLVariableExpression.java:105)
	at glslplugin.annotation.impl.VariableTypeHighlightAnnotation.annotate(VariableTypeHighlightAnnotation.java:21)
	at glslplugin.annotation.impl.VariableTypeHighlightAnnotation.annotate(VariableTypeHighlightAnnotation.java:17)
	at glslplugin.annotation.Annotator.annotateGeneric(Annotator.java:46)
	at glslplugin.annotation.GLSLAnnotator.annotate(GLSLAnnotator.java:81)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:130)
	at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:107)
        ...

To Reproduce

            @Language("GLSL")
            val glsl = """
                #version 450
                layout(local_size_x=1) in;
                layout(rgba32f) uniform writeonly image2DArray writeTex;
                uniform int numLayers;
                void main() {
                    vec4 pink = vec4(1.0, 0.753, 0.796, 1.0);
                    for (int layer=0; layer<numLayers; layer++) {
                        ivec3 coords = ivec3(gl_GlobalInvocationID.x, 
                                             gl_GlobalInvocationID.y, 
                                             layer);
                        float alpha = sin(coords.x * 0.1 + layer) * 0.5 + 0.5;
                        imageStore(writeTex, coords, pink * alpha);
                    }
                }
                """.trimIndent()

I don't know if it's the cause, but the first line with layout is highlighted as an error, with the tooltip Unable to parse external declaration.

Expected behavior
No errors

Screenshots
image

Versions

  • IDE: IntelliJ IDEA 2023.1 (Community Edition), Build #IC-231.8109.175, built on March 29, 2023, Runtime version: 17.0.7+7 amd64
  • Plugin: 1.24

Additional context
GLSL code is a compute shader.

@hamoid hamoid added the bug label Apr 25, 2023
@hamoid
Copy link
Author

hamoid commented Apr 26, 2023

Trying the code above today in a different file I do not get the error. I will investigate what is the actual trigger.

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

1 participant