From 2cc48a84855b462d360ea5607237a284ba1d85ba Mon Sep 17 00:00:00 2001 From: Jannik Buhr Date: Wed, 15 Nov 2023 16:44:51 +0100 Subject: [PATCH] feat(python)!: back to pyright as the default ls for python because on the latest version it is smooth again. and when it works it just gives better diagnostics --- lua/plugins/quarto.lua | 125 +++++++++++++++++++++-------------------- 1 file changed, 63 insertions(+), 62 deletions(-) diff --git a/lua/plugins/quarto.lua b/lua/plugins/quarto.lua index 2226a64..b34311f 100644 --- a/lua/plugins/quarto.lua +++ b/lua/plugins/quarto.lua @@ -322,25 +322,25 @@ return { }, }) - -- lspconfig.pyright.setup({ - -- on_attach = on_attach, - -- capabilities = capabilities, - -- flags = lsp_flags, - -- settings = { - -- python = { - -- analysis = { - -- autoSearchPaths = true, - -- useLibraryCodeForTypes = false, - -- diagnosticMode = "openFilesOnly", - -- }, - -- }, - -- }, - -- root_dir = function(fname) - -- return util.root_pattern(".git", "setup.py", "setup.cfg", "pyproject.toml", "requirements.txt")( - -- fname - -- ) or util.path.dirname(fname) - -- end, - -- }) + lspconfig.pyright.setup({ + on_attach = on_attach, + capabilities = capabilities, + flags = lsp_flags, + settings = { + python = { + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = false, + diagnosticMode = "openFilesOnly", + }, + }, + }, + root_dir = function(fname) + return util.root_pattern(".git", "setup.py", "setup.cfg", "pyproject.toml", "requirements.txt")( + fname + ) or util.path.dirname(fname) + end, + }) -- lspconfig.jedi_language_server.setup({ -- on_attach = on_attach, @@ -363,49 +363,50 @@ return { -- pip install pylsp-rope -- pip install python-lsp-black -- pip install pylsp-mypy - lspconfig.pylsp.setup({ - on_attach = on_attach, - capabilities = capabilities, - flags = lsp_flags, - settings = { - pylsp = { - configurationSources = { - }, - plugins = { - pycodestyle = { - ignore = { - 'W391', - 'W292', -- no blank line after file - 'E303', -- blank lines in otter document - 'E302', -- blank lines in otter document - 'E305', -- blank lines in otter document - 'E111', -- indentation is not a multiple of four - 'E265', -- magic comments - 'E402', -- imports not at top - 'E741', -- ambiguous variable name - }, - maxLineLength = 120 - }, - black = { - enabled = true - }, - mypy = { - enabled = true, - dmypy = true, - live_mode = false, - }, - rope = { - - }, - } - } - }, - root_dir = function(fname) - return util.root_pattern(".git", "setup.py", "setup.cfg", "pyproject.toml", "requirements.txt")( - fname - ) or util.path.dirname(fname) - end, - }) + -- + -- lspconfig.pylsp.setup({ + -- on_attach = on_attach, + -- capabilities = capabilities, + -- flags = lsp_flags, + -- settings = { + -- pylsp = { + -- configurationSources = { + -- }, + -- plugins = { + -- pycodestyle = { + -- ignore = { + -- 'W391', + -- 'W292', -- no blank line after file + -- 'E303', -- blank lines in otter document + -- 'E302', -- blank lines in otter document + -- 'E305', -- blank lines in otter document + -- 'E111', -- indentation is not a multiple of four + -- 'E265', -- magic comments + -- 'E402', -- imports not at top + -- 'E741', -- ambiguous variable name + -- }, + -- maxLineLength = 120 + -- }, + -- black = { + -- enabled = true + -- }, + -- mypy = { + -- enabled = true, + -- dmypy = true, + -- live_mode = false, + -- }, + -- rope = { + -- + -- }, + -- } + -- } + -- }, + -- root_dir = function(fname) + -- return util.root_pattern(".git", "setup.py", "setup.cfg", "pyproject.toml", "requirements.txt")( + -- fname + -- ) or util.path.dirname(fname) + -- end, + -- }) lspconfig.julials.setup({ on_attach = on_attach,