"Failed to parse WorkspaceConfiguration params" with pyright LSP server #1898
Open
Description
Summary
When trying to open any .py file with Helix 22.03 and the pyright LSP server configured, Helix crashes out as soon as the file is opened with the following backtrace:
thread 'main' panicked at 'Failed to parse WorkspaceConfiguration params: Error { code: InvalidParams, message: "Invalid params: invalid value: string "", expected relative URL without a base.", data: None }', helix-lsp/src/lib.rs:216:22
v0.6.0 worked fine, presumably this is because of PR #1684.
Reproduction Steps
I tried this:
hx -vvv models.py
I expected this to happen:
- The editor is opened, I can edit the file, and pyright LSP server works as expected with diagnostics, completion, etc.
Instead, this happened:
- The editor immediately crashes out with a backtrace.
Helix log
~/.cache/helix/helix.log
2022-03-31T10:04:28.414 helix_view::theme [WARN] Theme: invalid style attribute: modifier
2022-03-31T10:04:28.447 mio::poll [TRACE] registering event source with poller: token=Token(1), interests=READABLE | WRITABLE
2022-03-31T10:04:28.447 mio::poll [TRACE] registering event source with poller: token=Token(2), interests=READABLE | WRITABLE
2022-03-31T10:04:28.447 mio::poll [TRACE] registering event source with poller: token=Token(3), interests=READABLE | WRITABLE
2022-03-31T10:04:28.447 mio::poll [TRACE] registering event source with poller: token=Token(4), interests=READABLE | WRITABLE
2022-03-31T10:04:28.447 mio::poll [TRACE] registering event source with poller: token=Token(5), interests=READABLE | WRITABLE
2022-03-31T10:04:28.447 helix_lsp::client [INFO] Using custom LSP config: "{\n \"python\": {\n \"analysis\": {\n \"autoSearchPaths\": true,\n \"diagnosticMode\": \"workspace\",\n \"useLibraryCodeForTypes\": true\n }\n }\n}\n"
2022-03-31T10:04:28.447 mio::poll [TRACE] registering event source with poller: token=Token(0), interests=READABLE
2022-03-31T10:04:28.447 mio::poll [TRACE] registering event source with poller: token=Token(1), interests=READABLE
2022-03-31T10:04:28.447 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":{"snippetSupport":false},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":false}},"window":{"workDoneProgress":true},"workspace":{"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false}}},"initializationOptions":"{\n \"python\": {\n \"analysis\": {\n \"autoSearchPaths\": true,\n \"diagnosticMode\": \"workspace\",\n \"useLibraryCodeForTypes\": true\n }\n }\n}\n","processId":33075,"rootUri":"file:///home/me/work/code/project"},"id":0}
2022-03-31T10:04:28.668 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Pyright language server 1.1.234 starting"}}
2022-03-31T10:04:28.668 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Server root directory: /usr/lib/node_modules/pyright/dist/"}}
2022-03-31T10:04:28.669 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Pyright language server 1.1.234 starting" }
2022-03-31T10:04:28.670 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Server root directory: /usr/lib/node_modules/pyright/dist/" }
2022-03-31T10:04:28.672 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},"signatureHelpProvider":{"triggerCharacters":["(",",",")"],"workDoneProgress":true},"codeActionProvider":{"codeActionKinds":["quickfix","source.organizeImports"],"workDoneProgress":true},"executeCommandProvider":{"commands":[],"workDoneProgress":true},"callHierarchyProvider":true}}}
2022-03-31T10:04:28.672 helix_lsp::transport [INFO] <- {"capabilities":{"callHierarchyProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","source.organizeImports"],"workDoneProgress":true},"completionProvider":{"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}}}
2022-03-31T10:04:28.672 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialized","params":{}}
2022-03-31T10:04:28.672 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":"{\n \"python\": {\n \"analysis\": {\n \"autoSearchPaths\": true,\n \"diagnosticMode\": \"workspace\",\n \"useLibraryCodeForTypes\": true\n }\n }\n}\n"}}
2022-03-31T10:04:28.672 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"python","text":"","uri":"file:///home/me/work/code/project/project/causes/models.py","version":0}}}
2022-03-31T10:04:28.679 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"method":"workspace/configuration","params":{"items":[{"scopeUri":"","section":"python"}]}}
2022-03-31T10:04:28.680 mio::poll [TRACE] deregistering event source from poller
2022-03-31T10:04:28.681 mio::poll [TRACE] deregistering event source from poller
2022-03-31T10:04:28.681 mio::poll [TRACE] deregistering event source from poller
2022-03-31T10:04:28.681 mio::poll [TRACE] deregistering event source from poller
2022-03-31T10:04:28.681 mio::poll [TRACE] deregistering event source from poller
config.toml:
[[language]]
name = "python"
language-server = { command = "pyright-langserver", args = ["--stdio"] }
auto-format = false
config = """
{
"python": {
"analysis": {
"autoSearchPaths": true,
"diagnosticMode": "workspace",
"useLibraryCodeForTypes": true
}
}
}
"""
Platform
Linux arch
Terminal Emulator
foot 1.11.0
Helix Version
helix 22.03 (d4e45fd)