robocorp / robotframework-lsp

Robocorp extensions for VS Code: Robocorp Code and RFW LSP
https://robocorp.com/docs/developer-tools/visual-studio-code
Apache License 2.0
206 stars 93 forks source link

In IntelliJ one file doesn't recognize content while others do #384

Closed eduardfarkas closed 3 years ago

eduardfarkas commented 3 years ago

Describe the bug I created multiple new empty .robot files then i took content of existing one and copied it into new files. One file does not recognize its content as RF, but if i copy it to another new file, it works correctly No error displayed. (i tried to delete the file and create new with the same name, behavior is still the same)

Additional info: on start up RF displays some IDE error, stacktrace:

Error getting RobotProjectPreferences

com.intellij.serviceContainer.AlreadyDisposedException: Cannot create robocorp.robot.intellij.RobotProjectPreferences because container is already disposed: Project(name=testing-automation-rf, containerState=DISPOSE_COMPLETED, componentStore=C:\Projects\testing-automation-rf) (disposed)
    at com.intellij.serviceContainer.ComponentManagerImpl.throwContainerIsAlreadyDisposed(ComponentManagerImpl.kt:522)
    at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:498)
    at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:471)
    at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:26)
    at robocorp.robot.intellij.RobotProjectPreferences.getInstance(RobotProjectPreferences.java:685)
    at robocorp.robot.intellij.RobotFrameworkLanguage.createProcessBuilderFromPreferences(RobotFrameworkLanguage.java:105)
    at robocorp.robot.intellij.RobotFrameworkLanguage.lambda$createLanguageServerDefinition$3(RobotFrameworkLanguage.java:550)
    at robocorp.robot.intellij.RobotPreferences.setRobotLanguageServerArgs(RobotPreferences.java:268)
    at robocorp.robot.intellij.RobotPreferencesPage.apply(RobotPreferencesPage.java:325)
    at com.intellij.openapi.options.ex.ConfigurableWrapper.apply(ConfigurableWrapper.java:179)
    at com.intellij.openapi.options.newEditor.ConfigurableEditor.apply(ConfigurableEditor.java:315)
    at com.intellij.openapi.options.newEditor.SettingsEditor$5.apply(SettingsEditor.java:181)
    at com.intellij.openapi.options.newEditor.ConfigurableEditor$2.actionPerformed(ConfigurableEditor.java:61)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
    at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2308)
    at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
    at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
    at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:270)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6652)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
    at java.desktop/java.awt.Component.processEvent(Component.java:6417)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2784)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:969)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:906)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:836)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:797)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
    at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
    at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
    at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
    at java.desktop/java.awt.Dialog.show(Dialog.java:1063)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:694)
    at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:436)
    at com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1702)
    at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1661)
    at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:90)
    at com.intellij.ide.actions.ShowSettingsAction.perform(ShowSettingsAction.java:55)
    at com.intellij.ide.actions.ShowSettingsAction.actionPerformed(ShowSettingsAction.java:42)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAware$5(ActionUtil.java:273)
    at com.intellij.util.SlowOperations.lambda$allowSlowOperations$0(SlowOperations.java:77)
    at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:64)
    at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:76)
    at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:273)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:310)
    at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:286)
    at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:77)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:299)
    at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1967)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:110)
    at com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
    at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:110)
    at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:515)
    at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:545)
    at java.desktop/java.awt.Component.processMouseEvent(Component.java:6652)
    at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3345)
    at java.desktop/java.awt.Component.processEvent(Component.java:6417)
    at java.desktop/java.awt.Container.processEvent(Container.java:2263)
    at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5027)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
    at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
    at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
    at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
    at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
    at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2784)
    at java.desktop/java.awt.Component.dispatchEvent(Component.java:4859)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
    at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:969)
    at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:906)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:836)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:449)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:808)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:448)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:781)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:502)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

To Reproduce Steps to reproduce the behavior:

  1. create new empty .robot file
  2. Insert some existing code

Screenshots https://gyazo.com/035e9934fd431ce403e721234aff3b46

Versions:

Logs robotframework_ls.remote_fs_observer.9892.log robotframework_ls.lsp.20616.log

fabioz commented 3 years ago

Can you still reproduce this?

This is rather strange... the stack trace is basically saying that your project (in C:\Projects\testing-automation-rf) is disposed (which prevents the language server from starting properly):

com.intellij.serviceContainer.AlreadyDisposedException:
    Cannot create robocorp.robot.intellij.RobotProjectPreferences because container is already disposed: 
    Project(name=testing-automation-rf, containerState=DISPOSE_COMPLETED, 
    componentStore=C:\Projects\testing-automation-rf) (disposed)

    at com.intellij.serviceContainer.ComponentManagerImpl.throwContainerIsAlreadyDisposed(ComponentManagerImpl.kt:522)
    at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:498)
    at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:471)
    at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:26)
    at robocorp.robot.intellij.RobotProjectPreferences.getInstance(RobotProjectPreferences.java:685)
    at robocorp.robot.intellij.RobotFrameworkLanguage.createProcessBuilderFromPreferences(RobotFrameworkLanguage.java:105)
    at robocorp.robot.intellij.RobotFrameworkLanguage.lambda$createLanguageServerDefinition$3(RobotFrameworkLanguage.java:550)
    at robocorp.robot.intellij.RobotPreferences.setRobotLanguageServerArgs(RobotPreferences.java:268)
eduardfarkas commented 3 years ago

sorry for late reply, i was on vacation. Unfortunately not, this was one time occurence but i thought it was worth mentioning.

fabioz commented 3 years ago

Closing as this wasn't reproducible.