ayamir / nvimdots

A well configured and structured Neovim.
BSD 3-Clause "New" or "Revised" License
2.83k stars 451 forks source link

Python lsp better choice? #1172

Open ayamir opened 4 months ago

ayamir commented 4 months ago

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

ayamir commented 4 months ago

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)..

aarnphm commented 4 months ago

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.

CharlesChiuGit commented 4 months ago

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

aarnphm commented 4 months ago

already migrate my whole workflow to uv and rye haha

CharlesChiuGit commented 4 months ago

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?

aarnphm commented 4 months ago

ye, think of rye as better pdm

Mythos-404 commented 3 months ago

Take a look at this pyright fork repository basedpyright which supports a number of features missing from pylsp.

CharlesChiuGit commented 3 months ago

Take a look at this pyright fork repository basedpyright which supports a number of features missing from pylsp.

nice. and it's now supported by nvim-lspconfig. worth a shoot.

CharlesChiuGit commented 2 months ago

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.

CharlesChiuGit commented 2 months ago

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?

aarnphm commented 2 months ago

ruff is not a type checker, it is a linter. the LSP is just a lint server.