From 96dc5e3220831699ac29e5949671140c63d234bf Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Fri, 13 Sep 2024 16:56:49 +0300 Subject: [PATCH] languages/python: add basedpyright LSP --- modules/plugins/languages/python.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/modules/plugins/languages/python.nix b/modules/plugins/languages/python.nix index a113a6c..57c751f 100644 --- a/modules/plugins/languages/python.nix +++ b/modules/plugins/languages/python.nix @@ -30,6 +30,21 @@ } ''; }; + + basedpyright = { + package = pkgs.basedpyright; + lspConfig = '' + lspconfig.basedpyright.setup{ + capabilities = capabilities; + on_attach = default_on_attach; + cmd = ${ + if isList cfg.lsp.package + then expToLua cfg.lsp.package + else ''{"${cfg.lsp.package}/bin/basedpyright-langserver", "--stdio"}'' + } + } + ''; + }; }; defaultFormat = "black"; @@ -61,11 +76,12 @@ black-and-isort = { package = pkgs.writeShellApplication { name = "black"; + runtimeInputs = [pkgs.black pkgs.isort]; text = '' black --quiet - "$@" | isort --profile black - ''; - runtimeInputs = [pkgs.black pkgs.isort]; }; + nullConfig = '' table.insert( ls_sources,