jnhyperion / HyperRobotFrameworkPlugin

Robot Framework plugin for PyCharm.
30 stars 4 forks source link

[PyCharm] Plugin is not loading properly: RobotKeywordNotFound #48

Closed luki922 closed 1 year ago

luki922 commented 1 year ago

I ran PyCharm today and got this error, everything was working yesterday. PyCharm version: PyCharm 2022.3.2 (Professional Edition) Build #PY-223.8617.48, built on January 24, 2023

com.intellij.diagnostic.PluginException: Inspection #RobotKeywordNotFound has no description [Plugin: com.github.jnhyperion.hyperrobotframeworkplugin]
    at com.intellij.codeInspection.ui.InspectionNodeInfo.<init>(InspectionNodeInfo.java:71)
    at com.intellij.codeInspection.ui.InspectionResultsView.createBaseRightComponentFor(InspectionResultsView.java:487)
    at com.intellij.codeInspection.ui.InspectionResultsView.showInRightPanel(InspectionResultsView.java:410)
    at com.intellij.codeInspection.ui.InspectionResultsView.syncRightPanel(InspectionResultsView.java:324)
    at com.intellij.codeInspection.ui.InspectionTree$2.lambda$process$0(InspectionTree.java:125)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
    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:749)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:909)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:756)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$5(IdeEventQueue.java:437)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:787)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:436)
    at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
    at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:615)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:434)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:838)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:480)
    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)
jnhyperion commented 1 year ago

Did you install other robot related plugins? otherwise you can re-install Hyper RobotFramework Support and try again.

luki922 commented 1 year ago

I have only Hyper RobotFramework Support installed. I removed plugin several times, restarted IDE and nothing helped. I deleted the .idea folder from project and nothing helped either. I also removed env from project and reinstalled everything again. I checked on an older version of pycharm and it doesn't work either :/

I installed clean linux on virtual machine, clean repo and installed plugin and it doesn't work

Ah3n0 commented 1 year ago

I've been experiencing this problem for a few days after a PyCharm update. Same PyCharm Version as above (and all editions). But I still can use it with some trouble: e.g can't move or rename any file anymore while this plugin is active.

luki922 commented 1 year ago

Only "Should Be Equal" and "Run Keyword" from robot/libraries/Builtin.py work for me. Nothing that is loaded from robotframework-browser (playwright) doesn't work

jnhyperion commented 1 year ago

@luki922 can you provide some screenshots? I am not able to reproduce your issue.

Browser library can be loaded well on Ubuntu:

image

jnhyperion commented 1 year ago

@Ah3n0 I am not able to reproduce your "move" / "rename" issue either.

Ah3n0 commented 1 year ago

When I enable the plugin I can't select (see) my robot files anymore.

Bildschirm­foto 2023-02-20 um 09 07 09

sametime also:

Bildschirm­foto 2023-02-20 um 09 15 22

After disabling it is possible again.

Bildschirm­foto 2023-02-20 um 09 07 39

When starting PyCharm while the plugin is enabled, I can't see my files. But can't move or rename it without any error msg. It just has no reaction after hitting the 'Refactor' Button after changing the name.

If the plugin is disabled - also a bit strange to me - the icons are available:

Bildschirm­foto 2023-02-20 um 09 17 49

When enabling the plugin I get the following error msg directly:

java.lang.AssertionError: Language Language: Robot doesn't participate in view provider com.intellij.psi.SingleRootFileViewProvider{vFile=file:///Users/ronnyruhe/PycharmProjects/testautomatisierung/robotframework/tests/res/keywords.resource, vFileId=194, content=VirtualFileContent{size=6265}, eventSystemEnabled=true}: [Language: Robot] at com.intellij.extapi.psi.PsiFileBase.findLanguage(PsiFileBase.java:48) at com.intellij.extapi.psi.PsiFileBase.<init>(PsiFileBase.java:23) at com.millennialmedia.intellibot.psi.element.RobotFileImpl.<init>(RobotFileImpl.java:47) at com.millennialmedia.intellibot.psi.RobotParserDefinition.createFile(RobotParserDefinition.java:82) at com.intellij.psi.AbstractFileViewProvider.createFile(AbstractFileViewProvider.java:144) at com.intellij.psi.AbstractFileViewProvider.createFile(AbstractFileViewProvider.java:128) at com.intellij.psi.AbstractFileViewProvider.createFile(AbstractFileViewProvider.java:117) at com.intellij.psi.SingleRootFileViewProvider.createFile(SingleRootFileViewProvider.java:149) at com.intellij.psi.SingleRootFileViewProvider.getPsiInner(SingleRootFileViewProvider.java:105) at com.intellij.psi.AbstractFileViewProvider.getPsi(AbstractFileViewProvider.java:194) at com.intellij.psi.impl.file.impl.FileManagerImpl.findFile(FileManagerImpl.java:363) at com.intellij.psi.impl.PsiManagerImpl.findFile(PsiManagerImpl.java:156) at com.github.jnhyperion.hyperrobotframeworkplugin.ide.VFSEventMgr.c(Unknown Source) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor.callWrapped(NonBlockingReadActionImpl.java:746) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$OTelMonitor$MonitoredComputation.call(NonBlockingReadActionImpl.java:778) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.insideReadAction(NonBlockingReadActionImpl.java:573) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$attemptComputation$3(NonBlockingReadActionImpl.java:537) at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1111) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runInReadActionWithWriteActionPriority$0(ProgressIndicatorUtils.java:71) at com.intellij.openapi.progress.util.ProgressIndicatorUtilService.runActionAndCancelBeforeWrite(ProgressIndicatorUtilService.java:63) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:128) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.lambda$runWithWriteActionPriority$1(ProgressIndicatorUtils.java:109) at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:68) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173) at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:68) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:106) at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:71) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:537) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.executeSynchronously(NonBlockingReadActionImpl.java:464) at com.intellij.openapi.application.impl.NonBlockingReadActionImpl.executeSynchronously(NonBlockingReadActionImpl.java:218) at com.github.jnhyperion.hyperrobotframeworkplugin.ide.VFSEventMgr.b(Unknown Source) at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:246) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:833)

as well as

com.intellij.diagnostic.PluginException: Short name 'RobotKeywordNotFound' is not unique class 'com.millennialmedia.intellibot.ide.inspections.compilation.RobotKeywordNotFound' in PluginDescriptor(name=IntelliBot #patched, id=com.millennialmedia.intellibot@lte2000, descriptorPath=plugin.xml, path=~/Library/Application Support/JetBrains/PyCharm2022.3/plugins/intellibot.jar, version=0.15.191.8026, package=null, isBundled=false) and class 'com.github.jnhyperion.hyperrobotframeworkplugin.ide.inspections.compilation.RobotKeywordNotFound' in PluginDescriptor(name=Hyper RobotFramework Support, id=com.github.jnhyperion.hyperrobotframeworkplugin, descriptorPath=plugin.xml, path=~/Library/Application Support/JetBrains/PyCharm2022.3/plugins/Hyper RobotFramework Support, version=0.1.5, package=null, isBundled=false) conflict at com.intellij.codeInspection.ex.InspectionToolRegistrarKt.checkForDuplicateShortName(InspectionToolRegistrar.kt:178) at com.intellij.codeInspection.ex.InspectionToolRegistrarKt.registerInspection(InspectionToolRegistrar.kt:137) at com.intellij.codeInspection.ex.InspectionToolRegistrarKt.access$registerInspection(InspectionToolRegistrar.kt:1) at com.intellij.codeInspection.ex.InspectionToolRegistrar.registerInspections(InspectionToolRegistrar.kt:69) at com.intellij.codeInspection.ex.InspectionToolRegistrar.<init>(InspectionToolRegistrar.kt:51) at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClass(ComponentManagerImpl.kt:950) at com.intellij.serviceContainer.ComponentManagerImpl.createLightService(ComponentManagerImpl.kt:929) at com.intellij.serviceContainer.ComponentManagerImpl.getOrCreateLightService(ComponentManagerImpl.kt:733) at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:685) at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:629) at com.intellij.codeInspection.ex.InspectionToolRegistrar$Companion.getInstance(InspectionToolRegistrar.kt:209) at com.intellij.codeInspection.ex.ApplicationInspectionProfileManagerBase$schemeManager$1.createScheme(ApplicationInspectionProfileManagerBase.kt:56) at com.intellij.codeInspection.ex.ApplicationInspectionProfileManagerBase$schemeManager$1.createScheme(ApplicationInspectionProfileManagerBase.kt:48) at com.intellij.configurationStore.LazySchemeProcessor.createScheme$default(scheme-impl.kt:61) at com.intellij.configurationStore.schemeManager.SchemeLoader.loadScheme(schemeLoader.kt:177) at com.intellij.configurationStore.schemeManager.SchemeManagerImpl.loadSchemes(SchemeManagerImpl.kt:241) at com.intellij.codeInspection.ex.ApplicationInspectionProfileManagerBase$profilesAreInitialized$2.invoke(ApplicationInspectionProfileManagerBase.kt:81) at com.intellij.codeInspection.ex.ApplicationInspectionProfileManagerBase$profilesAreInitialized$2.invoke(ApplicationInspectionProfileManagerBase.kt:74) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at com.intellij.codeInspection.ex.ApplicationInspectionProfileManagerBase.getProfilesAreInitialized(ApplicationInspectionProfileManagerBase.kt:74) at com.intellij.codeInspection.ex.ApplicationInspectionProfileManagerBase.initProfiles(ApplicationInspectionProfileManagerBase.kt:100) at com.intellij.codeInspection.ex.ApplicationInspectionProfileManagerBase.getCurrentProfile(ApplicationInspectionProfileManagerBase.kt:128) at com.intellij.profile.codeInspection.ProjectInspectionProfileManager.getCurrentProfile(ProjectInspectionProfileManager.kt:229) at com.intellij.configurationScript.inspection.ExternallyConfigurableProjectInspectionProfileManager.getCurrentProfile(ExternallyConfigurableProjectInspectionProfileManager.kt:75) at com.intellij.profile.codeInspection.ProjectInspectionProfileManager.initializeComponent(ProjectInspectionProfileManager.kt:92) at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:131) at com.intellij.configurationStore.ComponentStoreWithExtraComponents.initComponent(ComponentStoreWithExtraComponents.kt:46) at com.intellij.serviceContainer.ComponentManagerImpl.initializeComponent$intellij_platform_serviceContainer(ComponentManagerImpl.kt:581) at com.intellij.serviceContainer.ServiceComponentAdapter.createAndInitialize(ServiceComponentAdapter.kt:47) at com.intellij.serviceContainer.ServiceComponentAdapter.doCreateInstance(ServiceComponentAdapter.kt:39) at com.intellij.serviceContainer.BaseComponentAdapter.doCreateInstance(BaseComponentAdapter.kt:154) at com.intellij.serviceContainer.BaseComponentAdapter.createInstance$lambda$1(BaseComponentAdapter.kt:133) at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:99) at com.intellij.serviceContainer.BaseComponentAdapter.createInstance(BaseComponentAdapter.kt:132) at com.intellij.serviceContainer.BaseComponentAdapter.access$createInstance(BaseComponentAdapter.kt:19) at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invokeSuspend(BaseComponentAdapter.kt:181) at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invoke(BaseComponentAdapter.kt) at com.intellij.serviceContainer.BaseComponentAdapter$getInstanceAsync$2.invoke(BaseComponentAdapter.kt) at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89) at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169) at kotlinx.coroutines.BuildersKt.withContext(Unknown Source) at com.intellij.serviceContainer.BaseComponentAdapter.getInstanceAsync(BaseComponentAdapter.kt:176) at com.intellij.serviceContainer.ComponentManagerImpl.preloadService$suspendImpl(ComponentManagerImpl.kt:1140) at com.intellij.serviceContainer.ComponentManagerImpl.preloadService(ComponentManagerImpl.kt) at com.intellij.serviceContainer.ComponentManagerImpl$preloadServices$1.invokeSuspend(ComponentManagerImpl.kt:1116) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

luki922 commented 1 year ago

@jnhyperion This is quite weird. Few days worked without problem and suddenly stopped working.

image Snapshot_2023-02-20_09-47-08

image

If I run inspections on a file, it shows such a error:

image

It is interesting that I launched Aqua IDE from Intellij. I loaded plugin from zip and everything works as it be in the same project :D

Snapshot_2023-02-20_09-54-40

jnhyperion commented 1 year ago

@Ah3n0

image Hyper RobotFramework Support does not have this kind of file icon, looks like you have installed other robot plugin and cause plugin conflicts, you can find and uninstall them.

jnhyperion commented 1 year ago

@luki922 do you configure the correct python interpreter for your pycharm and install robotframework-browser into that python env?

plugin will try to load this browser.pyi in your python env.

image
Ah3n0 commented 1 year ago

@Ah3n0

image Hyper RobotFramework Support does not have this kind of file icon, looks like you have installed other robot plugin and cause plugin conflicts, you can find and uninstall them.

You are right. I hadn't realized that 'intelliBot' has also something to do with robotframework. After uninstalling this one below your Framework works fine again. Thanks.

Bildschirm­foto 2023-02-21 um 06 26 15
luki922 commented 1 year ago

@jnhyperion Python interpreter i have set well in pycharm same as in Aqua and only in pycharm it doesn't work. As I wrote before, I even deleted env and install everything again and it did nothing :/

Snapshot_2023-02-21_09-07-06

jnhyperion commented 1 year ago

@luki922 I found the root cause:

there're multi Browser python classes found in library robotframework-browser

plugin will randomly choose one, you can click the library name, you will find it will navigate to incorrect playwright_pb2.pyi

for now the workaround for you is:

*** Settings ***
Library    Browser.browser.Browser

this will make sure your library is resolved to correct Browser class.

luki922 commented 1 year ago

Now I see it is exactly as you write, Browser navigate to playwright_pb2.pyi

Browser.browser.Browser works fine and navigate to browser.pyi, thanks :)

jnhyperion commented 1 year ago

resolved in 0.1.6