]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/doc/ale-java.txt

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit 'd49e95aa7ba744f0a7f544aca43afdb6aab41f24' as '.vim/bundle/asyncomplete...
[etc/vim.git] / .vim / bundle / ale / doc / ale-java.txt
1 ===============================================================================
2 ALE Java Integration                                         *ale-java-options*
3
4
5 ===============================================================================
6 checkstyle                                                *ale-java-checkstyle*
7
8                                            *ale-options.java_checkstyle_config*
9                                                  *g:ale_java_checkstyle_config*
10                                                  *b:ale_java_checkstyle_config*
11 java_checkstyle_config
12 g:ale_java_checkstyle_config
13   Type: |String|
14   Default: `'/google_checks.xml'`
15
16   A path to a checkstyle configuration file.
17
18   If a configuration file is specified with |g:ale_java_checkstyle_options|,
19   it will be preferred over this setting.
20
21   The path to the configuration file can be an absolute path or a relative
22   path. ALE will search for the relative path in parent directories.
23
24                                        *ale-options.java_checkstyle_executable*
25                                              *g:ale_java_checkstyle_executable*
26                                              *b:ale_java_checkstyle_executable*
27 java_checkstyle_executable
28 g:ale_java_checkstyle_executable
29   Type: |String|
30   Default: `'checkstyle'`
31
32   This variable can be changed to modify the executable used for checkstyle.
33
34                                           *ale-options.java_checkstyle_options*
35                                                 *g:ale_java_checkstyle_options*
36                                                 *b:ale_java_checkstyle_options*
37 java_checkstyle_options
38 g:ale_java_checkstyle_options
39   Type: |String|
40   Default: `''`
41
42   This variable can be changed to modify flags given to checkstyle.
43
44   If a configuration file is specified with `-c`, it will be used instead of
45   configuration files set with |g:ale_java_checkstyle_config|.
46
47
48 ===============================================================================
49 clang-format                                             *ale-java-clangformat*
50
51 See |ale-c-clangformat| for information about the available options.
52 Note that the C options are also used for Java.
53
54
55 ===============================================================================
56 cspell                                                        *ale-java-cspell*
57
58 See |ale-cspell-options|
59
60
61 ===============================================================================
62 javac                                                          *ale-java-javac*
63
64                                              *ale-options.java_javac_classpath*
65                                                    *g:ale_java_javac_classpath*
66                                                    *b:ale_java_javac_classpath*
67 java_javac_classpath
68 g:ale_java_javac_classpath
69   Type: |String| or |List|
70   Default: `''`
71
72   This variable can be set to change the global classpath for Java.
73
74                                             *ale-options.java_javac_executable*
75                                                   *g:ale_java_javac_executable*
76                                                   *b:ale_java_javac_executable*
77 java_javac_executable
78 g:ale_java_javac_executable
79   Type: |String|
80   Default: `'javac'`
81
82   This variable can be set to change the executable path used for javac.
83
84                                                *ale-options.java_javac_options*
85                                                      *g:ale_java_javac_options*
86                                                      *b:ale_java_javac_options*
87 java_javac_options
88 g:ale_java_javac_options
89   Type: |String|
90   Default: `''`
91
92   This variable can be set to pass additional options to javac.
93
94                                             *ale-options.java_javac_sourcepath*
95                                                   *g:ale_java_javac_sourcepath*
96                                                   *b:ale_java_javac_sourcepath*
97 java_javac_sourcepath
98 g:ale_java_javac_sourcepath
99   Type: |String| or |List|
100   Default: `''`
101
102   This variable can set multiple source code paths, the source code path is a
103   relative path (relative to the project root directory).
104
105   The source path can be set as a String with a system-dependent path
106   separator. Note that the Unix path separator is a colon (`:`), and on
107   Windows the path separator is a semicolon (`;`). >
108
109   let g:ale_java_javac_sourcepath = 'build/gen/source/xx/main:build/gen/source'
110 <
111   The source path can be set as a List so ALE will add the appropriate path
112   separator for the host system automatically. >
113
114   let g:ale_java_javac_sourcepath = [
115   \   'build/generated/source/querydsl/main',
116   \   'target/generated-sources/source/querydsl/main',
117   \]
118 <
119
120 ===============================================================================
121 google-java-format                                *ale-java-google-java-format*
122
123                                *ale-options.java_google_java_format_executable*
124                                      *g:ale_java_google_java_format_executable*
125                                      *b:ale_java_google_java_format_executable*
126 java_google_java_format_executable
127 g:ale_java_google_java_format_executable
128   Type: |String|
129   Default: `'google-java-format'`
130
131   See |ale-integrations-local-executables|
132
133                                   *ale-options.java_google_java_format_options*
134                                         *g:ale_java_google_java_format_options*
135                                         *b:ale_java_google_java_format_options*
136 java_google_java_format_options
137 g:ale_java_google_java_format_options
138   Type: |String|
139   Default: `''`
140
141   This variable can be set to pass additional options
142
143
144 ===============================================================================
145 pmd                                                              *ale-java-pmd*
146
147                                                  *ale-options.java_pmd_options*
148                                                        *g:ale_java_pmd_options*
149                                                        *b:ale_java_pmd_options*
150 java_pmd_options
151 g:ale_java_pmd_options
152   Type: |String|
153   Default: `'-R category/java/bestpractices'`
154
155   This variable can be changed to modify flags given to PMD. Do not specify -f
156   and -d. They are added automatically.
157
158
159 ===============================================================================
160 javalsp                                                      *ale-java-javalsp*
161
162 To enable Java LSP linter you need to download and build the vscode-javac
163 language server from https://github.com/georgewfraser/java-language-server.
164
165 Before building the language server you need to install pre-requisites: npm,
166 maven, and protobuf. You also need to have Java 13 and JAVA_HOME properly
167 set.
168
169 After downloading the source code and installing all pre-requisites you can
170 build the language server with the included build.sh script:
171
172    `scripts/build.sh`
173
174 This will create launch scripts for Linux, Mac, and Windows in the dist folder
175 within the repo:
176
177   - `lang_server_linux.sh`
178   - `lang_server_mac.sh`
179   - `lang_server_windows.sh`
180
181 To let ALE use this language server you need to set the executable, as
182 documented below.
183
184                                           *ale-options.java_javalsp_executable*
185                                                 *g:ale_java_javalsp_executable*
186                                                 *b:ale_java_javalsp_executable*
187 java_javalsp_executable
188 g:ale_java_javalsp_executable
189   Type: |String|
190   Default: `''`
191
192   This variable must be set to the absolute path of the language server
193   launcher executable. For example: >
194
195   let g:ale_java_javalsp_executable = '/java-language-server/dist/lang_server_linux.sh'
196 <
197                                               *ale-options.java_javalsp_config*
198                                                     *g:ale_java_javalsp_config*
199                                                     *b:ale_java_javalsp_config*
200 java_javalsp_config
201 g:ale_java_javalsp_config
202   Type: |Dictionary|
203   Default: `{}`
204
205   The javalsp linter automatically detects external dependencies for Maven and
206   Gradle projects. In case the javalsp fails to detect some of them, you can
207   specify them configuring settings for the language server, such as in your
208   ftplugin file. >
209
210   let b:ale_java_javalsp_config = {
211   \   'java': {
212   \       'externalDependencies': [
213   \           'junit:junit:jar:4.12:test',
214   \           'junit:junit:4.1'
215   \       ],
216   \       'classPath': [
217   \           'lib/some-dependency.jar',
218   \           '/android-sdk/platforms/android-28.jar',
219   \       ],
220   \   },
221   \}
222 <
223   Or in Lua: >
224
225   require("ale").setup.buffer({
226       java_lsp_config = {
227           java = {
228               externalDependencies = {
229                   "junit:junit:jar:4.12:test",
230                   "junit:junit:4.1"
231               },
232               classPath = {
233                   "lib/some-dependency.jar",
234                   "/android-sdk/platforms/android-28.jar",
235               },
236           },
237       }
238   })
239 <
240   The Java language server will look for the dependencies you specify in
241   `externalDependencies` array in your Maven and Gradle caches ~/.m2 and
242   ~/.gradle.
243
244
245 ===============================================================================
246 eclipselsp                                                *ale-java-eclipselsp*
247
248 To enable Eclipse JDT LSP linter you need to clone and build the eclipse.jdt.ls
249 language server from https://github.com/eclipse/eclipse.jdt.ls. Simply
250 clone the source code repo and then build the plugin:
251
252    `./mvnw clean verify`
253
254 Note: currently, the build can only run when launched with JDK 11. More
255 recent versions can be used to run the server though.
256
257 After build completes the files required to run the language server will be
258 located inside the repository folder `eclipse.jdt.ls`. Please ensure to set
259 |g:ale_java_eclipselsp_path| to the absolute path of that folder.
260
261 You could customize compiler options and code assists of the server.
262 Under your project folder, modify the file `.settings/org.eclipse.jdt.core.prefs`
263 with options presented at
264 https://help.eclipse.org/neon/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/JavaCore.html.
265
266                                              *ale-options.java_eclipselsp_path*
267                                                    *g:ale_java_eclipselsp_path*
268                                                    *b:ale_java_eclipselsp_path*
269 java_eclipselsp_path
270 g:ale_java_eclipselsp_path
271   Type: |String|
272   Default: `'$HOME/eclipse.jdt.ls'`
273
274   Absolute path to the location of the eclipse.jdt.ls repository folder. Or if
275   you have VSCode extension installed the absolute path to the VSCode
276   extensions folder (e.g. $HOME/.vscode/extensions/redhat.java-0.4x.0 in
277   Linux).
278
279                                        *ale-options.java_eclipselsp_executable*
280                                              *g:ale_java_eclipselsp_executable*
281                                                 *b:ale_java_eclipse_executable*
282 java_eclipselsp_executable
283 g:ale_java_eclipselsp_executable
284   Type: |String|
285   Default: `'java'`
286
287   This variable can be set to change the executable path used for java.
288
289                                       *ale-options.java_eclipselsp_config_path*
290                                             *g:ale_java_eclipselsp_config_path*
291                                                *b:ale_java_eclipse_config_path*
292 java_eclipselsp_config_path
293 g:ale_java_eclipselsp_config_path
294   Type: |String|
295   Default: `''`
296
297   Set this variable to change the configuration directory path used by
298   eclipselsp (e.g. `$HOME/.jdtls` in Linux). By default ALE will attempt to
299   use the configuration within the installation directory.
300
301   This setting is particularly useful when eclipselsp is installed in a
302   non-writable directory like `/usr/share/java/jdtls`, as is the case when
303   installed via system package.
304
305                                    *ale-options.java_eclipselsp_workspace_path*
306                                          *g:ale_java_eclipselsp_workspace_path*
307                                          *b:ale_java_eclipselsp_workspace_path*
308 java_eclipselsp_workspace_path
309 g:ale_java_eclipselsp_workspace_path
310   Type: |String|
311   Default: `''`
312
313   If you have Eclipse installed it is a good idea to set this variable to the
314   absolute path of the Eclipse workspace. If not set this value will be set to
315   the parent folder of the project root.
316
317                                         *ale-options.java_eclipselsp_javaagent*
318                                               *g:ale_java_eclipselsp_javaagent*
319                                               *b:ale_java_eclipselsp_javaagent*
320 java_eclipselsp_javaagent
321 g:ale_java_eclipselsp_javaagent
322   Type: |String|
323   Default: `''`
324
325   A variable to add java agent for annotation processing such as Lombok.
326   If you have multiple java agent files, use space to separate them.
327   For example: >
328
329   let g:ale_java_eclipselsp_javaagent='/eclipse/lombok.jar /eclipse/jacoco.jar'
330 <
331
332 ===============================================================================
333 uncrustify                                                *ale-java-uncrustify*
334
335 See |ale-c-uncrustify| for information about the available options.
336
337
338 ===============================================================================
339   vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: