vim/runtime/compiler
Aliaksei Budavei 368ef5a48c
patch 9.1.0935: SpotBugs compiler can be improved
Problem:  SpotBugs compiler can be improved
Solution: runtime(compiler): Improve defaults and error handling for
          SpotBugs; update test_compiler.vim (Aliaksei Budavei)

runtime(compiler): Improve defaults and error handling for SpotBugs

* Keep "spotbugs#DefaultPreCompilerTestAction()" defined but
  do not assign its Funcref to the "PreCompilerTestAction"
  key of "g:spotbugs_properties": there are no default and
  there can only be introduced arbitrary "*sourceDirPath"
  entries; therefore, this assignment is confusing at best,
  given that the function's implementation delegates to
  whatever "PreCompilerAction" is.

* Allow for the possibility of relative source pathnames
  passed as arguments to Vim for the Javac default actions,
  and the necessity to have them properly reconciled when
  the current working directory is changed.

* Do not expect users to remember or know that new source
  files ‘must be’ ":argadd"'d to be then known to the Javac
  default actions; so collect the names of Java-file buffers
  and Java-file Vim arguments; and let users providing the
  "@sources" file-lists in the "g:javac_makeprg_params"
  variable update these file-lists themselves.

* Strive to not leave behind a fire-once Syntax ":autocmd"
  for a Java buffer whenever an arbitrary pre-compile action
  errors out.

* Only attempt to run a post-compiler action in the absence
  of failures for a pre-compiler action.  Note that warnings
  and failures are treated alike (?!) by the Javac compiler,
  so when previews are tried out with "--enable-preview",
  remember about passing "-Xlint:-preview" too to also let
  SpotBugs have a go.

* Properly group conditional operators when testing for key
  entries in a user-defined variable.

* Also test whether "javaExternal" is defined when choosing
  an implementation for source-file parsing.

* Two commands are provided to toggle actions for buffer-local
  autocommands:
  - SpotBugsRemoveBufferAutocmd;
  - SpotBugsDefineBufferAutocmd.

For example, try this from "~/.vim/after/ftplugin/java.vim":
------------------------------------------------------------
if exists(':SpotBugsDefineBufferAutocmd') == 2
	SpotBugsDefineBufferAutocmd BufWritePost SigUSR1
endif
------------------------------------------------------------

And ":doautocmd java_spotbugs User" can be manually used at will.

closes: #16140

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-16 21:38:47 +01:00
..
ant.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
bcc.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
bdf.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
cargo.vim runtime: Remove more fallback :CompilerSet definitions from compiler plugins (#14413) 2024-04-05 19:59:39 +02:00
checkstyle.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
cm3.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
context.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
cppcheck.vim runtime(compiler): fix escaping of arguments passed to :CompilerSet 2024-11-19 22:41:14 +01:00
cs.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
csslint.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
cucumber.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
dart.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
dart2js.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
dart2native.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
dartanalyser.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
dartdevc.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
dartdoc.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
dartfmt.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
decada.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
dot.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
dotnet.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
erlang.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
eruby.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
eslint.vim runtime(compiler): update eslint compiler 2024-11-30 11:05:18 +01:00
fbc.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
fortran_cv.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
fortran_elf90.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
fortran_F.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
fortran_g77.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
fortran_lf95.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
fpc.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
g95.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
gawk.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
gcc.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
gfortran.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
ghc.vim Updated runtime files. 2016-12-01 22:57:02 +01:00
gjs.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
gm2.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
gnat.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
go.vim runtime: Remove more fallback :CompilerSet definitions from compiler plugins (#14413) 2024-04-05 19:59:39 +02:00
groff.vim runtime(compiler): fix escaping of arguments passed to :CompilerSet 2024-11-19 22:41:14 +01:00
haml.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
hare.vim patch 9.1.0442: hare runtime files outdated 2024-05-24 08:05:00 +02:00
hp_acc.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
icc.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
icon.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
ifort.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
intel.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
irix5_c.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
irix5_cpp.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
javac.vim runtime(compiler): include spotbugs Java linter 2024-11-28 21:06:09 +01:00
jest.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
jikes.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
jjs.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
jq.vim runtime(jq): include syntax, ftplugin and compiler plugin 2024-04-26 22:39:41 +02:00
jshint.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
jsonlint.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
make.vim runtime(make): add compiler/make.vim to reset compiler plugin settings 2024-09-10 21:11:28 +02:00
maven.vim runtime(compiler): include spotbugs Java linter 2024-11-28 21:06:09 +01:00
mcs.vim runtime: Remove more fallback :CompilerSet definitions from compiler plugins (#14413) 2024-04-05 19:59:39 +02:00
mips_c.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
mipspro_c89.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
mipspro_cpp.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
modelsim_vcom.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
msbuild.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
msvc.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
mypy.vim runtime(compiler): fix escaping of arguments passed to :CompilerSet 2024-11-19 22:41:14 +01:00
neato.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
ocaml.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
onsgmls.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
pandoc.vim runtime(compiler): fix escaping of arguments passed to :CompilerSet 2024-11-19 22:41:14 +01:00
pbx.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
perl.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
perlcritic.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
php.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
pip_compile.vim patch 9.1.0326: filetype: some requirements files are not recognized 2024-04-14 20:43:27 +02:00
podchecker.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
powershell.vim runtime(compiler): fix escaping of arguments passed to :CompilerSet 2024-11-19 22:41:14 +01:00
pylint.vim runtime(compiler): fix escaping of arguments passed to :CompilerSet 2024-11-19 22:41:14 +01:00
pytest.vim patch 9.1.0898: runtime(compiler): pytest compiler not included 2024-11-30 11:32:49 +01:00
pyunit.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
raco.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
racomake.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
racosetup.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
racotest.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
rake.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
README.txt runtime(make): add compiler/make.vim to reset compiler plugin settings 2024-09-10 21:11:28 +02:00
rhino.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
rime_deployer.vim compiler(rime_deployer): include new compiler, use it for '*.custom.yaml' files (#14460) 2024-04-14 20:28:29 +02:00
rspec.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
rst.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
rubocop.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
ruby.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
rubyunit.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
ruff.vim runtime(compiler): fix escaping of arguments passed to :CompilerSet 2024-11-19 22:41:14 +01:00
rustc.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
sass.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
scdoc.vim runtime: Remove more fallback :CompilerSet definitions from compiler plugins (#14413) 2024-04-05 19:59:39 +02:00
se.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
shellcheck.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
sml.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
spectral.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
splint.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
spotbugs.vim patch 9.1.0935: SpotBugs compiler can be improved 2024-12-16 21:38:47 +01:00
stack.vim Update runtime files. 2018-09-02 21:07:30 +02:00
standard.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
stylelint.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
tcl.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
tex.vim runtime(compiler): fix escaping of arguments passed to :CompilerSet 2024-11-19 22:41:14 +01:00
tidy.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
ts-node.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
tsc.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
typedoc.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
typst.vim runtime(typst): add definition lists to formatlistpat, update maintainer 2024-12-09 20:31:04 +01:00
vimdoc.vim runtime(vim): don't set compiler, update a comment for vimdoc compiler (#14532) 2024-04-14 20:20:01 +02:00
xbuild.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
xmllint.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
xmlwf.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
xo.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
yamllint.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
zig.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00
zig_build.vim runtime: Remove more fallback :CompilerSet definitions from compiler plugins (#14413) 2024-04-05 19:59:39 +02:00
zig_build_exe.vim runtime: Remove more fallback :CompilerSet definitions from compiler plugins (#14413) 2024-04-05 19:59:39 +02:00
zig_test.vim runtime: Remove more fallback :CompilerSet definitions from compiler plugins (#14413) 2024-04-05 19:59:39 +02:00
zsh.vim runtime: Remove fallback :CompilerSet definition from compiler plugins 2024-04-04 22:00:58 +02:00

This directory contains Vim scripts to be used with a specific compiler.
They are used with the ":compiler" command.

These scripts usually set options, for example 'errorformat'.
See ":help write-compiler-plugin".

To undo the effect of a compiler plugin, use the make compiler plugin.

If you want to write your own compiler plugin, have a look at the other files
for how to do it, the format is simple.

If you think a compiler plugin you have written is useful for others, please
send it to the vim-dev mailing list: <vim-dev@vim.org>