Skip to content

Commit ebe43f7

Browse files
authored
Merge pull request #1851 from h-east/update-quickfix
Update quickfix.{txt,jax}
2 parents a15d9a6 + 7cd9bd5 commit ebe43f7

File tree

2 files changed

+220
-7
lines changed

2 files changed

+220
-7
lines changed

doc/quickfix.jax

Lines changed: 110 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*quickfix.txt* For Vim バージョン 9.1. Last change: 2024 Nov 12
1+
*quickfix.txt* For Vim バージョン 9.1. Last change: 2024 Nov 28
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -1282,11 +1282,117 @@ g:compiler_gcc_ignore_unmatched_lines
12821282

12831283
JAVAC *compiler-javac*
12841284

1285-
よく使用されるコンパイラオプションは、g:javac_makeprg_params 変数を設定するこ
1286-
とで 'makeprg' に追加できる。例: >
1285+
よく使用されるコンパイラオプションは、b/g:javac_makeprg_params 変数を設定する
1286+
ことで 'makeprg' に追加できる。例: >
12871287
12881288
let g:javac_makeprg_params = "-Xlint:all -encoding utf-8"
1289-
<
1289+
1290+
MAVEN *compiler-maven*
1291+
1292+
よく使用されるコンパイラオプションは、b/g:maven_makeprg_params 変数を設定する
1293+
ことで 'makeprg' に追加できる。例: >
1294+
1295+
let g:maven_makeprg_params = "-DskipTests -U -X"
1296+
1297+
SPOTBUGS *compiler-spotbugs*
1298+
1299+
SpotBugs は、Java のバグを見つけるために使用できる静的解析ツールである。現在開
1300+
いているバッファ内のすべてのクラスの Java バイトコードをスキャンする。(したがっ
1301+
て、`:compiler! spotbugs` はサポートされていない。)
1302+
1303+
よく使用されるコンパイラオプションは、"b:" または "g:spotbugs_makeprg_params"
1304+
変数を設定することで 'makeprg' に追加できる。例: >
1305+
1306+
let b:spotbugs_makeprg_params = "-longBugCodes -effort:max -low"
1307+
1308+
グローバルのデフォルトは "-workHard -experimental" である。
1309+
1310+
デフォルトでは、クラスファイルはソースファイルが配置されているディレクトリで検
1311+
索される。ただし、一般的な Java プロジェクトでは、ソースファイルとクラスファイ
1312+
ルに別々のディレクトリを使用する。両方を SpotBugs に認識させるには、それらのパ
1313+
ス (共通のルートディレクトリに対して異なる相対パス) を次のプロパティに割り当て
1314+
る (一般的な Maven プロジェクトの例を使用): >
1315+
1316+
let g:spotbugs_properties = {
1317+
\ 'sourceDirPath': 'src/main/java',
1318+
\ 'classDirPath': 'target/classes',
1319+
\ 'testSourceDirPath': 'src/test/java',
1320+
\ 'testClassDirPath': 'target/test-classes',
1321+
\ }
1322+
1323+
Note パスのキー値は、SpotBugs がファイルを検索する場所のみを記述することに注
1324+
意。詳細については、特定のコンパイラプラグインのドキュメントを参照。
1325+
1326+
Ant、Maven、および Javac コンパイラプラグインには、デフォルトのプリコンパイラ
1327+
アクションとポストコンパイラアクションが用意されており、コンパイラプラグインの
1328+
名前を "compiler" キーに割り当てることで選択できる: >
1329+
1330+
let g:spotbugs_properties = {
1331+
\ 'compiler': 'maven',
1332+
\ }
1333+
1334+
この単一の設定は、基本的に以下のすべての設定と同等だが、"PreCompilerAction" お
1335+
よび "PreCompilerTestAction" の値は例外である。リストされている |Funcref|
1336+
no-op 実装を取得するが、"compiler" キーの暗黙的な Funcref は、使用可能な場合は
1337+
要求されたデフォルトを取得する。 >
1338+
1339+
let g:spotbugs_properties = {
1340+
\ 'PreCompilerAction':
1341+
\ function('spotbugs#DefaultPreCompilerAction'),
1342+
\ 'PreCompilerTestAction':
1343+
\ function('spotbugs#DefaultPreCompilerTestAction'),
1344+
\ 'PostCompilerAction':
1345+
\ function('spotbugs#DefaultPostCompilerAction'),
1346+
\ 'sourceDirPath': 'src/main/java',
1347+
\ 'classDirPath': 'target/classes',
1348+
\ 'testSourceDirPath': 'src/test/java',
1349+
\ 'testClassDirPath': 'target/test-classes',
1350+
\ }
1351+
1352+
デフォルトのアクションでは、選択されたコンパイラは Java 構文ファイルがロードさ
1353+
れるとすぐにバッファのクラスファイル (おそらくプロジェクト全体) を再構築しよう
1354+
とする。次に、`spotbugs` はバッファのコンパイルユニットの品質を分析しようとす
1355+
る。
1356+
1357+
デフォルトのアクションが目的のワークフローに適していない場合は、任意の関数を自
1358+
分で作成し、その |Funcref| をサポートされているキー "PreCompilerAction"、
1359+
"PreCompilerTestAction"、および "PostCompilerAction" と一致させることを検討す
1360+
ること。
1361+
1362+
次の例では、Maven プロジェクトのデフォルトのプリコンパイラアクションを再実装
1363+
し、"compiler" エントリを使用して他のデフォルトの Maven 設定を要求する: >
1364+
1365+
function! MavenPreCompilerAction() abort
1366+
call spotbugs#DeleteClassFiles()
1367+
compiler maven
1368+
make compile
1369+
endfunction
1370+
1371+
function! MavenPreCompilerTestAction() abort
1372+
call spotbugs#DeleteClassFiles()
1373+
compiler maven
1374+
make test-compile
1375+
endfunction
1376+
1377+
let g:spotbugs_properties = {
1378+
\ 'compiler': 'maven',
1379+
\ 'PreCompilerAction':
1380+
\ function('MavenPreCompilerAction'),
1381+
\ 'PreCompilerTestAction':
1382+
\ function('MavenPreCompilerTestAction'),
1383+
\ }
1384+
1385+
Note 入力されたすべてのカスタム設定は、"g:spotbugs_properties" 内の一致するデ
1386+
フォルト設定よりも優先されることに注意。
1387+
1388+
"g:spotbugs_properties" 変数は、Java ファイルタイププラグイン
1389+
(|ft-java-plugin|) によって参照され、説明されている自動化を調整する。したがっ
1390+
て、Java ソースファイルがロードされたバッファに対して |FileType| イベントが発
1391+
生する前に定義する必要がある。例えば、[0] によってロードされるプロジェクトロー
1392+
カルの |vimrc| で設定できる。
1393+
1394+
[0] https://github.com/MarcWeber/vim-addon-local-vimrc/
1395+
12901396
GNU MAKE *compiler-make*
12911397

12921398
デフォルトの make プログラムは "make" であるため、make のコンパイラプラグイ

en/quickfix.txt

Lines changed: 110 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*quickfix.txt* For Vim version 9.1. Last change: 2024 Nov 12
1+
*quickfix.txt* For Vim version 9.1. Last change: 2024 Nov 28
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1331,10 +1331,117 @@ g:compiler_gcc_ignore_unmatched_lines
13311331
JAVAC *compiler-javac*
13321332

13331333
Commonly used compiler options can be added to 'makeprg' by setting the
1334-
g:javac_makeprg_params variable. For example: >
1334+
b/g:javac_makeprg_params variable. For example: >
13351335
13361336
let g:javac_makeprg_params = "-Xlint:all -encoding utf-8"
1337-
<
1337+
1338+
MAVEN *compiler-maven*
1339+
1340+
Commonly used compiler options can be added to 'makeprg' by setting the
1341+
b/g:maven_makeprg_params variable. For example: >
1342+
1343+
let g:maven_makeprg_params = "-DskipTests -U -X"
1344+
1345+
SPOTBUGS *compiler-spotbugs*
1346+
1347+
SpotBugs is a static analysis tool that can be used to find bugs in Java.
1348+
It scans the Java bytecode of all classes in the currently open buffer.
1349+
(Therefore, `:compiler! spotbugs` is not supported.)
1350+
1351+
Commonly used compiler options can be added to 'makeprg' by setting the
1352+
"b:" or "g:spotbugs_makeprg_params" variable. For example: >
1353+
1354+
let b:spotbugs_makeprg_params = "-longBugCodes -effort:max -low"
1355+
1356+
The global default is "-workHard -experimental".
1357+
1358+
By default, the class files are searched in the directory where the source
1359+
files are placed. However, typical Java projects use distinct directories
1360+
for source files and class files. To make both known to SpotBugs, assign
1361+
their paths (distinct and relative to their common root directory) to the
1362+
following properties (using the example of a common Maven project): >
1363+
1364+
let g:spotbugs_properties = {
1365+
\ 'sourceDirPath': 'src/main/java',
1366+
\ 'classDirPath': 'target/classes',
1367+
\ 'testSourceDirPath': 'src/test/java',
1368+
\ 'testClassDirPath': 'target/test-classes',
1369+
\ }
1370+
1371+
Note that values for the path keys describe only for SpotBugs where to look
1372+
for files; refer to the documentation for particular compiler plugins for more
1373+
information.
1374+
1375+
The default pre- and post-compiler actions are provided for Ant, Maven, and
1376+
Javac compiler plugins and can be selected by assigning the name of a compiler
1377+
plugin to the "compiler" key: >
1378+
1379+
let g:spotbugs_properties = {
1380+
\ 'compiler': 'maven',
1381+
\ }
1382+
1383+
This single setting is essentially equivalent to all the settings below, with
1384+
the exception made for the "PreCompilerAction" and "PreCompilerTestAction"
1385+
values: their listed |Funcref|s will obtain no-op implementations whereas the
1386+
implicit Funcrefs of the "compiler" key will obtain the requested defaults if
1387+
available. >
1388+
1389+
let g:spotbugs_properties = {
1390+
\ 'PreCompilerAction':
1391+
\ function('spotbugs#DefaultPreCompilerAction'),
1392+
\ 'PreCompilerTestAction':
1393+
\ function('spotbugs#DefaultPreCompilerTestAction'),
1394+
\ 'PostCompilerAction':
1395+
\ function('spotbugs#DefaultPostCompilerAction'),
1396+
\ 'sourceDirPath': 'src/main/java',
1397+
\ 'classDirPath': 'target/classes',
1398+
\ 'testSourceDirPath': 'src/test/java',
1399+
\ 'testClassDirPath': 'target/test-classes',
1400+
\ }
1401+
1402+
With default actions, the compiler of choice will attempt to rebuild the class
1403+
files for the buffer (and possibly for the whole project) as soon as a Java
1404+
syntax file is loaded; then, `spotbugs` will attempt to analyze the quality of
1405+
the compilation unit of the buffer.
1406+
1407+
When default actions are not suited to a desired workflow, consider writing
1408+
arbitrary functions yourself and matching their |Funcref|s to the supported
1409+
keys: "PreCompilerAction", "PreCompilerTestAction", and "PostCompilerAction".
1410+
1411+
The next example re-implements the default pre-compiler actions for a Maven
1412+
project and requests other default Maven settings with the "compiler" entry: >
1413+
1414+
function! MavenPreCompilerAction() abort
1415+
call spotbugs#DeleteClassFiles()
1416+
compiler maven
1417+
make compile
1418+
endfunction
1419+
1420+
function! MavenPreCompilerTestAction() abort
1421+
call spotbugs#DeleteClassFiles()
1422+
compiler maven
1423+
make test-compile
1424+
endfunction
1425+
1426+
let g:spotbugs_properties = {
1427+
\ 'compiler': 'maven',
1428+
\ 'PreCompilerAction':
1429+
\ function('MavenPreCompilerAction'),
1430+
\ 'PreCompilerTestAction':
1431+
\ function('MavenPreCompilerTestAction'),
1432+
\ }
1433+
1434+
Note that all entered custom settings will take precedence over the matching
1435+
default settings in "g:spotbugs_properties".
1436+
1437+
The "g:spotbugs_properties" variable is consulted by the Java filetype plugin
1438+
(|ft-java-plugin|) to arrange for the described automation, and, therefore, it
1439+
must be defined before |FileType| events can take place for the buffers loaded
1440+
with Java source files. It could, for example, be set in a project-local
1441+
|vimrc| loaded by [0].
1442+
1443+
[0] https://github.com/MarcWeber/vim-addon-local-vimrc/
1444+
13381445
GNU MAKE *compiler-make*
13391446

13401447
Since the default make program is "make", the compiler plugin for make,

0 commit comments

Comments
 (0)