From bf1f88b7a49d82c27b3483930d4476158bada232 Mon Sep 17 00:00:00 2001 From: Maciej Lebiest Date: Thu, 23 Nov 2023 22:00:35 +0100 Subject: [PATCH] update indent highlight, fix python lsp setup --- Dockerfile | 2 +- lua/plugins/indent-blankline.lua | 6 ++++-- lua/plugins/nvim-lspconfig.lua | 30 +++++++++++++++++++----------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index c6d035a..541e5ee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,7 +45,6 @@ ENV MASON_PKGS=" \ phpstan \ pyright \ python-lsp-server \ - ruff-lsp \ sqlls \ typescript-language-server \ yaml-language-server \ @@ -62,6 +61,7 @@ COPY . /root/.config/nvim RUN dnf install -y \ ${GENERAL_PKGS} ${NEOVIM_PKGS} ${PYTHON_DEVEL_PKGS} ${R_DEVEL_PKGS} ${RUBY_DEVEL_PKGS} && \ R -e 'install.packages("languageserver", repos = "http://cran.us.r-project.org")' && \ + dnf -y autoremove && \ dnf clean all && \ pip install ${PIP_PKGS} diff --git a/lua/plugins/indent-blankline.lua b/lua/plugins/indent-blankline.lua index 8305257..b8fc7b7 100644 --- a/lua/plugins/indent-blankline.lua +++ b/lua/plugins/indent-blankline.lua @@ -8,7 +8,6 @@ function init() "Yellow", "Red", } - local hooks = require "ibl.hooks" -- create the highlight groups in the highlight setup hook, so they are reset -- every time the colorscheme changes @@ -22,7 +21,10 @@ function init() vim.api.nvim_set_hl(0, "Cyan", { fg = "#56B6C2" }) end) - require("ibl").setup { indent = { highlight = highlight } } + vim.g.rainbow_delimiters = { highlight = highlight } + require("ibl").setup { scope = { highlight = highlight } } + + hooks.register(hooks.type.SCOPE_HIGHLIGHT, hooks.builtin.scope_highlight_from_extmark) end return { diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua index 8fb3b6f..265a943 100644 --- a/lua/plugins/nvim-lspconfig.lua +++ b/lua/plugins/nvim-lspconfig.lua @@ -47,8 +47,11 @@ return { , settings = { pylsp = { plugins = { - rope_autoimport = { enabled = false, memory = true }, - rope_completion = { enabled = false, eager = true }, + rope_autoimport = { enabled = true, memory = true }, + rope_completion = { enabled = true, eager = false }, + rope = { + ropeFolder = nil + }, jedi_completion = { enabled = true, include_params = true, @@ -62,7 +65,7 @@ return { jedi_references = { enabled = true }, jedi_signature_help = { enabled = true }, jedi_symbols = { enabled = true }, - --ruff = { enabled = true }, + ruff = { enabled = false }, flake8 = { enabled = false -- ruff_lsp }, @@ -71,7 +74,9 @@ return { args = { -- disable missing module docstring info -- and temporarilt false cannot import errors - '--disable=C0114,E0401' + -- too few public methods + -- missing functon or method doc + '--disable=C0114,E0401,R0903,C0116' } }, yapf = { @@ -80,14 +85,17 @@ return { autopep8 = { enabled = false }, - pyflakes = { enabled = false }, -- ruff_lsp - pyodestyle = { enabled = false }, -- ruff_lsp + pyflakes = { enabled = true }, -- ruff_lsp + pycodestyle = { enabled = false }, -- ruff_lsp pydocstyle = { enabled = true, ignore = { 'D100', -- disable missing module docstring info + 'D101', -- disable missing public class doc + 'D102', -- disable missing class method doc + 'D103', -- disable missing function doc 'D203', -- disable one line before class docstring required - 'D213' -- disable multiline docstring summary + 'D213', -- disable multiline docstring summary -- should start at the second line } }, @@ -95,10 +103,10 @@ return { } } } - require 'lspconfig'.ruff_lsp.setup { - on_attach = on_attach, - capabilities = capabilities, - } + --require 'lspconfig'.ruff_lsp.setup { + --on_attach = on_attach, + --capabilities = capabilities, + --} require 'lspconfig'.pyright.setup { on_attach = on_attach, capabilities = capabilities,