Closed John-Goff closed 11 months ago
Can you attach initalize
request sent by your client? I'm interested in rootUri
property.
Please describe your project structure. Where is your mix.exs
located? Is it in server/mix.exs
?
I suspect race conditions issue when ElixirLS tries to clean and rebuild the project. I noticed similar behaviour in tests on elixir <= 1.14. It may be already fixed on the master branch.
Yes, it's a monorepo structure with the elixir code living in server
. There is no mix.exs
in the root directory, only in server
.
Here's the initialize request:
[Trace - 01:46:51 pm] Sending request 'initialize - (2918)'.
Params: {
"processId": 12850,
"rootPath": "/Users/johngoff/Repos/HiredHippo",
"clientInfo": {
"name": "emacs",
"version": "GNU Emacs 29.1 (build 2, aarch64-apple-darwin22.6.0, NS appkit-2299.70 Version 13.5.2 (Build 22G91))\n of 2023-11-19"
},
"rootUri": "file:///Users/johngoff/Repos/HiredHippo",
"capabilities": {
"general": {
"positionEncodings": ["utf-32", "utf-16"]
},
"workspace": {
"workspaceEdit": {
"documentChanges": true,
"resourceOperations": ["create", "rename", "delete"]
},
"applyEdit": true,
"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]
}
},
"executeCommand": {
"dynamicRegistration": false
},
"didChangeWatchedFiles": {
"dynamicRegistration": true
},
"workspaceFolders": true,
"configuration": true,
"codeLens": {
"refreshSupport": true
},
"fileOperations": {
"didCreate": false,
"willCreate": false,
"didRename": true,
"willRename": true,
"didDelete": false,
"willDelete": false
}
},
"textDocument": {
"declaration": {
"dynamicRegistration": true,
"linkSupport": true
},
"definition": {
"dynamicRegistration": true,
"linkSupport": true
},
"references": {
"dynamicRegistration": true
},
"implementation": {
"dynamicRegistration": true,
"linkSupport": true
},
"typeDefinition": {
"dynamicRegistration": true,
"linkSupport": true
},
"synchronization": {
"willSave": true,
"didSave": true,
"willSaveWaitUntil": true
},
"documentSymbol": {
"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]
},
"hierarchicalDocumentSymbolSupport": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true
},
"onTypeFormatting": {
"dynamicRegistration": true
},
"rename": {
"dynamicRegistration": true,
"prepareSupport": true
},
"codeAction": {
"dynamicRegistration": true,
"isPreferredSupport": true,
"codeActionLiteralSupport": {
"codeActionKind": {
"valueSet": [
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
}
},
"resolveSupport": {
"properties": ["edit", "command"]
},
"dataSupport": true
},
"completion": {
"completionItem": {
"snippetSupport": true,
"documentationFormat": ["markdown", "plaintext"],
"resolveAdditionalTextEditsSupport": true,
"insertReplaceSupport": true,
"deprecatedSupport": true,
"resolveSupport": {
"properties": ["documentation", "detail", "additionalTextEdits", "command"]
},
"insertTextModeSupport": {
"valueSet": [1, 2]
}
},
"contextSupport": true,
"dynamicRegistration": true
},
"signatureHelp": {
"signatureInformation": {
"parameterInformation": {
"labelOffsetSupport": true
}
},
"dynamicRegistration": true
},
"documentLink": {
"dynamicRegistration": true,
"tooltipSupport": true
},
"hover": {
"contentFormat": ["markdown", "plaintext"],
"dynamicRegistration": true
},
"selectionRange": {
"dynamicRegistration": true
},
"callHierarchy": {
"dynamicRegistration": false
},
"typeHierarchy": {
"dynamicRegistration": true
},
"publishDiagnostics": {
"relatedInformation": true,
"tagSupport": {
"valueSet": [1, 2]
},
"versionSupport": true
},
"linkedEditingRange": {
"dynamicRegistration": true
}
},
"window": {
"workDoneProgress": true,
"showDocument": {
"support": true
}
}
},
"initializationOptions": null,
"workDoneToken": "1"
}
Happening recently on one of my project as well, using elixir-ls
through https://github.com/sublimelsp/LSP-elixir and there was release bumping the version to support latest elixir-ls v0.17.10
lsp-elixir: Received workspace/didChangeConfiguration
lsp-elixir: Received client configuration via workspace/didChangeConfiguration
%{"dialyzerEnabled" => true, "dialyzerFormat" => "dialyxir_long", "dialyzerWarnOpts" => [], "fetchDeps" => true, "mixEnv" => "test", "mixTarget" => nil, "projectDir" => nil}
:: [13:07:25.498] <- lsp-elixir window/logMessage: {'message': 'client/registerCapability succeeded', 'type': 3}
:: [13:07:25.498] <- lsp-elixir window/logMessage: {'message': 'Client does not support workspace/didChangeWatchedFiles dynamic registration', 'type': 3}
:: [13:07:25.498] <- lsp-elixir window/logMessage: {'message': 'Received workspace/didChangeConfiguration', 'type': 3}
:: [13:07:25.498] <- lsp-elixir window/logMessage: {'message': 'Received client configuration via workspace/didChangeConfiguration\n%{"dialyzerEnabled" => true, "dialyzerFormat" => "dialyxir_long", "dialyzerWarnOpts" => [], "fetchDeps" => true, "mixEnv" => "test", "mixTarget" => nil, "projectDir" => nil}', 'type': 3}
lsp-elixir: Starting build with MIX_ENV: test MIX_TARGET: host
:: [13:07:25.501] <- lsp-elixir window/logMessage: {'message': 'Starting build with MIX_ENV: test MIX_TARGET: host', 'type': 3}
lsp-elixir: DETS databases will be rebuilt
lsp-elixir: Unable to reload project: cwd "/Users/sreenadh/Projects/app-core/deps/cachex" is not project dir /Users/sreenadh/Projects/app-core
:: [13:07:25.509] <- lsp-elixir window/logMessage: {'message': 'DETS databases will be rebuilt', 'type': 3}
:: [13:07:25.509] <- lsp-elixir window/showMessage: {'message': 'Unable to reload project: cwd "/Users/sreenadh/Projects/app-core/deps/cachex" is not project dir /Users/sreenadh/Projects/app-core', 'type': 1}
:: [13:07:25.509] <- lsp-elixir window/logMessage: {'message': 'Unable to reload project: cwd "/Users/sreenadh/Projects/app-core/deps/cachex" is not project dir /Users/sreenadh/Projects/app-core', 'type': 1}
lsp-elixir: Loaded DETS databases in 26ms
:: [13:07:25.529] <- lsp-elixir window/logMessage: {'message': 'Loaded DETS databases in 26ms', 'type': 3}
Uninstalled sublime plugin, Removed .elixir_ls/
, _build/
and deps/
completely, and installed plugin back again. Everything works as expected
Closing this as v0.18 should not have this issue
Precheck
Environment
erlang 25.2.1
&elixir 1.14.3-otp-25
v0.17.10
Current behavior
When opening ElixirLS, it repeatedly crashes when trying to install dependencies. If I restart it continually, it eventually works, but requires over a dozen restarts to work properly.
*lsp-log*
buffer contents:The line
Unable to reload project: cwd "/Users/johngoff/Repos/HiredHippo/server/deps/yaml_elixir" is not project dir /Users/johngoff/Repos/HiredHippo/server
will change the dependency listed every time that I restart elixir LS.*elixir-ls::stderr*
buffer contents:It seems as though ASDF is not detected? It did prompt me once to install Hex, though it should have been already installed in the asdf location listed.
Relevant contents of the
*Messages*
buffer:I do not have a reproduction (yet), but some more details that may be relevant:
elixirLS.projectDir
, set toserver
in the above example.v0.17.9
, wanted to upgrade before reportingExpected behavior
Dependencies should install without crashing the server.