redhat-developer / lsp4ij

LSP Client for IntelliJ
Eclipse Public License 2.0
48 stars 9 forks source link

"Find Usages" produces a lot of SEVERE issues in logs in development mode #389

Closed KUGDev closed 5 days ago

KUGDev commented 6 days ago

The plugin to test the behaviour: https://github.com/zowe/zowe-cobol-language-support-intellij There is demo.cbl file to test the issue when the plugin is installed. Tested with LSP4IJ 0.0.2

The issue appears during the plug-in run in development mode

2024-06-26 16:29:38,449 [  14114] SEVERE - #c.i.u.SlowOperations - Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
java.lang.Throwable: Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
    at com.intellij.util.SlowOperations.assertSlowOperationsAreAllowed(SlowOperations.java:106)
    at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.ensureIsUpToDate(WorkspaceFileIndexDataImpl.kt:142)
    at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.getFileInfo(WorkspaceFileIndexDataImpl.kt:87)
    at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.getFileInfo(WorkspaceFileIndexImpl.kt:245)
    at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.findFileSetWithCustomData(WorkspaceFileIndexImpl.kt:228)
    at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getModuleForFile(ProjectFileIndexImpl.java:100)
    at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getModuleForFile(ProjectFileIndexImpl.java:93)
    at com.intellij.openapi.roots.impl.ProjectFileIndexFacade.getModuleForFile(ProjectFileIndexFacade.java:77)
    at com.intellij.psi.search.GlobalSearchScope$FileScope.<init>(GlobalSearchScope.java:750)
    at com.intellij.psi.search.GlobalSearchScope$FileScope.<init>(GlobalSearchScope.java:740)
    at com.intellij.psi.search.GlobalSearchScope.fileScope(GlobalSearchScope.java:314)
    at com.intellij.psi.search.GlobalSearchScope.filesScope(GlobalSearchScope.java:358)
    at com.intellij.psi.search.GlobalSearchScopes.openFilesScope(GlobalSearchScopes.java:30)
    at com.intellij.psi.search.PredefinedSearchScopeProviderImpl$ScopeCollectionContext$Companion.addOpenFilesScope(PredefinedSearchScopeProviderImpl.kt:282)
    at com.intellij.psi.search.PredefinedSearchScopeProviderImpl$ScopeCollectionContext$Companion.addCommonScopes(PredefinedSearchScopeProviderImpl.kt:221)
    at com.intellij.psi.search.PredefinedSearchScopeProviderImpl$ScopeCollectionContext$Companion.collectContext(PredefinedSearchScopeProviderImpl.kt:192)
    at com.intellij.psi.search.PredefinedSearchScopeProviderImpl.getPredefinedScopes(PredefinedSearchScopeProviderImpl.kt:59)
    at com.intellij.ide.util.scopeChooser.ScopeChooserCombo.initialize(ScopeChooserCombo.java:117)
    at com.intellij.ide.util.scopeChooser.ScopeChooserCombo.init(ScopeChooserCombo.java:74)
    at com.intellij.ide.util.scopeChooser.ScopeChooserCombo.<init>(ScopeChooserCombo.java:62)
    at com.intellij.find.findUsages.AbstractFindUsagesDialog.createSearchScopePanel(AbstractFindUsagesDialog.java:271)
    at com.intellij.find.findUsages.AbstractFindUsagesDialog.createAllOptionsPanel(AbstractFindUsagesDialog.java:227)
    at com.intellij.find.findUsages.AbstractFindUsagesDialog.createCenterPanel(AbstractFindUsagesDialog.java:106)
    at com.intellij.openapi.ui.DialogWrapper.init(DialogWrapper.java:1328)
    at com.intellij.find.findUsages.AbstractFindUsagesDialog.init(AbstractFindUsagesDialog.java:136)
    at com.intellij.find.findUsages.CommonFindUsagesDialog.<init>(CommonFindUsagesDialog.java:44)
    at com.intellij.find.findUsages.FindUsagesHandler.createDefaultFindUsagesDialog(FindUsagesHandler.java:47)
    at com.intellij.find.findUsages.FindUsagesHandler.getFindUsagesDialog(FindUsagesHandler.java:38)
    at com.intellij.find.findUsages.FindUsagesManager.findUsages(FindUsagesManager.java:199)
    at com.intellij.find.impl.FindManagerImpl.findUsages(FindManagerImpl.java:833)
    at com.intellij.find.impl.FindManagerImpl.findUsages(FindManagerImpl.java:823)
    at com.intellij.find.actions.FindUsagesAction.startFindUsages(FindUsagesAction.java:88)
    at com.intellij.find.actions.FindUsagesAction$1.handlePsi(FindUsagesAction.java:80)
    at com.intellij.find.actions.PsiTargetVariant.handle(resolver.kt:74)
    at com.intellij.find.actions.ResolverKt.findShowUsages(resolver.kt:52)
    at com.intellij.find.actions.FindUsagesAction.lambda$actionPerformed$1(FindUsagesAction.java:70)
    at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$safeTransferToEdt$7(NonBlockingReadActionImpl.java:728)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
    at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
    at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:204)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:419)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:138)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:129)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1152)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:81)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:123)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
    at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:698)
    at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:593)
    at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:105)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:593)
    at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:77)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:362)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:361)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:361)
    at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:356)
    at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1021)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
    at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1021)
    at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:356)
    at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:209)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:398)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
2024-06-26 16:29:38,451 [  14116] SEVERE - #c.i.u.SlowOperations - IntelliJ IDEA 2024.1  Build #IC-241.14494.240
2024-06-26 16:29:38,451 [  14116] SEVERE - #c.i.u.SlowOperations - JDK: 17.0.10; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2024-06-26 16:29:38,452 [  14117] SEVERE - #c.i.u.SlowOperations - OS: Windows 11
2024-06-26 16:29:38,452 [  14117] SEVERE - #c.i.u.SlowOperations - Last Action: FindUsages
angelozerr commented 6 days ago

I don't see any com.redhat.*stacktrace, have you the same problem with another language (like Java) which is not associated to a language server?

I noticed this problem when we use file index to retrieve a file from String uri that I have fixed since last version of IJ (2024.2 I think)

I wonder if it is a bug from IJ?

KUGDev commented 6 days ago

I don't see any com.redhat.*stacktrace, have you the same problem with another language (like Java) which is not associated to a language server?

I noticed this problem when we use file index to retrieve a file from String uri that I have fixed since last version of IJ (2024.2 I think)

I wonder if it is a bug from IJ?

Current stable is 2024.1 The same issue is reproducible for other LSP servers as well Not sure if it is the plug-in's problem, but I saw some usages of this feature inside of the LSP4IJ's code, so created the issue in here as the most specific place to make a heads-up or get some clarification

angelozerr commented 6 days ago

If you do Find Usages for Java code for instance, do you see this issue?

KUGDev commented 6 days ago

It looks like the other code causes the same issue, so most probably this is the IntelliJ's problem

angelozerr commented 5 days ago

Thanks for your feedback, I think we can close this issue since it is a JetBrains issue, right?

KUGDev commented 5 days ago

Ok @angelozerr, if you think so, we can close the issue But the thing is that this issues is not reproducible with other plugins It does not bother me until I call the Find Usages feature, so I will be avoiding it then Thank you

angelozerr commented 4 days ago

My main problem with your issue is that I dont see any stack trace from LSP4IJ so it will hard to fix something from LSP4IJ

KUGDev commented 4 days ago

My main problem with your issue is that I dont see any stack trace from LSP4IJ so it will hard to fix something from LSP4IJ

Welcome to the IntelliJ platfrom:)