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
202 stars 91 forks source link

Pycharm IDE Fatal Error - Exception in plugin Robot Framework Language Server - LanguageServerUnavailableException #421

Closed sreejithrangarajan closed 3 years ago

sreejithrangarajan commented 3 years ago

Hi,

I'm getting an exception when starting Pycharm with Robot Framework Language Server. I have enabled the log collection mentioned in https://github.com/robocorp/robotframework-lsp/blob/master/robotframework-ls/docs/reporting_issues.md but it is not generating any log writings. Please see the exception details and versions below. Kindly let me know if anymore info is needed.

Pycharm Version:

image

Language Server Version:

image

Exception details:

`robocorp.lsp.intellij.LanguageServerUnavailableException: Unable to get language server communication for: D:/Mavenir/5G Automation/5g-systest
    at robocorp.lsp.intellij.EditorLanguageServerConnection.<init>(EditorLanguageServerConnection.java:45)
    at robocorp.lsp.intellij.EditorLanguageServerConnection.editorCreated(EditorLanguageServerConnection.java:152)
    at robocorp.lsp.intellij.LanguageServerEditorListener.editorCreated(LanguageServerEditorListener.java:56)
    at robocorp.lsp.intellij.LanguageServerEditorListener.editorCreated(LanguageServerEditorListener.java:21)
    at com.intellij.openapi.editor.impl.EditorFactoryImpl.lambda$createEditor$2(EditorFactoryImpl.java:211)
    at com.intellij.openapi.extensions.impl.ExtensionProcessingHelper.forEachExtensionSafe(ExtensionProcessingHelper.java:34)
    at com.intellij.openapi.extensions.ExtensionPointName.forEachExtensionSafe(ExtensionPointName.java:46)
    at com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(EditorFactoryImpl.java:211)
    at com.intellij.openapi.editor.impl.EditorFactoryImpl.createEditor(EditorFactoryImpl.java:164)
    at com.intellij.openapi.fileEditor.impl.text.TextEditorComponent.createEditor(TextEditorComponent.java:133)
    at com.intellij.openapi.fileEditor.impl.text.TextEditorComponent.<init>(TextEditorComponent.java:79)
    at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl$PsiAwareTextEditorComponent.<init>(PsiAwareTextEditorImpl.java:107)
    at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl.createEditorComponent(PsiAwareTextEditorImpl.java:85)
    at com.intellij.openapi.fileEditor.impl.text.TextEditorImpl.<init>(TextEditorImpl.java:52)
    at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorImpl.<init>(PsiAwareTextEditorImpl.java:36)
    at com.intellij.openapi.fileEditor.impl.text.PsiAwareTextEditorProvider.createEditor(PsiAwareTextEditorProvider.java:31)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl4Edt(FileEditorManagerImpl.java:997)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl4$17(FileEditorManagerImpl.java:969)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.runBulkTabChange(FileEditorManagerImpl.java:1786)
    at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.lambda$openFileImpl4$18(FileEditorManagerImpl.java:968)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
    at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeAndWait$7(ApplicationImpl.java:451)
    at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:134)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:133)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:46)
    at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:189)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
    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.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:886)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:755)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:442)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:825)
    at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:441)
    at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:794)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:487)
    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)`

Log Collection Settings

image

fabioz commented 3 years ago

Thank you for the report... it probably is not being able to start up the language server (which is also probably the reason it's not working in the first place).

Do you have any non-empty .log files in: C:\Users\<username>\.robotframework-ls?

If you do, can you attach them?

sreejithrangarajan commented 3 years ago

@fabioz : I checked the mentioned location but could only see empty .log files. If the language server is not started up will I still get syntax highlighting and other features? Because I'm able to see those for my robot files.

image

fabioz commented 3 years ago

You wouldn't be able to do that... what's the extension for the file you're having an issue with? (isn't it a .robot file?)

sreejithrangarajan commented 3 years ago

Yes its a .robot file. But the issue is not just specific to a file. When ever I startup the PyCharm IDE this exception pops up like this:

image

sreejithrangarajan commented 3 years ago

@fabioz Thanks a lot for the fix. Took the build with this fix from here and installed it using the steps mentioned in FAQ and now the issue is resolved. The IDE error is no longer occurring. Appreciating your fast response!

fabioz commented 3 years ago

Great, I was about to ask you to install that to check if it did indeed fix your case ;)

I'm going to publish an official release with this fix shortly now that you confirmed it worked.

jessicaqgomez commented 2 years ago

i have the same problem with this plugin, can you help me to solve it?

fabioz commented 2 years ago

@jessicaqgomez please create a new issue (as this one is fixed for quite a while, so, it must be a different thing).

Please provide the logs following the steps from: https://github.com/robocorp/robotframework-lsp/blob/master/robotframework-ls/docs/reporting_issues.md#intellij-logs