From a24f1905316e7a146f922683e0f32c0e59f37503 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 8 Feb 2026 07:06:51 +0800 Subject: [PATCH 1/3] vim-patch:1ff2239: runtime(compiler): add pyright Python type checker closes: vim/vim#19017 https://github.com/vim/vim/commit/1ff2239053684add9ead3c121e12169e7682db7a Co-authored-by: Konfekt --- runtime/compiler/pyright.vim | 25 +++++++++++++++++++++++++ runtime/doc/quickfix.txt | 7 +++++++ 2 files changed, 32 insertions(+) create mode 100644 runtime/compiler/pyright.vim diff --git a/runtime/compiler/pyright.vim b/runtime/compiler/pyright.vim new file mode 100644 index 0000000000..a7dad6f377 --- /dev/null +++ b/runtime/compiler/pyright.vim @@ -0,0 +1,25 @@ +" Vim compiler file +" Compiler: Pyright (Python Type Checker) +" Maintainer: @konfekt +" Last Change: 2025 Dec 26 + +if exists("current_compiler") | finish | endif +let current_compiler = "pyright" + +let s:cpo_save = &cpo +set cpo&vim + +" CompilerSet makeprg=pyright +" CompilerSet makeprg=basedpyright +exe 'CompilerSet makeprg=' .. escape( + \ get(b:, 'pyright_makeprg', get(g:, 'pyright_makeprg', 'pyright')), + \ ' \|"') +CompilerSet errorformat= + \%E%f:%l:%c\ -\ error:\ %m, + \%W%f:%l:%c\ -\ warning:\ %m, + \%N%f:%l:%c\ -\ note:\ %m, + \%C[ \t]\ %.%#, + \%-G%.%# + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 7d307d41b6..00ce253c05 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1656,6 +1656,13 @@ b/g:mypy_makeprg_params variable. For example: > The global default is "--strict --ignore-missing-imports". +PYRIGHT TYPE CHECKER *compiler-pyright* + +Commonly used compiler options can be added to 'makeprg' by setting the +b/g:pyright_makeprg_params variable. + +The global default is "pyright". + TY TYPE CHECKER *compiler-ty* Commonly used compiler options and executable can be set by the From 289eb2edd9c83870bc59d0f17fff25df8c738437 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 8 Feb 2026 07:07:13 +0800 Subject: [PATCH 2/3] vim-patch:d15c718: runtime(compiler): fix space escape in pyright closes: vim/vim#19354 https://github.com/vim/vim/commit/d15c71803873f9165c931af31d86473329682b19 Co-authored-by: Mao-Yining --- runtime/compiler/pyright.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/compiler/pyright.vim b/runtime/compiler/pyright.vim index a7dad6f377..eef6a9eb67 100644 --- a/runtime/compiler/pyright.vim +++ b/runtime/compiler/pyright.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Pyright (Python Type Checker) " Maintainer: @konfekt -" Last Change: 2025 Dec 26 +" Last Change: 2025 Feb 7 if exists("current_compiler") | finish | endif let current_compiler = "pyright" @@ -18,7 +18,7 @@ CompilerSet errorformat= \%E%f:%l:%c\ -\ error:\ %m, \%W%f:%l:%c\ -\ warning:\ %m, \%N%f:%l:%c\ -\ note:\ %m, - \%C[ \t]\ %.%#, + \%C[\ \t]\ %.%#, \%-G%.%# let &cpo = s:cpo_save From deac3fc13f3031c744f2105e41c93d21198a3548 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 8 Feb 2026 07:07:47 +0800 Subject: [PATCH 3/3] vim-patch:27630b2: runtime(python3complete): remove trailing white space related: vim/vim#19354 https://github.com/vim/vim/commit/27630b28ad70fd97466e324f741f90ca3ef2536a Co-authored-by: Mao-Yining --- runtime/autoload/python3complete.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/autoload/python3complete.vim b/runtime/autoload/python3complete.vim index b0781864c5..ca5707d31f 100644 --- a/runtime/autoload/python3complete.vim +++ b/runtime/autoload/python3complete.vim @@ -448,7 +448,7 @@ class PyParser: def _parseassignment(self): assign='' tokentype, token, indent = self.donext() - if tokentype == tokenize.STRING or token == 'str': + if tokentype == tokenize.STRING or token == 'str': return '""' elif token == '(' or token == 'tuple': return '()' @@ -556,7 +556,7 @@ class PyParser: freshscope = True dbg("new scope: class") self.scope = self.scope.add(cls) - + elif token == 'import': imports = self._parseimportlist() for mod, alias in imports: @@ -578,7 +578,7 @@ class PyParser: elif tokentype == STRING: if freshscope: self.scope.doc(token) elif tokentype == NAME: - name,token = self._parsedotname(token) + name,token = self._parsedotname(token) if token == '=': stmt = self._parseassignment() dbg("parseassignment: %s = %s" % (name, stmt))