KronicDeth / intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Other
1.84k stars 154 forks source link

Stub index points to a file (file = file:///usr/local/Cellar/erlang/24.2/lib/erlang/lib/wx-2.1.1/doc/chunks/wxXmlResource.chunk, file type = com.intellij.openapi.fileTypes.UnknownFileType@4a46143f, indexed file type = com.intellij.openapi.fileTypes.UnknownFileType@4a46143f) without indexed stub tree; indexing stamp = null, can have stubs = false, actual stub count = 0 at com.intellij.psi.stubs.StubProcessingHelper.retrieveStubIdList(StubProcessingHelper.java:41) #2420

Open marcellanz opened 2 years ago

marcellanz commented 2 years ago

System

Plugin Version: 12.0.1 Application: IntelliJ IDEA Ultimate Edition (2021.3) Operating System: Mac OS X (12.1)

Event

Exception

Stacktrace

java.lang.Throwable: Stub index points to a file (file = file:///usr/local/Cellar/erlang/24.2/lib/erlang/lib/wx-2.1.1/doc/chunks/wxXmlResource.chunk, file type = com.intellij.openapi.fileTypes.UnknownFileType@4a46143f, indexed file type = com.intellij.openapi.fileTypes.UnknownFileType@4a46143f) without indexed stub tree; indexing stamp = null, can have stubs = false, actual stub count = 0
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
    at com.intellij.psi.stubs.StubProcessingHelper.retrieveStubIdList(StubProcessingHelper.java:41)
    at com.intellij.psi.stubs.StubIndexImpl.lambda$processElements$4(StubIndexImpl.java:339)
    at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
    at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:338)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:100)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:88)
    at org.elixir_lang.Reference.namedElementCollection(Reference.java:81)
    at org.elixir_lang.Reference.namedElementCollection(Reference.java:70)
    at org.elixir_lang.Reference.forEachNavigationElement(Reference.java:39)
    at org.elixir_lang.psi.scope.CallDefinitionClause.implicitImports(CallDefinitionClause.kt:280)
    at org.elixir_lang.psi.scope.CallDefinitionClause.execute(CallDefinitionClause.kt:166)
    at org.elixir_lang.psi.scope.CallDefinitionClause.execute(CallDefinitionClause.kt:38)
    at org.elixir_lang.psi.impl.ProcessDeclarationsImpl.processDeclarations(ProcessDeclarationsImpl.kt:147)
    at org.elixir_lang.psi.impl.ElixirPsiImplUtil.processDeclarations(ElixirPsiImplUtil.java:581)
    at org.elixir_lang.psi.impl.ElixirUnmatchedUnqualifiedNoParenthesesCallImpl.processDeclarations(ElixirUnmatchedUnqualifiedNoParenthesesCallImpl.java:156)
    at com.intellij.psi.util.PsiTreeUtil.treeWalkUp(PsiTreeUtil.java:1203)
    at org.elixir_lang.psi.scope.call_definition_clause.MultiResolve$Companion.resolveResults(MultiResolve.kt:203)
    at org.elixir_lang.psi.scope.call_definition_clause.MultiResolve$Companion.resolveResults$default(MultiResolve.kt:190)
    at org.elixir_lang.reference.resolver.Callable.resolveUnqualified(Callable.kt:126)
    at org.elixir_lang.reference.resolver.Callable.resolveInScope(Callable.kt:100)
    at org.elixir_lang.reference.resolver.Callable.resolve(Callable.kt:88)
    at org.elixir_lang.reference.resolver.Callable.resolveAll(Callable.kt:84)
    at org.elixir_lang.reference.resolver.Callable.resolvePreferred(Callable.kt:74)
    at org.elixir_lang.reference.resolver.Callable.resolve(Callable.kt:39)
    at org.elixir_lang.reference.resolver.Callable.resolve(Callable.kt:35)
    at org.elixir_lang.reference.resolver.Callable.resolve(Callable.kt:30)
    at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$resolve$1(ResolveCache.java:154)
    at com.intellij.openapi.util.Computable.get(Computable.java:18)
    at com.intellij.psi.impl.source.resolve.ResolveCache.lambda$loggingResolver$4(ResolveCache.java:260)
    at com.intellij.openapi.util.Computable.get(Computable.java:18)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:238)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolve(ResolveCache.java:154)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:169)
    at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:162)
    at org.elixir_lang.reference.ResolveWithCachingComputable.compute(Callable.kt:593)
    at org.elixir_lang.reference.ResolveWithCachingComputable.compute(Callable.kt:585)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:852)
    at org.elixir_lang.reference.CallableKt.resolveWithCaching(Callable.kt:583)
    at org.elixir_lang.reference.CallableKt.access$resolveWithCaching(Callable.kt:1)
    at org.elixir_lang.reference.Callable.multiResolve(Callable.kt:105)
    at org.elixir_lang.ReferenceKt.safeMultiResolve(reference.kt:16)
    at org.elixir_lang.annotator.Callable$annotate$1.visitPlainCall(Callable.kt:97)
    at org.elixir_lang.annotator.Callable$annotate$1.visitNonModuleAttributeCall(Callable.kt:87)
    at org.elixir_lang.annotator.Callable$annotate$1.visitCall(Callable.kt:47)
    at org.elixir_lang.annotator.Callable$annotate$1.visitElement(Callable.kt:78)
    at com.intellij.psi.impl.PsiElementBase.accept(PsiElementBase.java:273)
    at org.elixir_lang.psi.impl.ElixirUnmatchedUnqualifiedNoArgumentsCallImpl.accept(ElixirUnmatchedUnqualifiedNoArgumentsCallImpl.java:39)
    at org.elixir_lang.annotator.Callable.annotate(Callable.kt:39)
KronicDeth commented 2 years ago

🤔 I never added explicit support to the plugin for .chunk files AND it is saying it is an unknown file type. I wonder why it is trying to index the file then?

Please also report to JetBrains directly. Maybe they’ll point out some reason why an unknown file type is being indexed instead of just the file types I registered.

Finally, how did you install Erlang? I don’t have chunk files in my SDK as far as I can tell with asdf, but maybe 24.2 added them?

marcellanz commented 2 years ago

I don’t have chunk files in my SDK as far as I can tell with asdf, but maybe 24.2 added them?

I really don't know, there seem to be quite a few under /usr/local/Cellar/erlang/24.2:

image

which is the installation of Erlang I get with it installed with brew on macOS.

I wonder why it is trying to index the file then?

Good question, I don't know :) I might have added wrong directories to lib/src/doc in Modules configuration?

KronicDeth commented 2 years ago

If the docs are in the chunks we want them to be able to get the docs. Perhaps the doc code looks for chunks? It was a community contribution.

Either way I’m still surprised that the Stub I Dec API doesn’t ignore unknown file types.

If this is a homebrew install I can install it locally easily enough to try to reproduce it.

marcellanz commented 2 years ago

If this is a homebrew install I can install it locally easily enough to try to reproduce it.

Cool, let me know if I should share further configuration from my side.