sublimelsp / LSP-elixir

Elixir support for Sublime LSP plugin

Home Page:https://lsp.sublimetext.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash immediately since last update

optikfluffel opened this issue · comments

commented

Since the update yesterday I immediately get a crash when opening any Elixir project using Sublime Text 3.2.2 on macOS 10.15.7.

Screenshot 2021-02-02 at 11 09 45

With "log_debug": true and "log_payloads": true set I get this:

:: --> lsp-elixir initialize(1): {'rootPath': '/Users/me/Desktop/example_project', 'workspaceFolders': [{'uri': 'file:///Users/me/Desktop/example_project', 'name': 'example_project'}], 'processId': 3286, 'clientInfo': {'name': 'Sublime Text LSP', 'version': '0.14.3'}, 'capabilities': {'experimental': {}, 'workspace': {'symbol': {'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'dynamicRegistration': True}, 'didChangeConfiguration': {'dynamicRegistration': True}, 'workspaceFolders': True, 'applyEdit': True, 'workspaceEdit': {'documentChanges': True, 'failureHandling': 'abort'}, 'executeCommand': {}, 'configuration': True}, 'window': {'showMessage': {'messageActionItem': {'additionalPropertiesSupport': True}}, 'workDoneProgress': True}, 'textDocument': {'completion': {'completionItem': {'snippetSupport': True}, 'completionItemKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}, 'dynamicRegistration': True}, 'publishDiagnostics': {'relatedInformation': True}, 'signatureHelp': {'signatureInformation': {'parameterInformation': {'labelOffsetSupport': True}, 'documentationFormat': ['markdown', 'plaintext']}, 'dynamicRegistration': True}, 'hover': {'contentFormat': ['markdown', 'plaintext'], 'dynamicRegistration': True}, 'references': {'dynamicRegistration': True}, 'synchronization': {'willSaveWaitUntil': True, 'didSave': True, 'willSave': True, 'dynamicRegistration': True}, 'documentSymbol': {'hierarchicalDocumentSymbolSupport': True, 'symbolKind': {'valueSet': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26]}, 'dynamicRegistration': True}, 'rename': {'dynamicRegistration': True}, 'formatting': {'dynamicRegistration': True}, 'rangeFormatting': {'dynamicRegistration': True}, 'declaration': {'linkSupport': True, 'dynamicRegistration': True}, 'definition': {'linkSupport': True, 'dynamicRegistration': True}, 'codeAction': {'codeActionLiteralSupport': {'codeActionKind': {'valueSet': []}}, 'dynamicRegistration': True}, 'colorProvider': {'dynamicRegistration': True}, 'typeDefinition': {'linkSupport': True, 'dynamicRegistration': True}, 'documentHighlight': {'dynamicRegistration': True}, 'implementation': {'linkSupport': True, 'dynamicRegistration': True}}}, 'rootUri': 'file:///Users/me/Desktop/example_project', 'initializationOptions': {}}

I cannot reproduce this issue on Linux and I don't own a mac.

The last release only bumped the version of the elixir language server to 0.6.3.

Check if you can start the language server from the terminal. It's located at ~.config/sublime-text/Cache/LSP-elixir/server/0.6.3/language_server.sh. May be slightly different on mac. You should get output similar to:

Content-Length: 102

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Started ElixirLS v0.6.3","type":4}}Content-Length: 135

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Elixir version: \"1.11.0 (compiled with Erlang/OTP 23)\"","type":4}}Content-Length: 101

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Erlang version: \"23\"","type":4}}Content-Length: 128

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"ElixirLS compiled with Elixir 1.8.2 and erlang 21","type":4}}

Also, check if there are any issues reported on elixir-lsp.

Have you tried restarting ST once after you saw that error? I can see how this could happen on update since the server is installed asynchronously so it might not yet be installed when LSP tries to start it.

(That is also something that would be solved by using lsp_utils).

@rchl I'd like to embrace lsp_utils when I have some time and energy, just can't promise a timeline ATM.

commented

This looks like it's not using a relative path for launch.sh. 🤔

$ ./Library/Application\ Support/Sublime\ Text\ 3/Cache/LSP-elixir/server/0.6.3/language_server.sh 
usage: dirname path
./Library/Application Support/Sublime Text 3/Cache/LSP-elixir/server/0.6.3/language_server.sh: line 19: /launch.sh: No such file or directory
./Library/Application Support/Sublime Text 3/Cache/LSP-elixir/server/0.6.3/language_server.sh: line 19: exec: /launch.sh: cannot execute: No such file or directory

I also already tried rebooting my Mac, de- and reinstalling the LSP and LSP-elixir plugins.

@optikfluffel They did change the script recently: elixir-lsp/elixir-ls@843e1a6

Could you try undoing that change and see if that fixed your problem?

commented

@ihabunek Yes, this seems to do the trick.

Content-Length: 102

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Started ElixirLS v0.6.3","type":4}}Content-Length: 135

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Elixir version: \"1.11.3 (compiled with Erlang/OTP 23)\"","type":4}}Content-Length: 101

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"Erlang version: \"23\"","type":4}}Content-Length: 128

{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"ElixirLS compiled with Elixir 1.8.2 and erlang 21","type":4}}

It's also working in Sublime again.

@optikfluffel Nice. I find it amusing that a comment titled "Make wrapper script more robust" breaks it in some cases. :)

Could you please report the issue to them?

commented

Will do, thanks for helping me dig down to this.

@optikfluffel @ihabunek okay, I've released ElixirLS 0.6.4 that reverts elixir-lsp/elixir-ls#445 Can you please give it a try? You'll have to make a matching update to LSP-elixir.

FYI, here's a new attempt for the convenience shell script: elixir-lsp/elixir-ls#473