use pyright instead of pylsp in helix #8207
Replies: 19 comments
-
There is only one default but you can always use a custom languages.toml configuration to switch to pyright. |
Beta Was this translation helpful? Give feedback.
-
If pyright is the preferred LSP by the community then you can open a PR to switch the default. |
Beta Was this translation helpful? Give feedback.
-
how to do that #languages.toml hx --health python however it does not work |
Beta Was this translation helpful? Give feedback.
-
It should work since it's detected. Try running with |
Beta Was this translation helpful? Give feedback.
-
There's this: #5369 (reply in thread) |
Beta Was this translation helpful? Give feedback.
-
Should be fixed now with #5471 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Maybe, according to the documentation we need to turn on |
Beta Was this translation helpful? Give feedback.
-
Did you read this helix-docs? I haven't tried it, but I think you need to pass additional arguments to the |
Beta Was this translation helpful? Give feedback.
-
Specifying any config in the
works as expected: |
Beta Was this translation helpful? Give feedback.
-
@carrascomj, is this still working for you? On the latest Helix version (23.03), it doesn't work. This is the configuration:
[[language]]
name = "python"
auto-format = true
language-server = { command = "pyright-langserver", args = ["--stdio"] }
config = {}
{
"typeCheckingMode": "off"
} I still get type errors in Helix, but running |
Beta Was this translation helpful? Give feedback.
-
@oyarsa I installed from community/helix (arch) version 23.03 and still works for me™, in the sense that the type checks are removed when I put that configuration in the root of my project. Maybe your project root is not properly determined by helix? I tried removing the |
Beta Was this translation helpful? Give feedback.
-
@carrascomj, here's what I learned: With no Defining Having multiple This could work if we had workspace Helix configurations that override LSP settings. For that to work, we need |
Beta Was this translation helpful? Give feedback.
-
I've trying pyright for a while, but found it's slow for larger project, here is more information: microsoft/pyright#1997 |
Beta Was this translation helpful? Give feedback.
-
@archseer and all other Helix contributors . It is a humble request please do not make pyright the default lsp. I have used pyright for long time and recently switched to and used pylsp and believe me that pyslp is better than pyright. Please keep pylsp as the default lsp for python in helix. We don't care about it's popularity, pylsp works well and that's what we want. Thanks! |
Beta Was this translation helpful? Give feedback.
-
[language-server]
pyright = { command = "pyright-langserver", args = ["--stdio"], config = {} }
[[language]]
name = "python"
roots = ["pyproject.toml"]
language-servers = [ "pyright" ] Seems to work great (with latest master) and I can add a |
Beta Was this translation helpful? Give feedback.
-
There is something buggy and weird going on with pyright! I have found after a lot of messing around you can't really set anything in the Helix settings, you need the external config file AND an empty config setting in Helix. Please correct me if I am wrong, but this is my final working setup: [language-server.pyright]
command = "pyright-langserver"
args = ["--stdio"]
config = {} # buggy behaviour, you need a pyproject.toml and pyrightconfig.json
[[language]]
name = "python"
formatter = { command = "black", args = ["--quiet", "-"] }
auto-format = true
roots = ["pyproject.toml"]
language-servers = [ "pyright" ]
{
"typeCheckingMode": "strict",
"reportMissingImports": true
} |
Beta Was this translation helpful? Give feedback.
-
I always add my library paths to the LSP for highlighting and The config field in config = { extraPaths = ["./test"] } But, creating a [tool.pyright]
extraPaths = ["./test"] |
Beta Was this translation helpful? Give feedback.
-
I think all actionable issuse are fixed here #5479 (comment) |
Beta Was this translation helpful? Give feedback.
-
#834
pyright is more powerful in syntax analysis and linter
and more popular
Beta Was this translation helpful? Give feedback.
All reactions