From 2eb2d0ee421c9f02389224d6bf443243fc32a9ef Mon Sep 17 00:00:00 2001 From: Mora Unie Youer Date: Sat, 29 Nov 2025 14:33:41 +0300 Subject: feat: add `basedpyright` for Python files --- flake.nix | 2 ++ lsp/basedpyright.lua | 23 +++++++++++++++++++++++ lua/config/lsp.lua | 2 ++ 3 files changed, 27 insertions(+) create mode 100644 lsp/basedpyright.lua diff --git a/flake.nix b/flake.nix index a978d4c..5319107 100644 --- a/flake.nix +++ b/flake.nix @@ -153,6 +153,8 @@ nixfmt-rfc-style ]; + python = [ basedpyright ]; + qml = [ kdePackages.qtdeclarative ]; rust = [ diff --git a/lsp/basedpyright.lua b/lsp/basedpyright.lua new file mode 100644 index 0000000..79ff625 --- /dev/null +++ b/lsp/basedpyright.lua @@ -0,0 +1,23 @@ +return { + cmd = { "basedpyright-langserver", "--stdio" }, + filetypes = { "python" }, + root_markers = { + "pyrightconfig.json", + "pyproject.toml", + "setup.py", + "setup.cfg", + "requirements.txt", + "Pipfile", + ".git", + }, + + settings = { + basedpyright = { + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = "openFilesOnly", + }, + }, + }, +} diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua index 059b754..8596654 100644 --- a/lua/config/lsp.lua +++ b/lua/config/lsp.lua @@ -12,6 +12,8 @@ vim.lsp.enable({ "nixd", + "basedpyright", + "qmlls", "rust-analyzer", -- cgit v1.2.3-70-g09d2