0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00
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
..
2021-09-21 20:09:51 +02:00
2017-03-05 17:04:09 +01:00
2021-01-25 21:14:57 +01:00
2017-03-05 17:04:09 +01:00
2022-10-28 20:47:54 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2010-01-06 20:54:52 +01:00
2024-11-24 14:30:43 +01:00
2017-03-05 17:04:09 +01:00
2018-12-27 23:59:26 +01:00
2022-09-27 17:30:34 +01:00
2017-03-05 17:04:09 +01:00
2022-06-03 21:59:47 +01:00
2023-06-10 21:40:39 +01:00
2017-03-05 17:04:09 +01:00
2022-09-18 13:04:22 +01:00
2022-03-08 21:35:07 +00:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2012-04-25 19:07:41 +02:00
2014-08-29 15:12:19 +02:00
2021-09-09 21:55:11 +02:00
2017-03-05 17:04:09 +01:00
2022-04-27 15:25:03 +01:00
2017-03-05 17:04:09 +01:00
2022-07-01 18:45:04 +01:00
2021-01-25 21:14:57 +01:00
2007-05-05 18:24:42 +00:00
2022-09-18 13:04:22 +01:00
2023-12-28 23:17:54 +01:00
2022-09-10 13:13:14 +01:00
2010-01-06 20:54:52 +01:00
2022-09-10 13:13:14 +01:00
2022-01-08 21:51:59 +00:00
2010-01-06 20:54:52 +01:00
2021-09-21 20:09:51 +02:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2022-09-27 17:30:34 +01:00
2019-01-01 15:32:17 +01:00
2016-01-10 15:59:26 +01:00
2015-11-01 16:49:04 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2007-05-05 18:24:42 +00:00
2021-12-16 14:41:10 +00:00
2020-08-30 17:20:20 +02:00
2019-12-03 22:49:09 +01:00
2022-09-10 13:13:14 +01:00
2021-08-14 21:25:52 +02:00
2015-01-07 16:57:10 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2023-04-22 22:40:14 +01:00
2023-02-02 13:59:48 +00:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2018-08-11 18:00:22 +02:00
2023-05-14 18:50:25 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2022-04-27 15:25:03 +01:00
2021-09-09 21:55:11 +02:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-11-02 22:58:42 +01:00
2023-04-22 22:40:14 +01:00
2021-10-23 12:08:41 +01:00
2024-09-01 09:21:16 +02:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2022-10-16 13:11:12 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2022-01-29 22:20:48 +00:00
2019-07-19 22:05:51 +02:00
2017-03-05 17:04:09 +01:00
2023-02-27 15:49:53 +00:00
2017-03-05 17:04:09 +01:00
2022-04-27 15:25:03 +01:00
2017-03-05 17:04:09 +01:00
2020-10-26 21:12:46 +01:00
2023-08-23 21:20:00 +02:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2022-10-16 13:11:12 +01:00
2022-07-29 21:36:21 +01:00
2021-01-11 19:40:15 +01:00
2017-03-05 17:04:09 +01:00
2021-09-09 21:55:11 +02:00
2022-06-14 17:41:28 +01:00
2017-03-05 17:04:09 +01:00
2021-09-09 21:55:11 +02:00
2019-01-17 16:07:22 +01:00
2024-07-07 21:07:56 +02:00
2021-10-16 15:23:36 +01:00
2017-03-05 17:04:09 +01:00
2022-06-14 17:41:28 +01:00
2020-08-15 18:55:18 +02:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2023-08-09 16:50:52 +02:00
2017-03-05 17:04:09 +01:00
2023-06-10 21:40:39 +01:00
2022-09-18 13:04:22 +01:00
2014-08-22 19:21:47 +02:00
2022-07-01 18:45:04 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2017-03-05 17:04:09 +01:00
2022-06-14 17:41:28 +01:00

The ftplugin directory is for Vim plugin scripts that are only used for a
specific filetype.

All files ending in .vim in this directory and subdirectories will be sourced
by Vim when it detects the filetype that matches the name of the file or
subdirectory.
For example, these are all loaded for the "c" filetype:

	c.vim
	c_extra.vim
	c/settings.vim

Note that the "_" in "c_extra.vim" is required to separate the filetype name
from the following arbitrary name.

The filetype plugins are only loaded when the ":filetype plugin" command has
been used.

The default filetype plugin files contain settings that 95% of the users will
want to use.  They do not contain personal preferences, like the value of
'shiftwidth'.

If you want to do additional settings, or overrule the default filetype
plugin, you can create your own plugin file.  See ":help ftplugin" in Vim.