Skip to content

Commit 0753222

Browse files
authored
Merge pull request #1899 from h-east/update-quickfix
Update quickfix.{txt,jax}
2 parents e194e26 + 3e51220 commit 0753222

File tree

2 files changed

+130
-2
lines changed

2 files changed

+130
-2
lines changed

doc/quickfix.jax

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*quickfix.txt* For Vim バージョン 9.1. Last change: 2024 Dec 16
1+
*quickfix.txt* For Vim バージョン 9.1. Last change: 2024 Dec 27
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -1374,6 +1374,70 @@ Vim コマンドは 'makeprg' [0] に習熟していると、デフォルトア
13741374
\ function('GenericPostCompilerCommand'),
13751375
\ }
13761376

1377+
"PostCompilerAction" が利用可能な場合、"PostCompilerActionExecutor" もサポート
1378+
される。その値は、常に文字列型の単一のパラメータを宣言し、|:cc| (または |:ll|)
1379+
の現在のステータスを確認した後、保留中のポストコンパイラアクションを含む
1380+
|:execute| をその引数にディスパッチできるかどうかを決定する関数を指す Funcref
1381+
である必要がある: >vim
1382+
1383+
function! GenericPostCompilerActionExecutor(action) abort
1384+
try
1385+
cc
1386+
catch /\<E42:/
1387+
execute a:action
1388+
endtry
1389+
endfunction
1390+
1391+
補足として、利用可能な "Pre*Action" (または "*Pre*Command") の一部またはすべて
1392+
|:make| (または同等のもの) の前に実装内で `:doautocmd java_spotbugs_post
1393+
User` を実行して、一度だけ実行される |ShellCmdPost| `:autocmd` を定義し、
1394+
"PostCompilerActionExecutor" が呼び出されるように手配する。その後、このイベン
1395+
トを使用するために `:doautocmd java_spotbugs_post ShellCmdPost` を実行する:
1396+
>vim
1397+
function! GenericPreCompilerCommand(arguments) abort
1398+
if !exists('g:spotbugs_compilation_done')
1399+
doautocmd java_spotbugs_post User
1400+
execute 'make ' . a:arguments
1401+
" :make が同期している場合にのみ doautocmd を実行する。
1402+
" 下記の注記を参照
1403+
doautocmd java_spotbugs_post ShellCmdPost " XXX: (a)
1404+
let g:spotbugs_compilation_done = 1
1405+
else
1406+
cc
1407+
endif
1408+
endfunction
1409+
1410+
function! GenericPreCompilerTestCommand(arguments) abort
1411+
if !exists('g:spotbugs_test_compilation_done')
1412+
doautocmd java_spotbugs_post User
1413+
execute 'make ' . a:arguments
1414+
" :make が同期している場合にのみ doautocmd を実行する。
1415+
" 下記の注記を参照
1416+
doautocmd java_spotbugs_post ShellCmdPost " XXX: (b)
1417+
let g:spotbugs_test_compilation_done = 1
1418+
else
1419+
cc
1420+
endif
1421+
endfunction
1422+
1423+
let g:spotbugs_properties = {
1424+
\ 'compiler': 'maven',
1425+
\ 'DefaultPreCompilerCommand':
1426+
\ function('GenericPreCompilerCommand'),
1427+
\ 'DefaultPreCompilerTestCommand':
1428+
\ function('GenericPreCompilerTestCommand'),
1429+
\ 'PostCompilerActionExecutor':
1430+
\ function('GenericPostCompilerActionExecutor'),
1431+
\ }
1432+
1433+
`:make` に相当するコマンドが非同期実行が可能で `ShellCmdPost` イベントを消費で
1434+
きる場合、非ブロッキング実行の順序を維持するために
1435+
`:doautocmd java_spotbugs_post ShellCmdPost` をそのような "*Action" (または
1436+
"*Command") 実装 (つまり、リストされている例の `(a)``(b)` の行) から削除
1437+
し、通知 (以下を参照) を抑制する必要がある。
1438+
`ShellCmdPost` `:autocmd` は、その名前を "augroupForPostCompilerAction" キーに
1439+
割り当てることで、任意の |:augroup| に関連付けることができる。
1440+
13771441
デフォルトのアクションが目的のワークフローに適していない場合は、任意の関数を自
13781442
分で記述し、その Funcref をサポートされているキー "PreCompilerAction"、
13791443
"PreCompilerTestAction"、および "PostCompilerAction" に一致させて続行する。

en/quickfix.txt

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*quickfix.txt* For Vim version 9.1. Last change: 2024 Dec 16
1+
*quickfix.txt* For Vim version 9.1. Last change: 2024 Dec 27
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1424,6 +1424,70 @@ of |:make|, and assigning its |Funcref| to the selected key. For example:
14241424
\ function('GenericPostCompilerCommand'),
14251425
\ }
14261426

1427+
When "PostCompilerAction" is available, "PostCompilerActionExecutor" is also
1428+
supported. Its value must be a Funcref pointing to a function that always
1429+
declares a single parameter of type string and decides whether |:execute| can
1430+
be dispatched on its argument, containing a pending post-compiler action,
1431+
after ascertaining the current status of |:cc| (or |:ll|): >vim
1432+
1433+
function! GenericPostCompilerActionExecutor(action) abort
1434+
try
1435+
cc
1436+
catch /\<E42:/
1437+
execute a:action
1438+
endtry
1439+
endfunction
1440+
1441+
Complementary, some or all of the available "Pre*Action"s (or "*Pre*Command"s)
1442+
may run `:doautocmd java_spotbugs_post User` in their implementations before
1443+
|:make| (or its equivalent) to define a once-only |ShellCmdPost| `:autocmd`
1444+
that will arrange for "PostCompilerActionExecutor" to be invoked; and then run
1445+
`:doautocmd java_spotbugs_post ShellCmdPost` to consume this event: >vim
1446+
1447+
function! GenericPreCompilerCommand(arguments) abort
1448+
if !exists('g:spotbugs_compilation_done')
1449+
doautocmd java_spotbugs_post User
1450+
execute 'make ' . a:arguments
1451+
" only run doautocmd when :make was synchronous
1452+
" see note below
1453+
doautocmd java_spotbugs_post ShellCmdPost " XXX: (a)
1454+
let g:spotbugs_compilation_done = 1
1455+
else
1456+
cc
1457+
endif
1458+
endfunction
1459+
1460+
function! GenericPreCompilerTestCommand(arguments) abort
1461+
if !exists('g:spotbugs_test_compilation_done')
1462+
doautocmd java_spotbugs_post User
1463+
execute 'make ' . a:arguments
1464+
" only run doautocmd when :make was synchronous
1465+
" see note below
1466+
doautocmd java_spotbugs_post ShellCmdPost " XXX: (b)
1467+
let g:spotbugs_test_compilation_done = 1
1468+
else
1469+
cc
1470+
endif
1471+
endfunction
1472+
1473+
let g:spotbugs_properties = {
1474+
\ 'compiler': 'maven',
1475+
\ 'DefaultPreCompilerCommand':
1476+
\ function('GenericPreCompilerCommand'),
1477+
\ 'DefaultPreCompilerTestCommand':
1478+
\ function('GenericPreCompilerTestCommand'),
1479+
\ 'PostCompilerActionExecutor':
1480+
\ function('GenericPostCompilerActionExecutor'),
1481+
\ }
1482+
1483+
If a command equivalent of `:make` is capable of asynchronous execution and
1484+
consuming `ShellCmdPost` events, `:doautocmd java_spotbugs_post ShellCmdPost`
1485+
must be removed from such "*Action" (or "*Command") implementations (i.e. the
1486+
lines `(a)` and `(b)` in the listed examples) to retain a sequential order for
1487+
non-blocking execution, and any notification (see below) must be suppressed.
1488+
A `ShellCmdPost` `:autocmd` can be associated with any |:augroup| by assigning
1489+
its name to the "augroupForPostCompilerAction" key.
1490+
14271491
When default actions are not suited to a desired workflow, proceed by writing
14281492
arbitrary functions yourself and matching their Funcrefs to the supported
14291493
keys: "PreCompilerAction", "PreCompilerTestAction", and "PostCompilerAction".

0 commit comments

Comments
 (0)