Skip to content

Commit 1ff2239

Browse files
Konfektchrisbra
authored andcommitted
runtime(compiler): add pyright Python type checker
closes: #19017 Signed-off-by: Konfekt <Konfekt@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 08aaa7a commit 1ff2239

3 files changed

Lines changed: 34 additions & 1 deletion

File tree

runtime/compiler/pyright.vim

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
" Vim compiler file
2+
" Compiler: Pyright (Python Type Checker)
3+
" Maintainer: @konfekt
4+
" Last Change: 2025 Dec 26
5+
6+
if exists("current_compiler") | finish | endif
7+
let current_compiler = "pyright"
8+
9+
let s:cpo_save = &cpo
10+
set cpo&vim
11+
12+
" CompilerSet makeprg=pyright
13+
" CompilerSet makeprg=basedpyright
14+
exe 'CompilerSet makeprg=' .. escape(
15+
\ get(b:, 'pyright_makeprg', get(g:, 'pyright_makeprg', 'pyright')),
16+
\ ' \|"')
17+
CompilerSet errorformat=
18+
\%E%f:%l:%c\ -\ error:\ %m,
19+
\%W%f:%l:%c\ -\ warning:\ %m,
20+
\%N%f:%l:%c\ -\ note:\ %m,
21+
\%C[ \t]\ %.%#,
22+
\%-G%.%#
23+
24+
let &cpo = s:cpo_save
25+
unlet s:cpo_save

runtime/doc/quickfix.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*quickfix.txt* For Vim version 9.1. Last change: 2025 Dec 21
1+
*quickfix.txt* For Vim version 9.1. Last change: 2025 Dec 27
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1654,6 +1654,13 @@ b/g:mypy_makeprg_params variable. For example: >
16541654
16551655
The global default is "--strict --ignore-missing-imports".
16561656

1657+
PYRIGHT TYPE CHECKER *compiler-pyright*
1658+
1659+
Commonly used compiler options can be added to 'makeprg' by setting the
1660+
b/g:pyright_makeprg_params variable.
1661+
1662+
The global default is "pyright".
1663+
16571664
TY TYPE CHECKER *compiler-ty*
16581665

16591666
Commonly used compiler options and executable can be set by the

runtime/doc/tags

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6772,6 +6772,7 @@ compiler-mypy quickfix.txt /*compiler-mypy*
67726772
compiler-pandoc quickfix.txt /*compiler-pandoc*
67736773
compiler-perl quickfix.txt /*compiler-perl*
67746774
compiler-pylint quickfix.txt /*compiler-pylint*
6775+
compiler-pyright quickfix.txt /*compiler-pyright*
67756776
compiler-pytest quickfix.txt /*compiler-pytest*
67766777
compiler-pyunit quickfix.txt /*compiler-pyunit*
67776778
compiler-ruff quickfix.txt /*compiler-ruff*

0 commit comments

Comments
 (0)