nvimdots
nvimdots copied to clipboard
Python lsp better choice?
Feature description
As we discussed in #815, current pylsp
doesn't support inlay-hint. Welcome for python
developers to discuss a better choice.
Additional information
No response
As @Jint-lzxy said, the license terms of pylance
explicitly prevent us from using it with anything other than the MS builds of VSCode, including VSCodium (AFAIK, at least)..
Honestly, I'm waiting for Astral (the company that builds Ruff) to build a type checker, haha.
Will then use whatever they are cooking up there.
seems very interesting https://github.com/astral-sh/ruff-lsp https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#ruff_lsp
ruff-lsp
supports surfacing Ruff diagnostics and providing Code Actions to fix them, but is intended to be used alongside another Python LSP in order to support features like navigation and autocompletion.
also, astral's new "pip" looks freaking fast too! https://github.com/astral-sh/uv https://youtu.be/YKDpiOU77xY
already migrate my whole workflow to uv and rye haha
already migrate my whole workflow to uv and rye haha
I guess it's this one? https://github.com/mitsuhiko/rye
from my interpretation, it looks like u purely use uv
to install python pkgs and rye
to manage the project env?
ye, think of rye as better pdm
Take a look at this pyright
fork repository basedpyright
which supports a number of features missing from pylsp
.
Take a look at this
pyright
fork repositorybasedpyright
which supports a number of features missing frompylsp
.
nice. and it's now supported by nvim-lspconfig. worth a shoot.
i think it's very hard to do the migration if we're talking about 1-to-1 mapping.
Take ruff
as an example, we use it as a linter/formatter right now.
So if we need to separate it from our current LSP, which is pylsp
, we need to config ruff
in none-ls
, and it's quite hard to do since ruff
doesn't provide well-documented way to config in cli, but only file-based configs.
If we make a file-based config, then we need to add that file in ruff
's none-ls
config to make it valid, and that will conflict with user's project ruff
config.
i dont think there's a KISS way to do default config with basedpyright
+ ruff
+ black
.
Honestly, I'm waiting for Astral (the company that builds Ruff) to build a type checker, haha.
Will then use whatever they are cooking up there.
@aarnphm isn't ruff have type checker within? Or where can i check their road map?
ruff is not a type checker, it is a linter. the LSP is just a lint server.