aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-12-28 07:32:08 +0800
committerzeertzjq <zeertzjq@outlook.com>2025-02-04 06:45:25 +0800
commit89c294514853ee4849855f880d6d7ff349494c4d (patch)
treec9e47794be4f9f2c0afc1f43b0d6dbfb5832f8df /runtime/doc
parentd7426bc9e99a44e5c79a3645aa74fc2a300e3ae6 (diff)
downloadrneovim-89c294514853ee4849855f880d6d7ff349494c4d.tar.gz
rneovim-89c294514853ee4849855f880d6d7ff349494c4d.tar.bz2
rneovim-89c294514853ee4849855f880d6d7ff349494c4d.zip
vim-patch:9.1.0967: SpotBugs compiler setup can be further improved
Problem: SpotBugs compiler can be further improved Solution: Introduce event-driven primitives for SpotBugs (Aliaksei Budavei) closes: vim/vim#16258 https://github.com/vim/vim/commit/2e252474c4df5018b9819d86ebb70bf3b1b1a1af Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Diffstat (limited to 'runtime/doc')
-rw-r--r--runtime/doc/quickfix.txt64
1 files changed, 64 insertions, 0 deletions
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt
index e56de9c1b4..7aeb494437 100644
--- a/runtime/doc/quickfix.txt
+++ b/runtime/doc/quickfix.txt
@@ -1410,6 +1410,70 @@ of |:make|, and assigning its |Funcref| to the selected key. For example:
\ function('GenericPostCompilerCommand'),
\ }
+When "PostCompilerAction" is available, "PostCompilerActionExecutor" is also
+supported. Its value must be a Funcref pointing to a function that always
+declares a single parameter of type string and decides whether |:execute| can
+be dispatched on its argument, containing a pending post-compiler action,
+after ascertaining the current status of |:cc| (or |:ll|): >vim
+
+ function! GenericPostCompilerActionExecutor(action) abort
+ try
+ cc
+ catch /\<E42:/
+ execute a:action
+ endtry
+ endfunction
+
+Complementary, some or all of the available "Pre*Action"s (or "*Pre*Command"s)
+may run `:doautocmd java_spotbugs_post User` in their implementations before
+|:make| (or its equivalent) to define a once-only |ShellCmdPost| `:autocmd`
+that will arrange for "PostCompilerActionExecutor" to be invoked; and then run
+`:doautocmd java_spotbugs_post ShellCmdPost` to consume this event: >vim
+
+ function! GenericPreCompilerCommand(arguments) abort
+ if !exists('g:spotbugs_compilation_done')
+ doautocmd java_spotbugs_post User
+ execute 'make ' . a:arguments
+ " only run doautocmd when :make was synchronous
+ " see note below
+ doautocmd java_spotbugs_post ShellCmdPost " XXX: (a)
+ let g:spotbugs_compilation_done = 1
+ else
+ cc
+ endif
+ endfunction
+
+ function! GenericPreCompilerTestCommand(arguments) abort
+ if !exists('g:spotbugs_test_compilation_done')
+ doautocmd java_spotbugs_post User
+ execute 'make ' . a:arguments
+ " only run doautocmd when :make was synchronous
+ " see note below
+ doautocmd java_spotbugs_post ShellCmdPost " XXX: (b)
+ let g:spotbugs_test_compilation_done = 1
+ else
+ cc
+ endif
+ endfunction
+
+ let g:spotbugs_properties = {
+ \ 'compiler': 'maven',
+ \ 'DefaultPreCompilerCommand':
+ \ function('GenericPreCompilerCommand'),
+ \ 'DefaultPreCompilerTestCommand':
+ \ function('GenericPreCompilerTestCommand'),
+ \ 'PostCompilerActionExecutor':
+ \ function('GenericPostCompilerActionExecutor'),
+ \ }
+
+If a command equivalent of `:make` is capable of asynchronous execution and
+consuming `ShellCmdPost` events, `:doautocmd java_spotbugs_post ShellCmdPost`
+must be removed from such "*Action" (or "*Command") implementations (i.e. the
+lines `(a)` and `(b)` in the listed examples) to retain a sequential order for
+non-blocking execution, and any notification (see below) must be suppressed.
+A `ShellCmdPost` `:autocmd` can be associated with any |:augroup| by assigning
+its name to the "augroupForPostCompilerAction" key.
+
When default actions are not suited to a desired workflow, proceed by writing
arbitrary functions yourself and matching their Funcrefs to the supported
keys: "PreCompilerAction", "PreCompilerTestAction", and "PostCompilerAction".