]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0225: runtime(compiler): No compiler plugin for just v9.2.0225
authorAditya Malik <adityamalik2833@gmail.com>
Sun, 22 Mar 2026 16:46:41 +0000 (16:46 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 22 Mar 2026 16:46:41 +0000 (16:46 +0000)
Problem:  runtime(compiler): No compiler plugin for just
Solution: Add a compiler plugin for the just command runner, add a test
          (Aditya Malik)

Sets makeprg and a custom errorformat to parse just's multi-line
error output into quickfix entries with file, line, column, and
message. Includes a test.

Reference:
- https://github.com/casey/just

closes: #19773

Signed-off-by: Aditya Malik <adityamalik2833@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
.github/MAINTAINERS
runtime/compiler/just.vim [new file with mode: 0644]
src/testdir/test_compiler.vim
src/version.c

index 6d51dea175b76ac745c54bf7668132834a0c04cf..cd965f76744c554df266d2c571c4eace07563052 100644 (file)
@@ -80,6 +80,7 @@ runtime/compiler/jjs.vim                              @dkearns
 runtime/compiler/jq.vim                                        @vito-c
 runtime/compiler/jshint.vim                            @dkearns
 runtime/compiler/jsonlint.vim                          @dkearns
+runtime/compiler/just.vim                              @Alarcritty
 runtime/compiler/make.vim                              @Konfekt
 runtime/compiler/mypy.vim                              @Konfekt
 runtime/compiler/pandoc.vim                            @Konfekt
diff --git a/runtime/compiler/just.vim b/runtime/compiler/just.vim
new file mode 100644 (file)
index 0000000..9dd7dfd
--- /dev/null
@@ -0,0 +1,23 @@
+" Vim compiler file
+" Compiler:    Just
+" Maintainer:  Alarcritty
+" Last Change: 2026 Mar 20
+
+if exists("current_compiler")
+  finish
+endif
+let current_compiler = "just"
+
+let s:cpo_save = &cpo
+set cpo-=C
+
+CompilerSet makeprg=just
+
+CompilerSet errorformat=
+      \%Eerror:\ %m,
+      \%C%\\s%#——▶\ %f:%l:%c,
+      \%-C%.%#,
+      \%-G%.%#
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
index d28349a70ca2dcd8138d71ed8b053833ec881e9f..20cae989444a48c85881a2f69db932f6957d1cb3 100644 (file)
@@ -734,4 +734,35 @@ func Test_compiler_spotbugs_properties()
   let &shellslash = save_shellslash
 endfunc
 
+func Test_compiler_just()
+  CheckFeature quickfix
+
+  compiler just
+  call assert_equal('just', b:current_compiler)
+  call assert_equal('just', &makeprg)
+  let verbose_efm = execute('verbose set efm')
+  call assert_match('Last set from .*[/\\]compiler[/\\]just.vim ', verbose_efm)
+
+  " Test that the errorformat can parse just error output
+  let lines =<< trim END
+    error: Variable `name` not defined
+      ——▶ justfile:2:15
+       │
+     2 │   echo {{name}}
+       │          ^^^^
+  END
+  call writefile(lines, 'Xjusterr.txt')
+  cgetfile Xjusterr.txt
+  let l = getqflist()
+  call assert_equal(1, len(l))
+  call assert_equal('E', l[0].type)
+  call assert_equal('Variable `name` not defined', l[0].text)
+  call assert_equal(2, l[0].lnum)
+  call assert_equal(15, l[0].col)
+
+  call setqflist([])
+  call delete('Xjusterr.txt')
+  compiler make
+endfunc
+
 " vim: shiftwidth=2 sts=2 expandtab
index f16dd8d62e48f7b7c271534291502630cb5b2b06..5b2396b3cd7d212c62611b3c364b6ac7d9dc3c69 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    225,
 /**/
     224,
 /**/