Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with pyright-langserver #5958

Closed
Lunarmagpie opened this issue Feb 12, 2023 · 13 comments · Fixed by #6058
Closed

Issues with pyright-langserver #5958

Lunarmagpie opened this issue Feb 12, 2023 · 13 comments · Fixed by #6058
Labels
A-language-server Area: Language server client C-bug Category: This is a bug

Comments

@Lunarmagpie
Copy link

Lunarmagpie commented Feb 12, 2023

Summary

Using the pyright-langserver for my linter results in async timeout error whenever I do anything.

Reproduction Steps

Install the pyright langsever as described on the wiki page.

This is my global config.

[[language]]
name = "python"
roots = ["pyproject.toml"]
language-server = { command = "/usr/local/bin/pyright-langserver", args = ["--stdio"] }
config = {} # <- this is the important line

formatter = { command = "black", args = ["--quiet", "-"]}
auto-format = true

Helix log

Not sure where the exact error was so I put everything.

~/.cache/helix/helix.log
2023-02-10T20:12:43.970 helix_view::editor [ERROR] editor error: 1 unsaved buffer(s) remaining: ["[scratch]"]
2023-02-10T20:13:24.302 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { cannot find binary path }
2023-02-10T20:13:48.899 helix_view::editor [ERROR] editor error: Could not load theme: No such file or directory (os error 2)
2023-02-10T20:14:48.424 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T20:14:55.819 helix_term::application [WARN] failed to load theme `monokai` - No such file or directory (os error 2)
2023-02-10T20:14:55.820 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T20:15:17.382 helix_term::application [WARN] failed to load theme `monokai` - No such file or directory (os error 2)
2023-02-10T20:15:19.984 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { cannot find binary path }
2023-02-10T20:19:31.972 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { cannot find binary path }
2023-02-10T20:19:48.649 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T20:20:44.265 helix_view::editor [ERROR] editor error: no last accessed buffer
2023-02-10T20:21:43.280 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T20:29:19.745 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { cannot find binary path }
2023-02-10T20:29:25.183 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { cannot find binary path }
2023-02-10T20:33:09.364 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { cannot find binary path }
2023-02-10T20:35:24.915 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T20:39:24.922 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T20:39:41.844 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T20:39:51.057 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T20:40:24.361 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T20:40:54.960 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T20:43:41.260 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { cannot find binary path }
2023-02-10T20:44:24.100 helix_lsp::transport [ERROR] err <- "Ignoring notification for unknown method \"workspace/didChangeConfiguration\"\n"
2023-02-10T20:45:17.068 helix_lsp::client [INFO] Using custom LSP config: {}
2023-02-10T20:45:17.068 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":false},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"publishDiagnostics":{},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":false},"signatureHelp":{"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown"],"parameterInformation":{"labelOffsetSupport":true}}}},"window":{"workDoneProgress":true},"workspace":{"applyEdit":true,"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"executeCommand":{"dynamicRegistration":false},"symbol":{"dynamicRegistration":false},"workspaceFolders":true}},"clientInfo":{"name":"helix","version":"22.12 (6929a12f)"},"initializationOptions":{},"processId":116113,"rootPath":"/home/lunar/Documents/Projects/Python/code-runner","rootUri":"file:///home/lunar/Documents/Projects/Python/code-runner","workspaceFolders":[{"name":"code-runner","uri":"file:///home/lunar/Documents/Projects/Python/code-runner"}]},"id":0}
2023-02-10T20:45:17.419 helix_lsp::transport [INFO] <- {"id": 0, "jsonrpc": "2.0", "result": {"capabilities": {"textDocumentSync": {"openClose": true, "change": 2, "save": true}, "hoverProvider": true, "codeActionProvider": {"codeActionKinds": ["quickfix", "source.fixAll", "source.organizeImports", "CodeActionKind.SourceFixAll.ruff", "CodeActionKind.SourceOrganizeImports.ruff"], "resolveProvider": true}, "executeCommandProvider": {"commands": ["ruff.applyAutofix", "ruff.applyOrganizeImports"]}, "workspace": {"workspaceFolders": {"supported": true, "changeNotifications": true}, "fileOperations": {}}}, "serverInfo": {"name": "Ruff", "version": "0.0.17"}}}
2023-02-10T20:45:17.419 helix_lsp::transport [INFO] <- {"capabilities":{"codeActionProvider":{"codeActionKinds":["quickfix","source.fixAll","source.organizeImports","CodeActionKind.SourceFixAll.ruff","CodeActionKind.SourceOrganizeImports.ruff"],"resolveProvider":true},"executeCommandProvider":{"commands":["ruff.applyAutofix","ruff.applyOrganizeImports"]},"hoverProvider":true,"textDocumentSync":{"change":2,"openClose":true,"save":true},"workspace":{"fileOperations":{},"workspaceFolders":{"changeNotifications":true,"supported":true}}},"serverInfo":{"name":"Ruff","version":"0.0.17"}}
2023-02-10T20:45:17.419 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialized","params":{}}
2023-02-10T20:45:17.419 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{}}}
2023-02-10T20:45:17.419 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"python","text":"TOKEN=\"REDACTED LOL\"\nPISTON=\"https://emkc.org/api/v2/piston/\"\n\n\n\"MTA3Mzc3MTY1ODkwNjcwMTk1NA.GbYAok.6WkybZrDzwgHL1JWLJeR2FMvtrX2gslhNNm5dk\"\n","uri":"file:///home/lunar/Documents/Projects/Python/code-runner/config.py","version":0}}}
2023-02-10T20:45:17.422 helix_lsp::transport [ERROR] err <- "Ignoring notification for unknown method \"workspace/didChangeConfiguration\"\n"
2023-02-10T20:45:17.424 helix_lsp::transport [INFO] <- {"params": {"type": 4, "message": "Using interpreter executable: /home/lunar/.pyenv/versions/3.11.1/bin/ruff"}, "method": "window/logMessage", "jsonrpc": "2.0"}
2023-02-10T20:45:17.424 helix_lsp::transport [INFO] <- {"params": {"type": 4, "message": "Running Ruff with: ['/home/lunar/.pyenv/versions/3.11.1/bin/ruff', '--no-cache', '--no-fix', '--quiet', '--format', 'json', '-', '--stdin-filename', '/home/lunar/Documents/Projects/Python/code-runner/config.py']"}, "method": "window/logMessage", "jsonrpc": "2.0"}
2023-02-10T20:45:17.425 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Log, message: "Using interpreter executable: /home/lunar/.pyenv/versions/3.11.1/bin/ruff" }
2023-02-10T20:45:17.425 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Log, message: "Running Ruff with: ['/home/lunar/.pyenv/versions/3.11.1/bin/ruff', '--no-cache', '--no-fix', '--quiet', '--format', 'json', '-', '--stdin-filename', '/home/lunar/Documents/Projects/Python/code-runner/config.py']" }
2023-02-10T20:45:17.431 helix_lsp::transport [INFO] <- {"params": {"uri": "file:///home/lunar/Documents/Projects/Python/code-runner/config.py", "diagnostics": []}, "method": "textDocument/publishDiagnostics", "jsonrpc": "2.0"}
2023-02-10T20:45:18.644 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"shutdown","id":1}
2023-02-10T20:45:18.647 helix_lsp::transport [INFO] <- {"id": 1, "jsonrpc": "2.0", "result": null}
2023-02-10T20:45:18.648 helix_lsp::transport [INFO] <- null
2023-02-10T20:45:18.648 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"exit"}
2023-02-10T20:46:28.804 helix_lsp::transport [ERROR] err <- "Ignoring notification for unknown method \"workspace/didChangeConfiguration\"\n"
2023-02-10T20:50:18.503 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T20:50:23.068 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T20:52:14.228 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { IO Error: No such file or directory (os error 2) }
2023-02-10T20:53:56.293 helix_view::editor [ERROR] editor error: Could not load theme: No such file or directory (os error 2)
2023-02-10T20:56:58.749 helix_view::document [ERROR] Formatter error: error: cannot format -: Cannot parse: 21:9:         )i

2023-02-10T21:00:49.711 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { IO Error: No such file or directory (os error 2) }
2023-02-10T21:01:12.589 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { IO Error: No such file or directory (os error 2) }
2023-02-10T21:03:40.184 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T21:03:56.407 helix_view::editor [ERROR] editor error: can't save file, parent directory does not exist
2023-02-10T21:03:58.385 helix_view::editor [ERROR] editor error: can't save file, parent directory does not exist
2023-02-10T21:03:58.385 helix_view::editor [ERROR] editor error: can't save file, parent directory does not exist
2023-02-10T21:04:01.347 helix_view::editor [ERROR] editor error: no such command: 'fW'
2023-02-10T21:04:03.076 helix_view::editor [ERROR] editor error: 1 unsaved buffer(s) remaining: [".helix/languages.toml"]
2023-02-10T21:04:05.426 helix_view::editor [ERROR] editor error: can't save file, parent directory does not exist
2023-02-10T21:04:14.931 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T21:04:28.125 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { IO Error: No such file or directory (os error 2) }
2023-02-10T21:05:19.411 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T21:06:09.231 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { IO Error: No such file or directory (os error 2) }
2023-02-10T21:07:09.749 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T21:07:49.129 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { IO Error: No such file or directory (os error 2) }
2023-02-10T21:08:28.809 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T21:08:31.005 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T21:08:35.142 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T21:09:30.506 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-10T21:09:30.508 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:09:51.975 helix_view::editor [ERROR] editor error: 1 unsaved buffer(s) remaining: ["bot/model.py"]
2023-02-10T21:09:53.433 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:09:54.235 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:09:54.587 helix_view::editor [ERROR] editor error: no such command: 'qw!'
2023-02-10T21:09:56.451 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(1)), original request likely timed out
2023-02-10T21:09:56.452 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(2)), original request likely timed out
2023-02-10T21:11:45.704 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-10T21:11:45.706 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:12:11.559 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:12:11.812 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:12:12.721 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:12:20.254 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(1)), original request likely timed out
2023-02-10T21:12:20.255 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(2)), original request likely timed out
2023-02-10T21:12:20.255 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(3)), original request likely timed out
2023-02-10T21:12:24.604 helix_view::editor [ERROR] editor error: Register [@] empty
2023-02-10T21:13:08.939 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-10T21:13:08.940 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:13:11.072 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:13:11.080 helix_lsp::transport [ERROR] err: <- StreamClosed
2023-02-10T21:13:12.351 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-10T21:13:12.352 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:13:16.820 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:13:16.827 helix_lsp::transport [ERROR] err: <- StreamClosed
2023-02-10T21:13:18.105 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-10T21:13:18.107 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:14:18.572 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-10T21:14:56.831 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-10T21:14:56.832 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:15:06.405 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:15:06.416 helix_lsp::transport [ERROR] err: <- StreamClosed
2023-02-10T21:15:07.567 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-10T21:15:07.568 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:16:11.356 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:16:14.026 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:16:46.080 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:16:47.065 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:16:47.693 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:16:48.338 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:16:54.096 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:16:55.360 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:17:05.568 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:17:30.246 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:17:33.462 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:17:34.730 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:17:53.735 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:17:54.983 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:17:56.555 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:17:59.156 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(1)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(2)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(3)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(4)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(5)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(6)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(7)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(8)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(9)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(10)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(11)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(12)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(13)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(14)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(15)), original request likely timed out
2023-02-10T21:18:29.364 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(16)), original request likely timed out
2023-02-10T21:18:32.297 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-10T21:18:32.300 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:19:37.505 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-10T21:19:37.505 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:19:55.264 helix_view::theme [WARN] Theme: malformed hexcode: light-black
2023-02-10T21:19:55.264 helix_view::theme [WARN] Theme: malformed hexcode: light-black
2023-02-10T21:19:55.264 helix_view::theme [WARN] Theme: malformed hexcode: purple
2023-02-10T21:22:11.022 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-10T21:22:11.023 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-10T21:22:32.851 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:22:35.721 helix_view::document [ERROR] Formatter error: error: cannot format -: Cannot parse: 17:4:     return cls(

2023-02-10T21:22:35.778 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:22:37.131 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:22:37.423 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:22:37.547 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:22:37.669 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:22:37.786 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:22:37.935 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:22:38.069 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:22:38.269 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:22:38.278 helix_view::document [ERROR] Formatter error: error: cannot format -: Cannot parse: 17:4:     return cls(

2023-02-10T21:22:40.037 helix_view::document [ERROR] Formatter error: error: cannot format -: Cannot parse: 17:4:     return cls(

2023-02-10T21:22:40.083 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:22:53.948 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:22:54.165 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:23:04.396 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:23:06.271 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:23:06.876 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:23:09.429 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:23:10.573 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:23:12.040 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:23:27.304 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-10T21:26:03.064 helix_view::editor [ERROR] editor error: Register [@] empty
2023-02-10T21:26:05.020 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(1)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(2)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(3)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(4)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(5)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(6)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(7)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(8)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(9)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(10)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(11)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(12)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(13)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(15)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(16)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(17)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(18)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(19)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(14)), original request likely timed out
2023-02-10T21:26:05.021 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(20)), original request likely timed out
2023-02-12T12:36:28.103 helix_view::editor [ERROR] Failed to initialize the LSP for `source.bash` { cannot find binary path }
2023-02-12T16:48:10.044 helix_view::editor [ERROR] Failed to initialize the LSP for `text.html.basic` { cannot find binary path }
2023-02-12T16:48:19.739 helix_view::editor [ERROR] Failed to initialize the LSP for `source.java` { cannot find binary path }
2023-02-12T16:55:29.824 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { IO Error: No such file or directory (os error 2) }
2023-02-12T16:55:35.695 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { IO Error: No such file or directory (os error 2) }
2023-02-12T16:55:48.564 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-12T16:55:55.642 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { IO Error: No such file or directory (os error 2) }
2023-02-12T16:57:27.243 helix_view::editor [ERROR] Failed to initialize the LSP for `source.js` { cannot find binary path }
2023-02-12T16:57:34.371 helix_view::editor [ERROR] Failed to initialize the LSP for `source.python` { IO Error: No such file or directory (os error 2) }
2023-02-12T16:58:14.722 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-12T16:58:14.722 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-12T16:58:42.849 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T16:58:45.643 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T16:58:47.853 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T17:01:12.613 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T17:01:16.183 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T17:01:17.050 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T17:01:17.141 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T17:01:20.146 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T17:03:41.981 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T17:10:19.028 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-12T17:10:56.039 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-12T17:10:56.040 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-12T17:10:58.945 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-12T17:10:58.946 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-12T17:11:20.128 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T17:11:31.704 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }
2023-02-12T17:11:46.167 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T17:12:55.116 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(2)), original request likely timed out
2023-02-12T17:12:55.116 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(1)), original request likely timed out
2023-02-12T17:12:55.913 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-12T17:12:55.914 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-12T17:13:27.746 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T17:13:28.147 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T17:13:29.246 helix_view::editor [ERROR] editor error: Async job failed: request timed out
2023-02-12T17:14:27.081 helix_view::editor [ERROR] Failed to initialize the LSP for `source.toml` { cannot find binary path }

Platform

Linux

Terminal Emulator

Alacritty

Helix Version

helix 22.12 (6929a12)

@Lunarmagpie Lunarmagpie added the C-bug Category: This is a bug label Feb 12, 2023
@archseer
Copy link
Member

received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.

Fixed on latest master, but it should also be fixed by you defining the non-empty config config = {} # <- this is the important line. My assumption is that your config isn't gettign correctly picked up

@Lunarmagpie
Copy link
Author

Lunarmagpie commented Feb 13, 2023

I updated to the latest commit (87518db1) and I still get the same error

@circuitsacul
Copy link

but it should also be fixed by you defining the non-empty config config = {} # <- this is the important line.

can confirm that, as of two days ago, this does not fix the problem. It's not a matter of the config being picked up because it's the same config telling helix to use pyright in the first place.

@zdytch
Copy link

zdytch commented Feb 14, 2023

Same for me.

hx --version

helix 22.12 (96ff64a8)

hx languages.toml

[[language]]
name = "python"
language-server = { command = "pyright-langserver", args = ["--stdio"] }
config = { }

hx --health python

Configured language server: pyright-langserver
Binary for language server: /Users/alexey/.local/share/virtualenvs/app-E6vLaL-k/bin/pyright-langserver
Configured debug adapter: None
Highlight queries: ✓
Textobject queries: ✓
Indent queries: ✓

pyright-langserver --stdio:
Seems to be ok as well?
https://pastebin.com/0jZfP7gX

@the-mikedavis
Copy link
Member

Is there an example project that can be shared for this - maybe some existing open source project? I can't reproduce this behavior with the given configs running from the latest Helix build and pyright-langserver version 1.1.292 on standalone python files or in a project like flask.

If you can reproduce this, can you post the log while running in verbose mode with a fresh log file (hx -v --log ./log.txt)? The verbose part of the attached log in the original post looks ok but the parts with the request timeouts looks like it wasn't run in verbose mode so it's hard to tell what happened around those errors.

@paul-scott
Copy link
Contributor

@the-mikedavis here is a log https://pastebin.com/mXutGx7P

New build from master: helix 22.12 (715c4b2)
pyright 1.1.294
Python 3.10.9

New directory, new file where I type in the following:

import json

def func(a):
    print(a)⏎

My config:

[[language]]
name = "python"
roots = ["pyproject.toml", "setup.py", "Poetry.lock", "."]
language-server = { command = "pyright-langserver", args = ["--stdio"] }
auto-format = false
config = {}

Let me know if you need anything else.

@the-mikedavis
Copy link
Member

That's perfect, thanks!

I looked into this a little and I can reproduce the async timeouts. It looks like every request does not get a response from pyright at all. I've checked textDocument/completion, textDocument/signatureHelp, textDocument/codeAction, textDocument/documentSymbol, workspace/symbol, and shutdown.

#5748 fixes this. It looks like we send / as the rootPath (file:/// as the rootUri) on master but the proper paths with #5748. I guess that pyright must be trying to crawl the whole file system and that is making it lock up.

@the-mikedavis the-mikedavis linked a pull request Feb 16, 2023 that will close this issue
@the-mikedavis the-mikedavis added the A-language-server Area: Language server client label Feb 16, 2023
@pascalkuthe
Copy link
Member

That's perfect, thanks!

I looked into this a little and I can reproduce the async timeouts. It looks like every request does not get a response from pyright at all. I've checked textDocument/completion, textDocument/signatureHelp, textDocument/codeAction, textDocument/documentSymbol, workspace/symbol, and shutdown.

#5748 fixes this. It looks like we send / as the rootPath (file:/// as the rootUri) on master but the proper paths with #5748. I guess that pyright must be trying to crawl the whole file system and that is making it lock up.

I am glad #5748 fixes this, I am just not 100% sure right now why so I wanted to ask for some more details. Just to make sure we don't miss a second bug by accident.

I don't understand why we are we ever sending / to begin with?
It sounds a bit like #4436 but that would mean that helix was started with / as the CWD. However from the description above it sounds like that is not the case here:

New directory, new file

To me this would mean that helix should sent the CWD on master, because it can't find a root dir (which would be the new directory mentioned above and not /).

Is there something else going on @the-mikedavis or is my understanding right that file:/// was sent because @paul-scott started helix from /. Similar timeouts could also appear when starting from HOME or other large directories outside of a repo, all of these cases are fixed by #5748. It just seems really odd to start helix from / so I wanted to make sure that's what really causing it.

@paul-scott
Copy link
Contributor

paul-scott commented Feb 16, 2023

I tried out #5748 but it doesn't seem to resolve the issue for me... The log with that PR (note the reported hx version is the same in both, but this is misleading, this one is with that PR merged) is:

https://pastebin.com/UFUiEjSU

Looks like for sure there some differences in the sent workspace folder etc. But still async job failed problems.

Perhaps Mike was getting a different type of timeout? Note that my "roots" config has a "." entry in it I put in ages ago in an attempt to fall back on using current directory (e.g., writing a one off script not part of a package). I tried with and without the roots config commented out and no difference there either.

@pascalkuthe
Copy link
Member

Note that my "roots" config has a "." entry in it I put in ages ago in an attempt to fall back on using current directory (e.g., writing a one off script not part of a package). I tried with and without the roots config commented out and no difference there either.

This is probably not the cause of this bug but please don't do that :D It doesn't actually do what you want (the roots setting is used to look for directories that contain a FILE out of the list like peoject.toml) and will therefore do nothing at best and cause helix to use a random directory in the file hirachy that contains a file named . as the lsp workspace at worst. Helix already sends CWD (or the repo root) to the LS in case no root is found (and #5748 further refines that).
Looking at the log 2 things caught my attention:

 ERROR] Language Server: Method not found client/registerCapability

ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.

I suspect that the LS is not quite LSP conformant so something goes wrong during communication which eventually leads to the server locking up. I would need to debug this further tough and this might be false hints.

@paul-scott
Copy link
Contributor

but please don't do that :D

I was always a bit suspect about it. At the time it made things work probably for the wrong reasons.

However, I can confirm that this isn't the source of the problem outlined in this issue.

@the-mikedavis
Copy link
Member

Ah ok yeah that was unrelated: #5748 only fixes this for me when editing standalone files outside of a git directory when "." is in the list of root markers. In that case it looks like every directory has a root and we use the top-most which is / when there isn't a git repository.

@the-mikedavis the-mikedavis removed a link to a pull request Feb 19, 2023
@the-mikedavis
Copy link
Member

I see this behavior on pyright 1.1.293 and 1.1.294 (latest) but not 1.1.292.

1.1.292 works well... (log)
2023-02-19T14:23:20.982 helix_lsp::client [INFO] Using custom LSP config: {}
2023-02-19T14:23:20.983 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"positionEncodings":["utf-32","utf-8","utf-16"]},"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"deprecatedSupport":true,"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":false,"tagSupport":{"valueSet":[1]}},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"publishDiagnostics":{},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":false},"signatureHelp":{"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown"],"parameterInformation":{"labelOffsetSupport":true}}}},"window":{"workDoneProgress":true},"workspace":{"applyEdit":true,"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"executeCommand":{"dynamicRegistration":false},"symbol":{"dynamicRegistration":false},"workspaceFolders":true}},"clientInfo":{"name":"helix","version":"22.12 (31b0c758)"},"initializationOptions":{},"processId":85583,"rootPath":"/home/michael/tmp","rootUri":"file:///home/michael/tmp","workspaceFolders":[{"name":"tmp","uri":"file:///home/michael/tmp"}]},"id":0}
2023-02-19T14:23:21.100 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Pyright language server 1.1.292 starting"}}
2023-02-19T14:23:21.101 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Server root directory: /home/michael/tmp/node_modules/pyright/dist/"}}
2023-02-19T14:23:21.101 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Pyright language server 1.1.292 starting" }
2023-02-19T14:23:21.104 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Starting service instance \"tmp\""}}
2023-02-19T14:23:21.104 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":2,"definitionProvider":{"workDoneProgress":true},"declarationProvider":{"workDoneProgress":true},"typeDefinitionProvider":{"workDoneProgress":true},"referencesProvider":{"workDoneProgress":true},"documentSymbolProvider":{"workDoneProgress":true},"workspaceSymbolProvider":{"workDoneProgress":true},"hoverProvider":{"workDoneProgress":true},"documentHighlightProvider":{"workDoneProgress":true},"renameProvider":{"prepareProvider":true,"workDoneProgress":true},"completionProvider":{"triggerCharacters":[".","["],"resolveProvider":true,"workDoneProgress":true,"completionItem":{"labelDetailsSupport":true}},"signatureHelpProvider":{"triggerCharacters":["(",",",")"],"workDoneProgress":true},"codeActionProvider":{"codeActionKinds":["quickfix","source.organizeImports"],"workDoneProgress":true},"executeCommandProvider":{"commands":[],"workDoneProgress":true},"callHierarchyProvider":true}}}
2023-02-19T14:23:21.104 helix_lsp::transport [INFO] <- {"capabilities":{"callHierarchyProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","source.organizeImports"],"workDoneProgress":true},"completionProvider":{"completionItem":{"labelDetailsSupport":true},"resolveProvider":true,"triggerCharacters":[".","["],"workDoneProgress":true},"declarationProvider":{"workDoneProgress":true},"definitionProvider":{"workDoneProgress":true},"documentHighlightProvider":{"workDoneProgress":true},"documentSymbolProvider":{"workDoneProgress":true},"executeCommandProvider":{"commands":[],"workDoneProgress":true},"hoverProvider":{"workDoneProgress":true},"referencesProvider":{"workDoneProgress":true},"renameProvider":{"prepareProvider":true,"workDoneProgress":true},"signatureHelpProvider":{"triggerCharacters":["(",",",")"],"workDoneProgress":true},"textDocumentSync":2,"typeDefinitionProvider":{"workDoneProgress":true},"workspaceSymbolProvider":{"workDoneProgress":true}}}
2023-02-19T14:23:21.105 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialized","params":{}}
2023-02-19T14:23:21.106 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"method":"client/registerCapability","params":{"registrations":[{"id":"c5af1f33-bd3e-448a-b32c-b163782c2a06","method":"workspace/didChangeWorkspaceFolders","registerOptions":{}}]}}
2023-02-19T14:23:21.109 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Server root directory: /home/michael/tmp/node_modules/pyright/dist/" }
2023-02-19T14:23:21.109 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Starting service instance \"tmp\"" }
2023-02-19T14:23:21.109 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-19T14:23:21.109 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{}}}
2023-02-19T14:23:21.109 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"python","text":"import json\n\ndef func(a):\n    print(a)\n","uri":"file:///home/michael/tmp/f.py","version":0}}}
2023-02-19T14:23:21.110 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///home/michael/tmp","section":"python"}]}}
2023-02-19T14:23:21.110 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":[null],"id":1}
2023-02-19T14:23:21.111 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":2,"method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///home/michael/tmp","section":"python.analysis"}]}}
2023-02-19T14:23:21.111 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":[null],"id":2}
2023-02-19T14:23:21.111 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":3,"method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///home/michael/tmp","section":"pyright"}]}}
2023-02-19T14:23:21.111 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":[null],"id":3}
2023-02-19T14:23:21.135 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"No configuration file found."}}
2023-02-19T14:23:21.135 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "No configuration file found." }
2023-02-19T14:23:21.135 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"No pyproject.toml file found."}}
2023-02-19T14:23:21.135 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":2,"message":"stubPath /home/michael/tmp/typings is not a valid directory."}}
2023-02-19T14:23:21.135 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Assuming Python platform Linux"}}
2023-02-19T14:23:21.135 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Searching for source files"}}
2023-02-19T14:23:21.136 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Found 1 source file"}}
2023-02-19T14:23:21.143 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "No pyproject.toml file found." }
2023-02-19T14:23:21.143 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Warning, message: "stubPath /home/michael/tmp/typings is not a valid directory." }
2023-02-19T14:23:21.143 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Assuming Python platform Linux" }
2023-02-19T14:23:21.143 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Searching for source files" }
2023-02-19T14:23:21.143 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Found 1 source file" }
2023-02-19T14:23:21.548 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/michael/tmp/f.py","version":0,"diagnostics":[]}}
2023-02-19T14:23:24.534 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/signatureHelp","params":{"position":{"character":10,"line":3},"textDocument":{"uri":"file:///home/michael/tmp/f.py"}},"id":1}
2023-02-19T14:23:24.681 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"result":{"signatures":[{"label":"(*values: object, sep: str | None = ..., end: str | None = ..., file: SupportsWrite[str] | None = ..., flush: Literal[False] = ...) -> None","parameters":[{"label":[1,16]},{"label":[18,39]},{"label":[41,62]},{"label":[64,101]},{"label":[103,130]}],"activeParameter":0},{"label":"(*values: object, sep: str | None = ..., end: str | None = ..., file: _SupportsWriteAndFlush[str] | None = ..., flush: bool) -> None","parameters":[{"label":[1,16]},{"label":[18,39]},{"label":[41,62]},{"label":[64,110]},{"label":[112,123]}],"activeParameter":0}],"activeSignature":0,"activeParameter":5}}
2023-02-19T14:23:24.681 helix_lsp::transport [INFO] <- {"activeParameter":5,"activeSignature":0,"signatures":[{"activeParameter":0,"label":"(*values: object, sep: str | None = ..., end: str | None = ..., file: SupportsWrite[str] | None = ..., flush: Literal[False] = ...) -> None","parameters":[{"label":[1,16]},{"label":[18,39]},{"label":[41,62]},{"label":[64,101]},{"label":[103,130]}]},{"activeParameter":0,"label":"(*values: object, sep: str | None = ..., end: str | None = ..., file: _SupportsWriteAndFlush[str] | None = ..., flush: bool) -> None","parameters":[{"label":[1,16]},{"label":[18,39]},{"label":[41,62]},{"label":[64,110]},{"label":[112,123]}]}]}
2023-02-19T14:23:26.255 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"shutdown","id":2}
2023-02-19T14:23:26.256 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":2,"result":null}
2023-02-19T14:23:26.256 helix_lsp::transport [INFO] <- null
2023-02-19T14:23:26.256 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"exit"}
But 1.1.294 seems to get stuck... (log)
2023-02-19T15:28:04.667 helix_lsp::client [INFO] Using custom LSP config: {}
2023-02-19T15:28:04.668 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"positionEncodings":["utf-32","utf-8","utf-16"]},"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"completion":{"completionItem":{"deprecatedSupport":true,"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":false,"tagSupport":{"valueSet":[1]}},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"publishDiagnostics":{},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":false},"signatureHelp":{"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown"],"parameterInformation":{"labelOffsetSupport":true}}}},"window":{"workDoneProgress":true},"workspace":{"applyEdit":true,"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"executeCommand":{"dynamicRegistration":false},"symbol":{"dynamicRegistration":false},"workspaceFolders":true}},"clientInfo":{"name":"helix","version":"22.12 (31b0c758)"},"initializationOptions":{},"processId":100190,"rootPath":"/home/michael/tmp","rootUri":"file:///home/michael/tmp","workspaceFolders":[{"name":"tmp","uri":"file:///home/michael/tmp"}]},"id":0}
2023-02-19T15:28:04.786 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Pyright language server 1.1.294 starting"}}
2023-02-19T15:28:04.787 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Server root directory: /home/michael/tmp/node_modules/pyright/dist/"}}
2023-02-19T15:28:04.787 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Pyright language server 1.1.294 starting" }
2023-02-19T15:28:04.790 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Starting service instance \"tmp\""}}
2023-02-19T15:28:04.791 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":2,"definitionProvider":{"workDoneProgress":true},"declarationProvider":{"workDoneProgress":true},"typeDefinitionProvider":{"workDoneProgress":true},"referencesProvider":{"workDoneProgress":true},"documentSymbolProvider":{"workDoneProgress":true},"workspaceSymbolProvider":{"workDoneProgress":true},"hoverProvider":{"workDoneProgress":true},"documentHighlightProvider":{"workDoneProgress":true},"renameProvider":{"prepareProvider":true,"workDoneProgress":true},"completionProvider":{"triggerCharacters":[".","["],"resolveProvider":true,"workDoneProgress":true,"completionItem":{"labelDetailsSupport":true}},"signatureHelpProvider":{"triggerCharacters":["(",",",")"],"workDoneProgress":true},"codeActionProvider":{"codeActionKinds":["quickfix","source.organizeImports"],"workDoneProgress":true},"executeCommandProvider":{"commands":[],"workDoneProgress":true},"callHierarchyProvider":true}}}
2023-02-19T15:28:04.791 helix_lsp::transport [INFO] <- {"capabilities":{"callHierarchyProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","source.organizeImports"],"workDoneProgress":true},"completionProvider":{"completionItem":{"labelDetailsSupport":true},"resolveProvider":true,"triggerCharacters":[".","["],"workDoneProgress":true},"declarationProvider":{"workDoneProgress":true},"definitionProvider":{"workDoneProgress":true},"documentHighlightProvider":{"workDoneProgress":true},"documentSymbolProvider":{"workDoneProgress":true},"executeCommandProvider":{"commands":[],"workDoneProgress":true},"hoverProvider":{"workDoneProgress":true},"referencesProvider":{"workDoneProgress":true},"renameProvider":{"prepareProvider":true,"workDoneProgress":true},"signatureHelpProvider":{"triggerCharacters":["(",",",")"],"workDoneProgress":true},"textDocumentSync":2,"typeDefinitionProvider":{"workDoneProgress":true},"workspaceSymbolProvider":{"workDoneProgress":true}}}
2023-02-19T15:28:04.791 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialized","params":{}}
2023-02-19T15:28:04.792 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"method":"client/registerCapability","params":{"registrations":[{"id":"ceb366b5-5e34-46b2-8165-29403216fbb2","method":"workspace/didChangeWorkspaceFolders","registerOptions":{}}]}}
2023-02-19T15:28:04.795 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Server root directory: /home/michael/tmp/node_modules/pyright/dist/" }
2023-02-19T15:28:04.795 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Starting service instance \"tmp\"" }
2023-02-19T15:28:04.795 helix_term::application [ERROR] Language Server: Method not found client/registerCapability
2023-02-19T15:28:04.795 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{}}}
2023-02-19T15:28:04.795 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"python","text":"import json\n\ndef func(a):\n    print(a)\n","uri":"file:///home/michael/tmp/f.py","version":0}}}
2023-02-19T15:28:04.796 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///home/michael/tmp","section":"python"}]}}
2023-02-19T15:28:04.796 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Starting service instance \"<default>\""}}
2023-02-19T15:28:04.796 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":[null],"id":1}
2023-02-19T15:28:04.796 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":2,"method":"workspace/configuration","params":{"items":[{"scopeUri":"","section":"python"}]}}
2023-02-19T15:28:04.796 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Starting service instance \"<default>\"" }
2023-02-19T15:28:04.797 helix_term::application [ERROR] received malformed method call from Language Server: workspace/configuration: protocol error: InvalidParams: Invalid params: invalid value: string "", expected relative URL without a base.
2023-02-19T15:28:04.797 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":3,"method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///home/michael/tmp","section":"python.analysis"}]}}
2023-02-19T15:28:04.797 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":[null],"id":3}
2023-02-19T15:28:04.797 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":4,"method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///home/michael/tmp","section":"pyright"}]}}
2023-02-19T15:28:04.798 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":[null],"id":4}
2023-02-19T15:28:04.820 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"No configuration file found."}}
2023-02-19T15:28:04.820 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"No pyproject.toml file found."}}
2023-02-19T15:28:04.820 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "No configuration file found." }
2023-02-19T15:28:04.820 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":2,"message":"stubPath /home/michael/tmp/typings is not a valid directory."}}
2023-02-19T15:28:04.820 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Assuming Python platform Linux"}}
2023-02-19T15:28:04.821 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Searching for source files"}}
2023-02-19T15:28:04.821 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Found 1 source file"}}
2023-02-19T15:28:04.828 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "No pyproject.toml file found." }
2023-02-19T15:28:04.828 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Warning, message: "stubPath /home/michael/tmp/typings is not a valid directory." }
2023-02-19T15:28:04.828 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Assuming Python platform Linux" }
2023-02-19T15:28:04.828 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Searching for source files" }
2023-02-19T15:28:04.828 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Found 1 source file" }
2023-02-19T15:28:08.629 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/signatureHelp","params":{"position":{"character":10,"line":3},"textDocument":{"uri":"file:///home/michael/tmp/f.py"}},"id":1}
2023-02-19T15:28:12.317 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"shutdown","id":2}
2023-02-19T15:28:12.673 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":2,"result":null}
2023-02-19T15:28:12.674 helix_lsp::transport [INFO] <- null
2023-02-19T15:28:12.674 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"result":{"signatures":[{"label":"(*values: object, sep: str | None = \" \", end: str | None = \"\\n\", file: SupportsWrite[str] | None = None, flush: Literal[False] = False) -> None","parameters":[{"label":[1,16]},{"label":[18,39]},{"label":[41,63]},{"label":[65,103]},{"label":[105,134]}],"activeParameter":0},{"label":"(*values: object, sep: str | None = \" \", end: str | None = \"\\n\", file: _SupportsWriteAndFlush[str] | None = None, flush: bool) -> None","parameters":[{"label":[1,16]},{"label":[18,39]},{"label":[41,63]},{"label":[65,112]},{"label":[114,125]}],"activeParameter":0}],"activeSignature":0,"activeParameter":5}}
2023-02-19T15:28:12.674 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"exit"}
2023-02-19T15:28:12.674 helix_lsp::transport [INFO] <- {"activeParameter":5,"activeSignature":0,"signatures":[{"activeParameter":0,"label":"(*values: object, sep: str | None = \" \", end: str | None = \"\\n\", file: SupportsWrite[str] | None = None, flush: Literal[False] = False) -> None","parameters":[{"label":[1,16]},{"label":[18,39]},{"label":[41,63]},{"label":[65,103]},{"label":[105,134]}]},{"activeParameter":0,"label":"(*values: object, sep: str | None = \" \", end: str | None = \"\\n\", file: _SupportsWriteAndFlush[str] | None = None, flush: bool) -> None","parameters":[{"label":[1,16]},{"label":[18,39]},{"label":[41,63]},{"label":[65,112]},{"label":[114,125]}]}]}

It looks like 1.1.293 started sending a workspace/configuration request with an invalid scopeUri: an empty string (which is an invalid URI type). We currently log that error but don't reply to the rpc request:

Err(err) => {
log::error!(
"received malformed method call from Language Server: {}: {}",
method,
err
);
return;
}

Replying to that request with an error response fixes the hang for me. I'll open a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants