From dd45f36790e1d7d4d67bf3b34ef9955ed4c3cd74 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Tue, 4 Apr 2023 16:04:13 +0300 Subject: [PATCH] Revert "Async flake8" This reverts commit 18761fd15fd6acd4b9c9c9cd0d1792f8099b1e41. --- .../start/py-flake8/autoload/python/lint.vim | 62 ------------------- .../start/py-flake8/ftplugin/lint.vim | 6 -- vim/.vim/plugin/lsp.vim | 11 ++++ 3 files changed, 11 insertions(+), 68 deletions(-) delete mode 100644 vim/.vim/pack/stargrave/start/py-flake8/autoload/python/lint.vim delete mode 100644 vim/.vim/pack/stargrave/start/py-flake8/ftplugin/lint.vim diff --git a/vim/.vim/pack/stargrave/start/py-flake8/autoload/python/lint.vim b/vim/.vim/pack/stargrave/start/py-flake8/autoload/python/lint.vim deleted file mode 100644 index 10d3fc2..0000000 --- a/vim/.vim/pack/stargrave/start/py-flake8/autoload/python/lint.vim +++ /dev/null @@ -1,62 +0,0 @@ -vim9script - -# Asynchronous pylint utility call -# Maintainer: Sergey Matveev -# License: GNU General Public License version 3 of the License or later -# -# This plugin allows you to asynchronously call pylint. -# -# * Press to start pylint on current file -# * Press to open quickfix window with messages from pylint -# * All lines with corresponding pylint existing warning will be highlighted -# * If no warning and errors occurred, "pylint is clean" message will be shown -# * If existing quickfix window is found, then it won't be overwritten. -# Start pylint manually () to force its filling - -export def Status(): string - if exists("b:pylint_job") && job_status(b:pylint_job) == "run" | return "LN" | endif - return "" -enddef - -def Qffill(ch: channel) - var msgs = [] - while ch_status(ch) == "buffered" - msgs = add(msgs, ch_read(ch)) - endwhile - cgetexpr msgs -enddef - -export def Finish(ch: channel) - var errorformat_bak = &errorformat - set errorformat=%f:%l:\ [%t]%m,%f:%l:%m - Qffill(ch) - &errorformat = errorformat_bak - sign unplace * - var id = 2 - for item in getqflist() - if item.lnum == 0 | continue | endif - execute(":sign place " .. id .. - " name=LN line=" .. item.lnum .. " buffer=" .. item.bufnr) - id = id + 2 - endfor - redraw! - if id == 2 - echohl MoreMsg | echomsg "pylint is clean" | echohl None - cclose - endif -enddef - -export def Start() - if exists("b:pylint_job") && job_status(b:pylint_job) == "run" - return - endif - var cmdline = [ - "flake8", - "--ignore=E501", - "--format=%(path)s:%(row)d: [%(code)s] %(text)s", - "--max-line-length=90", - expand("%p") - ] - b:pylint_job = job_start(cmdline, - {"in_mode": "nl", "err_io": "null", "close_cb": "python#lint#Finish"}) -enddef diff --git a/vim/.vim/pack/stargrave/start/py-flake8/ftplugin/lint.vim b/vim/.vim/pack/stargrave/start/py-flake8/ftplugin/lint.vim deleted file mode 100644 index cc252c1..0000000 --- a/vim/.vim/pack/stargrave/start/py-flake8/ftplugin/lint.vim +++ /dev/null @@ -1,6 +0,0 @@ -if exists("*python#lint#start") | finish | endif -sign define LN text=LN texthl=Error -let b:mein_status_func=function("python#lint#Status") -map :unlet! g:pylint_disable:call python#lint#Start() -" Shift-F6: -map [17;2~ :redraw!:copen diff --git a/vim/.vim/plugin/lsp.vim b/vim/.vim/plugin/lsp.vim index 1adfbe5..ad29aba 100644 --- a/vim/.vim/plugin/lsp.vim +++ b/vim/.vim/plugin/lsp.vim @@ -16,6 +16,17 @@ for d in [ path: "gopls", syncInit: true, }, + { + filetype: ["python"], + path: "pyls", + syncInit: true, + workspaceConfig: {pyls: { + configurationSources: ["flake8"], + plugins: { + mccabe: {enabled: false}, + }, + }}, + }, ] if executable(d["path"]) add(lspServers, d) -- 2.44.0