Commit: runtime(compiler): add pyright Python type checker

0 views
Skip to first unread message

Christian Brabandt

unread,
9:16 AM (7 hours ago) 9:16 AM
to vim...@googlegroups.com
runtime(compiler): add pyright Python type checker

Commit: https://github.com/vim/vim/commit/1ff2239053684add9ead3c121e12169e7682db7a
Author: Konfekt <Kon...@users.noreply.github.com>
Date: Sat Dec 27 14:07:21 2025 +0000

runtime(compiler): add pyright Python type checker

closes: https://github.com/vim/vim/issues/19017

Signed-off-by: Konfekt <Kon...@users.noreply.github.com>
Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/compiler/pyright.vim b/runtime/compiler/pyright.vim
new file mode 100644
index 000000000..a7dad6f37
--- /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[ ]\ %.%#,
+ \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index d19b26d7f..73e4205d7 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 6a00cc789..3496a86a2 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*
Reply all
Reply to author
Forward
0 new messages