Python lsp: Pyright isn't good #23376
Replies: 73 comments
-
Yeah, We are working on language plugins at the moment, so, in the not-so-distant future, someone can just add these servers as plugins, but I do think we should swap out our provided one for a bettter one. |
Beta Was this translation helpful? Give feedback.
-
Indeed they did build a language server protocol for Ruff already |
Beta Was this translation helpful? Give feedback.
-
AFAICT, |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
See that python-dotenv is installed, along with pydantic in my env - (pip list) but I guess pyright is not checking for packages in the project-directory/.venv ??? |
Beta Was this translation helpful? Give feedback.
-
You need this file.
|
Beta Was this translation helpful? Give feedback.
-
There's an issue #8541 about resolving modules with Pyright. |
Beta Was this translation helpful? Give feedback.
-
I see this problem last for months, but there's still no real solution? |
Beta Was this translation helpful? Give feedback.
-
This should actually solve the problem - for some reason, during the migration of our documentation, we lost our Python docs that mentions this config file. I've quickly dumped the old Python docs contents into the As a side note, I want to say that we are going to be doing more for Python here shortly - we recognize just how important this language is, being one of the top most-used languages, and we want to improve for Python devs in Zed. |
Beta Was this translation helpful? Give feedback.
-
I tried it, but no luck. I use poetry in my python project, does it matter? |
Beta Was this translation helpful? Give feedback.
-
To add to the corpus of Pyright issues, in
Additionally, in
I have done no custom configuration. I believe these shouldn't be showing issues as they work as expected and are standard practices. |
Beta Was this translation helpful? Give feedback.
-
@newtome8888 run {
"venvPath": "/Users/username/Library/Caches/pypoetry/virtualenvs",
"venv": "projectname-p0LYZhue-py3.11"
} |
Beta Was this translation helpful? Give feedback.
-
Just to mention, there is a setting in poetry tells poetry to install the venv within the project: Which would stabilize where the |
Beta Was this translation helpful? Give feedback.
-
Using pyright is literally painful. |
Beta Was this translation helpful? Give feedback.
-
How to disable pyright and move to pylsp ? |
Beta Was this translation helpful? Give feedback.
-
You can now search for "Python LSP" in extensions to enable it. Note that you will need to install the python lsp server directly first. Read more in the |
Beta Was this translation helpful? Give feedback.
-
Is the "Go to Definition" feature implemented in your plugin? I would like to try Zed on Win11. Could you please provide more detailed instructions on how to set up the plugin? |
Beta Was this translation helpful? Give feedback.
-
Even with |
Beta Was this translation helpful? Give feedback.
-
Has anyone successfully started pylsp and been able to use the code completion feature? Even though I installed |
Beta Was this translation helpful? Give feedback.
-
@failable You should also have |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Do you have it in PATH? |
Beta Was this translation helpful? Give feedback.
-
Question (I can open a different issue if needed, but I thought asking here is Ok, if not, please let me know). I have my own language server that I do for Python (https://marketplace.visualstudio.com/items?itemName=fabioz.vscode-pydev), how can I stop using the builtin one to use my own? -- i.e.: if I register another Python extension (as in https://github.com/rgbkrk/python-lsp-zed-extension/), will it stop using the builtin one, which is giving me pyright errors? |
Beta Was this translation helpful? Give feedback.
-
Looks like also see issue: #20646 |
Beta Was this translation helpful? Give feedback.
-
My only gripe with pylsp is that, as of today, basedpyright is a more fleshed out type checker with more features such as inlay hints, and a very active developer who's pushing patches on a weekly basis, whereas pylsp seems to be a bit stale and features such as inlay hints are still missing. Furthermore from my perspective having the formatter (Ruff) in parallel to the LSP is a more flexible experience than having the formatter hierarchically under the the LSP (as a plugin). But I am not well acquainted with the technicalities of this topic so perhaps there is a performance/scaling consideration that I'm not aware of. |
Beta Was this translation helpful? Give feedback.
-
There is any simple way to replace pyright with mypy? Pyright being the default is kinda a deal breaker for me. |
Beta Was this translation helpful? Give feedback.
-
You can use mypy with pylsp that's the other language server provided out of the box. |
Beta Was this translation helpful? Give feedback.
-
for macOS using pylsp with ruff, here is my setup:
Install python-lsp-ruff:
|
Beta Was this translation helpful? Give feedback.
-
I can rely on that. I've give a try to By the way, I actually have to use Not sure if this is the best config but it works as intended. Just my 2 cents experience. |
Beta Was this translation helpful? Give feedback.
-
Check for existing issues
Describe the feature
it should be pylsp. The pyright has issues about recognize libraries installed
If applicable, add mockups / screenshots to help present your vision of the feature
No response
Beta Was this translation helpful? Give feedback.
All reactions