-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
"Failed to parse WorkspaceConfiguration params" with pyright LSP server #1898
Comments
Seems to rely on pyright I guess we should specify all three, the LSP spec is getting ridiculous. |
Can you test 84e799f ? |
When using my config from above:
When commenting out the 'config' option in my languages.toml, I can load the document and there's no backtrace, but there's also no LSP functionality, completion, diagnostics, etc:
Running Thanks for the quick reply! :) |
Opened an upstream issue, I'm out of ideas |
Can you try 8adf0c1 ? |
It works, thank you so much! If I specify the 'config' option in languages.toml, even if its just an empty string, everything works as expected. But, if I comment 'config' out, LSP functionality no longer works, and after 10 secs or so, I get the error:
I can live with specifying an empty 'config' option to get it to work, but should I raise this as a separate issue? |
Can you provide logs for both success and failure cases? I need more information to diagnose this. |
Of course. Here it works fine, with
And here it fails with the
|
It seems like it won't really do much without |
It's fixed on the latest master, but not on 22.03 |
@archseer , is there any binary for arch linux to try something like, helix-git? I don't want to compile. |
Yeah, we mention it in the installation docs. |
@archseer , thanks a lot. currently learning neovim and going through little crazy stuff. helix came to rescue. 😄 |
@archseer , it works fine with existing python file.
|
I have the same crash. I think I managed to work around it with the following config. Basically setting the current directory "." as one of the roots. I'm not sure how this behaves, but I'm hoping it falls back to using the current directory as the root if it can't find any of the other files listed. This is useful for when creating one-off scripts and the like. Note there is also the chance that I've made it so that it always uses the current directory, I don't really understand the priority of the values listed after roots. [[language]]
name = "python"
roots = ["pyproject.toml", "setup.py", "Poetry.lock", "."]
language-server = { command = "pyright-langserver", args = ["--stdio"] }
auto-format = false
config = {}
|
this is my config for pyright , it's work for me.
I don't kown why that just have |
Is it even possible to configure pyright?
I just want to turn off type checking. But it doesn't do anything. No matter what I put in |
Did you try Erasin's configuration from the parent comment? [[language]]
name = "python"
file-types = ["py", "pyi"]
roots = ["pyproject.toml","pyrightconfig.json"]
language-server = { command = "pyright-langserver", args = ["--stdio"] }
config = { "analysis" = { "autoSearchPaths" = true, "diagnosticMode" = "workspace", "useLibraryCodeForTypes" = true } }
|
Just tried it, it doesn't work. I tried copy-pasting different configs I found on the internet, nothing works |
Concur with above, on Helix 22.12 Using @the-mikedavis's config (
Related: microsoft/pyright#4602 |
I am on helix 22.12 (882fa11),
|
Same thing here (complete configuration file): [[language]]
name = "python"
# roots = ["pyproject.toml"]
language-server = { command = "pyright-langserver", args = ["--stdio"] }
# NOTE: the following is important even if config is empty.
config = { }
formatter = { command = "black", args = ["--quiet", "-"] }
auto-format = true Versions (39e32db): $ hx --version
helix 22.12 (39e32dbd)
$ pyright --version
pyright 1.1.289 The only thing I wish I could do is to have pyright make typing strict for all code files without having to add |
I'm using the latest main branch (helix 23.05 (57e538d)). Pyright settings in If I create a directory I am not able to control the settings from Here's a dummy # run.py
import library_that_doesnt_exist # raises a reportMissingImports error
a: str = 42 # should raise a type error when typeCheckingMode is `"basic"` or `"strict"`, not if its `"off"` Here's the [[language]]
name = "python"
scope = "source.python"
injection-regex = "python"
file-types = ["py","pyi","py3","pyw",".pythonstartup",".pythonrc"]
shebangs = ["python"]
roots = ["pyproject.toml", "pyrightconfig.json", "."]
comment-token = "#"
language-servers = [ "pyright" ]
indent = { tab-width = 4, unit = " " }
[language-server.pyright]
command = "pyright-langserver"
args = ["--stdio"]
# config = {}
# The following title with values commented out is equivalent to `config = {}` above.
[language-server.pyright.config]
typeCheckingMode = "off"
reportMissingImports = false
# I don't think this one should work, but I tested it anyway
# [language-server.pyright.config.analysis]
# typeCheckingMode = "off"
# reportMissingImports = false This is the pyproject.toml I've tried: [tool.pyright]
# typeCheckingMode = "off"
reportMissingImports = "none" and the {
"typeCheckingMode": "off"
} I'd appreciate anyone else's input on this!
|
Figured it out from looking at some vim setups: You have to specify the full [language-server.pyright.config.python.analysis]
typeCheckingMode = "off" |
@schneiderfelipe, the following config makes pyright type check in strict mode: [language-server.pyright]
command = "pyright-langserver"
args = ["--stdio"]
[language-server.pyright.config.python.analysis]
typeCheckingMode = "strict" |
Excellent, works perfectly! Thanks! |
@thomasaarholt In the most recent Helix this is included: pyright = { command = "pyright-langserver", args = ["--stdio"], config = {} } but when I add
To my The |
@David-Else, here's my current config, which does give me type checking. [[language]]
name = "python"
scope = "source.python"
language-servers = ["pyright"]
# I've removed some additional settings here, but they should be irrelevant.
[language-server.pyright]
command = "pyright-langserver"
args = ["--stdio"]
[language-server.pyright.config]
reportMissingTypeStubs = false
[language-server.pyright.config.python.analysis]
typeCheckingMode = "basic"
autoImportCompletions = true My full config is here in a gist. I actually came here because I seem to no longer get documentation on hover when I press In the first part of the above config, I had: [[language]]
name = "python"
scope = "source.python"
language-servers = ["ruff", "pyright"] Changing to [[language]]
name = "python"
scope = "source.python"
language-servers = ["pyright", "ruff"] I realised this by calling
Here I realised that |
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:
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:
Instead, this happened:
Helix log
~/.cache/helix/helix.log
config.toml:
Platform
Linux arch
Terminal Emulator
foot 1.11.0
Helix Version
helix 22.03 (d4e45fd)
The text was updated successfully, but these errors were encountered: