manateelazycat / lsp-bridge

A blazingly fast LSP client for Emacs
GNU General Public License v3.0
1.41k stars 202 forks source link

使用elixir_ls时错误信息Project directory does not exist #1038

Open Akesaka-Hitsuki opened 1 day ago

Akesaka-Hitsuki commented 1 day ago

打开apple.ex文件后直接exited with code 1 创建项目后再用emacs打开的文件,按道理说不存在not exist的问题 换helix使用elixir_ls,能正常运行

emacs version: 29.4

mini config:

(add-to-list 'load-path "~/.emacs.d/site-lisp/lsp-bridge")
(add-to-list 'load-path "~/.emacs.d/elpa/yasnippet-20240115.553")
(add-to-list 'load-path "~/.emacs.d/elpa/markdown-mode-20240107.831")
(add-to-list 'load-path "~/.emacs.d/elpa/elixir-mode-20230626.1738")
(require 'elixir-mode)

(require 'yasnippet)
(yas-global-mode 1)

(require 'lsp-bridge)
(setq lsp-bridge-enable-log t)
(setq lsp-bridge-elixir-lsp-server "elixirLS")
(global-lsp-bridge-mode)
log message ``` Eval in Emacs: (lsp-bridge--first-start '37189) Eval in Emacs: (message '"[LSP-Bridge] found language server: /home/akesaka/tools/elixir_ls/language_server.sh") Start lsp server (elixirLS) for /home/akesaka/code/elixir/apple/lib/apple.ex Eval in Emacs: (message '"[LSP-Bridge] Active file 'apple.ex', enjoy hacking!") Handlers: [, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ] Running /home/akesaka/tools/elixir_ls/launch.sh Preferred shell is zsh, relaunching Looking for ASDF install ASDF install found in /opt/asdf-vm/asdf.sh, sourcing --- [22:42:35.606339] Send initialize request (24830) to 'elixirLS' for project apple.ex { "id": 24830, "method": "initialize", "params": { "processId": 34393, "rootPath": "/home/akesaka/code/elixir/apple/lib/apple.ex", "clientInfo": { "name": "emacs", "version": "lsp-bridge" }, "rootUri": "file:///home/akesaka/code/elixir/apple/lib/apple.ex", "capabilities": { "workspace": { "configuration": true, "symbol": { "resolveSupport": { "properties": [] } } }, "textDocument": { "completion": { "completionItem": { "snippetSupport": true, "deprecatedSupport": true, "tagSupport": { "valueSet": [ 1 ] }, "resolveSupport": { "properties": [ "documentation", "detail", "additionalTextEdits" ] } } }, "codeAction": { "dynamicRegistration": false, "codeActionLiteralSupport": { "codeActionKind": { "valueSet": [ "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" ] } }, "isPreferredSupport": true }, "inlayHint": { "dynamicRegistration": false }, "diagnostic": { "dynamicRegistration": true, "relatedDocumentSupport": true }, "publishDiagnostics": { "relatedInformation": true, "tagSupport": { "valueSet": [ 1, 2 ] }, "versionSupport": true, "codeDescriptionSupport": true, "dataSupport": true } }, "window": { "workDoneProgress": true } }, "initializationOptions": {} }, "message_type": "request", "jsonrpc": "2.0" } Eval in Emacs: (lsp-bridge-set-prefix-style '"ascii") Eval in Emacs: (lsp-bridge-set-server-names '"/home/akesaka/code/elixir/apple/lib/apple.ex" '"" '("elixirLS")) Installing ElixirLS release v0.23.0 Running in /home/akesaka/code/elixir/apple/lib Install complete --- [22:42:37.365011] Recv window/logMessage notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "window/logMessage", "params": { "message": "Started ElixirLS v0.23.0", "type": 3 } } --- [22:42:37.365187] Recv window/logMessage notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "window/logMessage", "params": { "message": "Running in /home/akesaka/code/elixir/apple/lib", "type": 3 } } --- [22:42:37.368499] Recv window/logMessage notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "window/logMessage", "params": { "message": "ElixirLS built with elixir \"1.17.2\" on OTP \"27\"", "type": 3 } } --- [22:42:37.368789] Recv window/logMessage notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "window/logMessage", "params": { "message": "Running on elixir \"1.17.2 (compiled with Erlang/OTP 27)\" on OTP \"27\"", "type": 3 } } --- [22:42:37.371153] Recv window/logMessage notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "window/logMessage", "params": { "message": "Protocols are not consolidated", "type": 3 } } --- [22:42:37.371872] Recv telemetry/event notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "telemetry/event", "params": { "name": "eep48", "measurements": {}, "properties": { "elixir_ls.eep48": "true", "elixir_ls.elixir_release": "1.17", "elixir_ls.elixir_version": "1.17.2", "elixir_ls.erts_version": "15.0", "elixir_ls.mix_env": "dev", "elixir_ls.mix_target": "host", "elixir_ls.otp_release": "27" } } } --- [22:42:37.372046] Recv window/logMessage notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "window/logMessage", "params": { "message": "Elixir sources not found (checking in /home/runner/work/elixir/elixir). Code navigation to Elixir modules disabled.", "type": 3 } } --- [22:42:37.372210] Recv telemetry/event notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "telemetry/event", "params": { "name": "elixir_sources", "measurements": {}, "properties": { "elixir_ls.elixir_release": "1.17", "elixir_ls.elixir_sources": "false", "elixir_ls.elixir_version": "1.17.2", "elixir_ls.erts_version": "15.0", "elixir_ls.mix_env": "dev", "elixir_ls.mix_target": "host", "elixir_ls.otp_release": "27" } } } --- [22:42:37.372558] Recv telemetry/event notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "telemetry/event", "params": { "name": "otp_sources", "measurements": {}, "properties": { "elixir_ls.elixir_release": "1.17", "elixir_ls.elixir_version": "1.17.2", "elixir_ls.erts_version": "15.0", "elixir_ls.mix_env": "dev", "elixir_ls.mix_target": "host", "elixir_ls.otp_release": "27", "elixir_ls.otp_sources": "true" } } } --- [22:42:37.402474] Recv telemetry/event notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "telemetry/event", "params": { "name": "dialyzer_support", "measurements": {}, "properties": { "elixir_ls.dialyzer_support": "true", "elixir_ls.dialyzer_support_reason": "", "elixir_ls.elixir_release": "1.17", "elixir_ls.elixir_version": "1.17.2", "elixir_ls.erts_version": "15.0", "elixir_ls.mix_env": "dev", "elixir_ls.mix_target": "host", "elixir_ls.otp_release": "27" } } } --- [22:42:37.407564] Recv response (24830) from 'elixirLS' for project apple.ex { "id": 24830, "jsonrpc": "2.0", "result": { "capabilities": { "codeActionProvider": true, "codeLensProvider": { "resolveProvider": false }, "completionProvider": { "triggerCharacters": [ ".", "@", "&", "%", "^", ":", "!", "-", "~" ] }, "definitionProvider": true, "documentFormattingProvider": true, "documentOnTypeFormattingProvider": { "firstTriggerCharacter": "\n" }, "documentSymbolProvider": { "label": "Elixir outline" }, "executeCommandProvider": { "commands": [ "expandMacro:mQDvlrRWUbPgSuYnmp8yAinHisZz5bJp", "getExUnitTestsInFile:mQDvlrRWUbPgSuYnmp8yAinHisZz5bJp", "manipulatePipes:mQDvlrRWUbPgSuYnmp8yAinHisZz5bJp", "mixClean:mQDvlrRWUbPgSuYnmp8yAinHisZz5bJp", "restart:mQDvlrRWUbPgSuYnmp8yAinHisZz5bJp", "spec:mQDvlrRWUbPgSuYnmp8yAinHisZz5bJp" ] }, "foldingRangeProvider": true, "hoverProvider": true, "implementationProvider": true, "macroExpansion": true, "referencesProvider": true, "selectionRangeProvider": true, "signatureHelpProvider": { "triggerCharacters": [ "(", "," ] }, "textDocumentSync": { "change": 2, "openClose": true, "save": { "includeText": true } }, "workspace": { "workspaceFolders": { "changeNotifications": false, "supported": false } }, "workspaceSymbolProvider": true }, "serverInfo": { "name": "ElixirLS", "version": "0.23.0" } } } --- [22:42:37.408019] Send initialized notification to 'elixirLS' for project apple.ex --- [22:42:37.408096] Recv telemetry/event notification from 'elixirLS' for project apple.ex { "method": "initialized", "params": {}, "message_type": "notification", "jsonrpc": "2.0" } { "jsonrpc": "2.0", "method": "telemetry/event", "params": { "name": "lsp_request", "measurements": { "elixir_ls.lsp_request_time": 23 }, "properties": { "elixir_ls.elixir_release": "1.17", "elixir_ls.elixir_version": "1.17.2", "elixir_ls.erts_version": "15.0", "elixir_ls.lsp_command": "initialize", "elixir_ls.mix_env": "dev", "elixir_ls.mix_target": "host", "elixir_ls.otp_release": "27" } } } --- [22:42:37.408454] Send workspace/didChangeConfiguration notification to 'elixirLS' for project apple.ex --- [22:42:37.408592] Recv workspace/configuration request (1) from 'elixirLS' for project apple.ex { "method": "workspace/didChangeConfiguration", "params": { "settings": { "elixirLS": { "dialyzerEnabled": true, "dialyzerWarnOpts": [], "dialyzerFormat": "dialyxir_short", "fetchDeps": true, "suggestSpecs": true, "signatureAfterComplete": true, "enableTestLenses": false } } }, "message_type": "notification", "jsonrpc": "2.0" } { "id": 1, "jsonrpc": "2.0", "method": "workspace/configuration", "params": { "items": [ { "scopeUri": "file:///home/akesaka/code/elixir/apple/lib/apple.ex", "section": "elixirLS" } ] } } --- [22:42:37.408922] Send textDocument/didOpen notification to 'elixirLS' for project apple.ex { "method": "textDocument/didOpen", "params": { "textDocument": { "uri": "file:///home/akesaka/code/elixir/apple/lib/apple.ex", "languageId": "elixir", "version": 0, "text": "defmodule Apple do\n @moduledoc \"\"\"\n Documentation for `Apple`.\n \"\"\"\n\n @doc \"\"\"\n Hello world.\n\n ## Examples\n\n iex> Apple.hello()\n :world\n\n \"\"\"\n def hello do\n :world\n end\nend\n" } }, "message_type": "notification", "jsonrpc": "2.0" } --- [22:42:37.409147] Send response to server request 1 to 'elixirLS' for project apple.ex { "id": 1, "result": [ { "dialyzerEnabled": true, "dialyzerWarnOpts": [], "dialyzerFormat": "dialyxir_short", "fetchDeps": true, "suggestSpecs": true, "signatureAfterComplete": true, "enableTestLenses": false } ], "message_type": "response", "jsonrpc": "2.0" } --- [22:42:37.412592] Recv window/logMessage notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "window/logMessage", "params": { "message": "Received client configuration via workspace/configuration\n%{\"dialyzerEnabled\" => true, \"dialyzerFormat\" => \"dialyxir_short\", \"dialyzerWarnOpts\" => [], \"enableTestLenses\" => false, \"fetchDeps\" => true, \"signatureAfterComplete\" => true, \"suggestSpecs\" => true}", "type": 3 } } --- [22:42:37.427944] Recv window/logMessage notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "window/logMessage", "params": { "message": "Project directory /home/akesaka/code/elixir/apple/lib/apple.ex does not exist", "type": 1 } } --- [22:42:37.428139] Recv window/showMessage notification from 'elixirLS' for project apple.ex { "jsonrpc": "2.0", "method": "window/showMessage", "params": { "message": "Project directory /home/akesaka/code/elixir/apple/lib/apple.ex does not exist", "type": 1 } } --- [22:42:39.435801] LSP server 'elixirLS' exited with code 1 b'' Traceback (most recent call last): File "/home/akesaka/.emacs.d/site-lisp/lsp-bridge/core/lspserver.py", line 137, in run self.send_message(message) File "/home/akesaka/.emacs.d/site-lisp/lsp-bridge/core/lspserver.py", line 90, in send_message self.process.stdin.flush() # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^ BrokenPipeError: [Errno 32] Broken pipe ```
manateelazycat commented 1 day ago

感觉像是对 workspace/configuration 消息的回应不对导致的, 只能周末有时间看一下了。