clutcher / bh

Issue tracker for Better Highlights Intellij IDEA plugin
6 stars 0 forks source link

NoSuchMethodError during inspection #105

Closed mgroth0 closed 3 months ago

mgroth0 commented 3 months ago
java.lang.NoSuchMethodError: 'java.util.Collection com.tang.intellij.lua.stubs.index.LuaShortNameIndex$Companion.find(java.lang.String, com.tang.intellij.lua.search.SearchContext)'
    at com.clutcher.cR.a(SourceFile:2021)
    at com.clutcher.cZ.a(SourceFile:26)
    at com.clutcher.ce.a(SourceFile:77)
    at com.clutcher.ce$1.visitComment(SourceFile:59)
    at com.intellij.psi.impl.source.tree.PsiCommentImpl.accept(PsiCommentImpl.java:23)
    at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:88)
    at com.intellij.codeInspection.InspectionEngine.createVisitorAndAcceptElements(InspectionEngine.java:58)
    at com.intellij.codeInspection.InspectionEngine.lambda$inspectElements$8(InspectionEngine.java:319)
    at com.intellij.concurrency.JobLauncherImpl.lambda$processImmediatelyIfTooFew$2(JobLauncherImpl.java:147)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
    at com.intellij.concurrency.JobLauncherImpl.lambda$processImmediatelyIfTooFew$3(JobLauncherImpl.java:143)
    at com.intellij.openapi.application.impl.RwLockHolder.runReadAction(RwLockHolder.kt:254)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:840)
    at com.intellij.concurrency.JobLauncherImpl.processImmediatelyIfTooFew(JobLauncherImpl.java:154)
    at com.intellij.concurrency.JobLauncherImpl.invokeConcurrentlyUnderProgress(JobLauncherImpl.java:50)
    at com.intellij.concurrency.JobLauncher.invokeConcurrentlyUnderProgress(JobLauncher.java:52)
    at com.intellij.codeInspection.InspectionEngine.lambda$inspectElements$9(InspectionEngine.java:356)
    at com.intellij.codeInspection.InspectionEngine.withSession(InspectionEngine.java:248)
    at com.intellij.codeInspection.InspectionEngine.inspectElements(InspectionEngine.java:288)
    at com.intellij.codeInspection.InspectionEngine.inspectElements(InspectionEngine.java:236)
    at com.intellij.codeInspection.InspectionEngine.inspectEx(InspectionEngine.java:142)
    at com.intellij.codeInspection.InspectionEngine.lambda$runInspectionOnFile$10(InspectionEngine.java:373)
    at com.intellij.codeInspection.reference.RefManagerImpl.runInsideInspectionReadAction(RefManagerImpl.java:507)
    at com.intellij.codeInspection.InspectionEngine.runInspectionOnFile(InspectionEngine.java:369)
clutcher commented 3 months ago

@mgroth0 How did you get that error? What version of IDE do you have? Do you have any Lua plugins installed, liike EmmyLua?

mgroth0 commented 3 months ago

I started getting this after some recent update in IntelliJ. And I have Luanalysis

IntelliJ IDEA 2024.1 (Ultimate Edition)
Build #IU-241.14494.240, built on March 28, 2024
Runtime version: 17.0.10+8-b1207.12 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 14.4.1
Kotlin analyzer version: 2.0.0-ij241-276
Registry:
  ide.balloon.shadow.size=0
  editor.paint.empty.text=false
  debugger.new.tool.window.layout=true
  search.everywhere.settings=true
  ide.new.editor.tabs.vertical.borders=true
  ide.plugins.snapshot.on.unload.fail=true
  ide.animate.toolwindows=true
  ide.experimental.ui=true
  ide.slow.operations.assertion=false
  ide.editor.tab.selection.animation=true
Non-Bundled Plugins:
  krasa.CpuUsageIndicator (1.18.0-IJ2023)
  com.pinkfloyded.idea-file-path-autocomplete.idea-file-path-autocomplete (0.4.1)
  Shifter (1.9.6)
  com.intellij.nativeDebug (241.14494.234)
  com.mnw.tabmover (1.5.2)
  org.jetbrains.jumpToLine (0.1.15)
  de.kontext_e.idea.plugins.autofill (1.2)
  au.com.glassechidna.luanalysis (1.4.0)
  org.jetbrains.plugins.hocon (2024.1.0)
  DevKit (241.14494.247)
  com.github.camork.fileExpander (2.4)
  com.mallowigi (95.0.0)
  Pythonid (241.14494.240)
  org.exbin.deltahex.intellij (0.2.10)
  matt.idea.ide-open-1 (1.0.172)
  com.faendir.intellij.gradle-version-catalogs-plugin (1.4.0)
  org.jetbrains.android (241.14494.240)
  androidx.compose.plugins.idea (241.14494.158)
  com.chrisrm.idea.MaterialThemeUI (9.2.0)
  org.mallowigi.idea.MaterialThemeUI.ProjectFrame (2024.1.1)
  org.mallowigi.idea.MaterialThemeUI.CustomTheme (2024.1.1)
  org.mallowigi.idea.MaterialThemeUI.LangAdditions (2024.1.1)
  org.mallowigi.idea.MaterialThemeUI.HighContrast (2024.1.1)
  org.mallowigi.idea.MaterialThemeUI.Extras (2024.1.1)
  org.jetbrains.compose.desktop.ide (1.6.1)
  com.suusan2go.kotlin-fill-class (1.0.23)
  com.clutcher.comments_highlighter (2024.1.14)
Kotlin: 241.14494.240-IJ
clutcher commented 3 months ago

@mgroth0 Most probably due to implementation of LuaShortNameIndex in Luanalysis, which is far away from what is in EmmyLua right now. Is it happening on any lua file open in editor?

P.S. Strange that I can't reproduce it. Maybe because I'm checking with both plugins installed and only enabling/disabling one of them

clutcher commented 3 months ago

@mgroth0 Can you install EmmyLua plugin and disable it to check if you still would have that exception?

P.S. Looks like for Lunalysis I would need to write a totally separate implementation. I would check more deeply in next few days, but there is a big chance that I would disable wikilinks and cognitive complexity for Lunalysis untill they would upgrade to more recent version of EmmyLua.

mgroth0 commented 3 months ago

I do not think I have any Lua files at all. I use lua snippets in my kotlin files with the @Language("Lua") annotation which highlights LUA code right inside of your kotlin files.

mgroth0 commented 3 months ago

I rarely ever use Lua so I can disable it temporarily and you can take your time to sort this out or wait for the LUA plugins to update. Thanks for the advice.

clutcher commented 3 months ago

@mgroth0 Fixed in latest release. I basically disabled a lot of functionality for Lunalysis plugin, untill they would sync with latest EmmyLua plugin version. Meantime you can use EmmyLua for full functionality of BH, or use Lunalysis if it is enought to only highlight keywords/comments/regexp.