]> git.feebdaed.xyz Git - 0xmirror/vim.git/commitdiff
runtime(compiler): add pyright Python type checker
authorKonfekt <Konfekt@users.noreply.github.com>
Sat, 27 Dec 2025 14:07:21 +0000 (14:07 +0000)
committerChristian Brabandt <cb@256bit.org>
Sat, 27 Dec 2025 14:07:21 +0000 (14:07 +0000)
closes: #19017

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/compiler/pyright.vim [new file with mode: 0644]
runtime/doc/quickfix.txt
runtime/doc/tags

diff --git a/runtime/compiler/pyright.vim b/runtime/compiler/pyright.vim
new file mode 100644 (file)
index 0000000..a7dad6f
--- /dev/null
@@ -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
index d19b26d7f1995dac1f77ada8dc668ce3481faead..73e4205d7b8845172100ed5c509ed4b833950dce 100644 (file)
@@ -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
index 6a00cc789b401430d80c83750230f387cdf87300..3496a86a2f7645734b481954ceb6458fc16ac15e 100644 (file)
@@ -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*