From: Konfekt Date: Sat, 27 Dec 2025 14:07:21 +0000 (+0000) Subject: runtime(compiler): add pyright Python type checker X-Git-Tag: v9.1.2023~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ff2239053684add9ead3c121e12169e7682db7a;p=thirdparty%2Fvim.git runtime(compiler): add pyright Python type checker closes: #19017 Signed-off-by: Konfekt Signed-off-by: Christian Brabandt --- 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 d19b26d7f1..73e4205d7b 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 9.1. Last change: 2025 Dec 21 +*quickfix.txt* For Vim version 9.1. Last change: 2025 Dec 27 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1654,6 +1654,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 diff --git a/runtime/doc/tags b/runtime/doc/tags index 6a00cc789b..3496a86a2f 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -6772,6 +6772,7 @@ compiler-mypy quickfix.txt /*compiler-mypy* compiler-pandoc quickfix.txt /*compiler-pandoc* compiler-perl quickfix.txt /*compiler-perl* compiler-pylint quickfix.txt /*compiler-pylint* +compiler-pyright quickfix.txt /*compiler-pyright* compiler-pytest quickfix.txt /*compiler-pytest* compiler-pyunit quickfix.txt /*compiler-pyunit* compiler-ruff quickfix.txt /*compiler-ruff*