]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(compiler): set errorformat where missing
authorKonfekt <Konfekt@users.noreply.github.com>
Thu, 20 Nov 2025 20:54:31 +0000 (20:54 +0000)
committerChristian Brabandt <cb@256bit.org>
Thu, 20 Nov 2025 20:54:31 +0000 (20:54 +0000)
As a matter of caution it sets it to the default gcc errorformat:

```
errorformat=%*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-Gg%\?make[%*\d]: *** [%f:%l:%m,%-Gg%\?make: *** [%f:%l:%m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory %*[`']%f',%X%*\a[%*\d]: Leaving directory %*[`']%f',%D%*\a: Entering directory %*[`']%f',%X%*\a: Leaving directory %*[`']%f',%DMaking %*\a in %f,%f|%l| %m
```

so that the compiler keeps working after switching to others.

While likely only a subset is needed; such a subset has been proposed in
a commented errorformat;

checked to work for yamllint but ran out of steam for other compilers;

closes: #18754

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/compiler/rime_deployer.vim
runtime/compiler/vimdoc.vim
runtime/compiler/yamllint.vim
runtime/compiler/zig_build_exe.vim
runtime/compiler/zig_test.vim

index e0c8daef6e6a6f3ddfc1c02d2a46b8594316f481..5331412dc395f6d229334c46089dc95e314820d7 100644 (file)
@@ -3,6 +3,7 @@
 " Maintainer:           Wu, Zhenyu <wuzhenyu@ustc.edu>
 " URL:                  https://rime.im
 " Latest Revision:      2024-04-09
+" Last Change:          2025 Nov 16 by The Vim Project (set errorformat)
 
 if exists('b:current_compiler')
   finish
@@ -25,6 +26,8 @@ for s:shared_data_dir in ['/sdcard/rime-data', '/run/current-system/sw/share/rim
 endfor
 execute 'CompilerSet makeprg=rime_deployer\ --build\ %:p:h:S\' s:shared_data_dir
 unlet s:prefix s:shared_data_dir
+" CompilerSet errorformat=%f:%l:%c:\ %m,%f:%l:\ %m
+CompilerSet errorformat&
 
 let &cpoptions = s:save_cpoptions
 unlet s:save_cpoptions
index a30355f8558afde3767a8693950a9da9f75d59ae..ca34f105e4be1631a62fd44eaefdf9f47f81dae3 100644 (file)
@@ -2,6 +2,7 @@
 " Language:             vimdoc
 " Maintainer:           Wu, Zhenyu <wuzhenyu@ustc.edu>
 " Latest Revision:      2024-04-13
+" Last Change: 2025 Nov 16 by The Vim Project (set errorformat)
 "
 " If you can not find 'vimdoc' in the package manager of your distribution e.g
 " 'pip', then you may need to build it from its source.
@@ -15,6 +16,8 @@ let s:save_cpoptions = &cpoptions
 set cpoptions&vim
 
 CompilerSet makeprg=vimdoc
+" CompilerSet errorformat=%f:%l:%c:\ %m,%f:%l:\ %m
+CompilerSet errorformat&
 
 let &cpoptions = s:save_cpoptions
 unlet s:save_cpoptions
index 88e2efb27ad9693d8271431abad1c242d7b49bb7..adb1dbdee79f9e8d4256fcdebf0b07d63b2cba9d 100644 (file)
@@ -3,6 +3,7 @@
 " Maintainer:  Romain Lafourcade <romainlafourcade@gmail.com>
 " Last Change: 2021 July 21
 "              2024 Apr 03 by The Vim Project (removed :CompilerSet definition)
+"              2025 Nov 16 by The Vim Project (set errorformat)
 
 if exists("current_compiler")
     finish
@@ -10,4 +11,6 @@ endif
 let current_compiler = "yamllint"
 
 CompilerSet makeprg=yamllint\ -f\ parsable
+" CompilerSet errorformat=%f:%l:%c:\ [%t%*[^]]]\ %m,%f:%l:%c:\ [%*[^]]]\ %m
+CompilerSet errorformat&
 
index 259d0e267b4f558673d88bfeef55c7048c208e01..440eff7885dea7f75e10e278456e8242f07cf51e 100644 (file)
@@ -1,7 +1,7 @@
 " Vim compiler file
 " Compiler: Zig Compiler (zig build-exe)
 " Upstream: https://github.com/ziglang/zig.vim
-" Last Change: 2024 Apr 05 by The Vim Project (removed :CompilerSet definition)
+" Last Change: 2025 Nov 16 by The Vim Project (set errorformat)
 
 if exists('current_compiler')
   finish
@@ -12,11 +12,9 @@ let current_compiler = 'zig_build_exe'
 let s:save_cpo = &cpo
 set cpo&vim
 
-if has('patch-7.4.191')
-  CompilerSet makeprg=zig\ build-exe\ \%:S\ \$* 
-else
-  CompilerSet makeprg=zig\ build-exe\ \"%\"\ \$* 
-endif
+CompilerSet makeprg=zig\ build-exe\ \%:S\ \$*
+" CompilerSet errorformat=%f:%l:%c: %t%*[^:]: %m, %f:%l:%c: %m, %f:%l: %m
+CompilerSet errorformat&
 
 let &cpo = s:save_cpo
 unlet s:save_cpo
index dafeb6f1e3953fa0b2c7943f9251ebcddb1385ab..afe57ad4d3a8ca267b8be741f4f1d02c9139c49d 100644 (file)
@@ -1,7 +1,7 @@
 " Vim compiler file
 " Compiler: Zig Compiler (zig test)
 " Upstream: https://github.com/ziglang/zig.vim
-" Last Change: 2024 Apr 05 by The Vim Project (removed :CompilerSet definition)
+" Last Change: 2025 Nov 16 by The Vim Project (set errorformat)
 
 if exists('current_compiler')
   finish
@@ -12,11 +12,9 @@ let current_compiler = 'zig_test'
 let s:save_cpo = &cpo
 set cpo&vim
 
-if has('patch-7.4.191')
-  CompilerSet makeprg=zig\ test\ \%:S\ \$* 
-else
-  CompilerSet makeprg=zig\ test\ \"%\"\ \$* 
-endif
+CompilerSet makeprg=zig\ test\ \%:S\ \$*
+" CompilerSet errorformat=%f:%l:%c: %t%*[^:]: %m, %f:%l:%c: %m, %f:%l: %m
+CompilerSet errorformat&
 
 let &cpo = s:save_cpo
 unlet s:save_cpo