2017-03-28 22:25:44 +00:00
|
|
|
===============================================================================
|
|
|
|
ALE Java Integration *ale-java-options*
|
|
|
|
|
|
|
|
|
2017-07-08 13:17:26 +00:00
|
|
|
===============================================================================
|
2017-08-10 09:45:12 +00:00
|
|
|
checkstyle *ale-java-checkstyle*
|
2017-05-12 13:42:32 +00:00
|
|
|
|
2019-06-03 22:40:22 +00:00
|
|
|
g:ale_java_checkstyle_config *g:ale_java_checkstyle_config*
|
|
|
|
*b:ale_java_checkstyle_config*
|
|
|
|
|
|
|
|
Type: |String|
|
2019-06-10 01:18:06 +00:00
|
|
|
Default: `'/google_checks.xml'`
|
2019-06-03 22:40:22 +00:00
|
|
|
|
|
|
|
A path to a checkstyle configuration file.
|
|
|
|
|
|
|
|
If a configuration file is specified with |g:ale_java_checkstyle_options|,
|
|
|
|
it will be preferred over this setting.
|
|
|
|
|
|
|
|
The path to the configuration file can be an absolute path or a relative
|
|
|
|
path. ALE will search for the relative path in parent directories.
|
|
|
|
|
|
|
|
|
|
|
|
g:ale_java_checkstyle_executable *g:ale_java_checkstyle_executable*
|
|
|
|
*b:ale_java_checkstyle_executable*
|
|
|
|
|
|
|
|
Type: |String|
|
|
|
|
Default: 'checkstyle'
|
|
|
|
|
|
|
|
This variable can be changed to modify the executable used for checkstyle.
|
|
|
|
|
|
|
|
|
2017-08-10 09:45:12 +00:00
|
|
|
g:ale_java_checkstyle_options *g:ale_java_checkstyle_options*
|
|
|
|
*b:ale_java_checkstyle_options*
|
2017-05-12 13:42:32 +00:00
|
|
|
|
2019-06-03 22:40:22 +00:00
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
2017-05-12 13:42:32 +00:00
|
|
|
|
|
|
|
This variable can be changed to modify flags given to checkstyle.
|
|
|
|
|
2019-06-03 22:40:22 +00:00
|
|
|
If a configuration file is specified with `-c`, it will be used instead of
|
|
|
|
configuration files set with |g:ale_java_checkstyle_config|.
|
|
|
|
|
2017-05-12 13:42:32 +00:00
|
|
|
|
2017-07-08 13:17:26 +00:00
|
|
|
===============================================================================
|
2017-03-28 22:25:44 +00:00
|
|
|
javac *ale-java-javac*
|
|
|
|
|
|
|
|
g:ale_java_javac_classpath *g:ale_java_javac_classpath*
|
2017-04-27 21:04:34 +00:00
|
|
|
*b:ale_java_javac_classpath*
|
2020-05-19 02:43:16 +00:00
|
|
|
Type: |String| or |List|
|
2017-03-28 22:25:44 +00:00
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be set to change the global classpath for Java.
|
|
|
|
|
|
|
|
|
2018-04-08 19:35:06 +00:00
|
|
|
g:ale_java_javac_executable *g:ale_java_javac_executable*
|
|
|
|
*b:ale_java_javac_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'javac'`
|
|
|
|
|
|
|
|
This variable can be set to change the executable path used for javac.
|
|
|
|
|
|
|
|
|
2017-03-28 22:25:44 +00:00
|
|
|
g:ale_java_javac_options *g:ale_java_javac_options*
|
2017-04-27 21:04:34 +00:00
|
|
|
*b:ale_java_javac_options*
|
2017-03-28 22:25:44 +00:00
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be set to pass additional options to javac.
|
|
|
|
|
2020-05-15 02:48:03 +00:00
|
|
|
g:ale_java_javac_sourcepath *g:ale_java_javac_sourcepath*
|
|
|
|
*b:ale_java_javac_sourcepath*
|
2020-05-18 09:35:16 +00:00
|
|
|
Type: |String| or |List|
|
2020-05-15 02:48:03 +00:00
|
|
|
Default: `[]`
|
|
|
|
|
2020-05-18 09:35:16 +00:00
|
|
|
This variable can set multiple source code paths, the source code path is a
|
|
|
|
relative path (relative to the project root directory).
|
|
|
|
|
|
|
|
Example:
|
|
|
|
|
|
|
|
String type:
|
|
|
|
Note that the unix system separator is a colon(`:`) window system
|
|
|
|
is a semicolon(`;`).
|
|
|
|
>
|
|
|
|
let g:ale_java_javac_sourcepath = 'build/gen/source/xx/main:build/gen/source'
|
|
|
|
<
|
|
|
|
List type:
|
|
|
|
>
|
|
|
|
let g:ale_java_javac_sourcepath = [
|
|
|
|
\ 'build/generated/source/querydsl/main',
|
|
|
|
\ 'target/generated-sources/source/querydsl/main'
|
|
|
|
\ ]
|
|
|
|
<
|
2020-05-15 02:48:03 +00:00
|
|
|
|
2017-03-28 22:25:44 +00:00
|
|
|
|
2017-12-09 13:52:15 +00:00
|
|
|
===============================================================================
|
2017-12-17 12:10:07 +00:00
|
|
|
google-java-format *ale-java-google-java-format*
|
2017-12-09 13:52:15 +00:00
|
|
|
|
|
|
|
|
2017-12-17 12:10:07 +00:00
|
|
|
g:ale_java_google_java_format_executable
|
|
|
|
*g:ale_java_google_java_format_executable*
|
|
|
|
*b:ale_java_google_java_format_executable*
|
2017-12-09 13:52:15 +00:00
|
|
|
Type: |String|
|
|
|
|
Default: `'google-java-format'`
|
|
|
|
|
|
|
|
See |ale-integrations-local-executables|
|
|
|
|
|
|
|
|
|
2017-12-17 12:10:07 +00:00
|
|
|
g:ale_java_google_java_format_options *g:ale_java_google_java_format_options*
|
|
|
|
*b:ale_java_google_java_format_options*
|
2017-12-09 13:52:15 +00:00
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
This variable can be set to pass additional options
|
|
|
|
|
2018-04-09 15:45:08 +00:00
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
pmd *ale-java-pmd*
|
|
|
|
|
|
|
|
g:ale_java_pmd_options *g:ale_java_pmd_options*
|
|
|
|
*b:ale_java_pmd_options*
|
|
|
|
|
|
|
|
Type: String
|
|
|
|
Default: '-R category/java/bestpractices'
|
|
|
|
|
|
|
|
This variable can be changed to modify flags given to PMD. Do not specify -f
|
|
|
|
and -d. They are added automatically.
|
|
|
|
|
|
|
|
|
2018-08-24 07:20:44 +00:00
|
|
|
===============================================================================
|
|
|
|
javalsp *ale-java-javalsp*
|
|
|
|
|
|
|
|
To enable Java LSP linter you need to download and build the vscode-javac
|
2019-02-07 09:35:24 +00:00
|
|
|
language server from https://github.com/georgewfraser/java-language-server.
|
|
|
|
Simply download the source code and then build a distribution:
|
2018-08-24 07:20:44 +00:00
|
|
|
|
2019-02-07 09:35:24 +00:00
|
|
|
scripts/link_mac.sh
|
2018-08-24 07:20:44 +00:00
|
|
|
|
2019-02-07 09:35:24 +00:00
|
|
|
or
|
|
|
|
|
|
|
|
scripts/link_windows.sh
|
|
|
|
|
|
|
|
This generates a dist/mac or dist/windows directory that contains the
|
|
|
|
language server. To let ALE use this language server you need to set the
|
2019-06-04 15:31:56 +00:00
|
|
|
g:ale_java_javalsp_executable variable to the absolute path of the launcher
|
2019-02-07 09:35:24 +00:00
|
|
|
executable in this directory.
|
2018-08-24 07:20:44 +00:00
|
|
|
|
2018-12-05 12:27:02 +00:00
|
|
|
g:ale_java_javalsp_executable *g:ale_java_javalsp_executable*
|
|
|
|
*b:ale_java_javalsp_executable*
|
|
|
|
Type: |String|
|
2019-06-19 02:50:03 +00:00
|
|
|
Default: `''`
|
2018-12-05 12:27:02 +00:00
|
|
|
|
2019-06-04 15:31:56 +00:00
|
|
|
This variable must be set to the absolute path of the language server launcher
|
|
|
|
executable. For example:
|
|
|
|
>
|
|
|
|
let g:ale_java_javalsp_executable=/java-language-server/dist/mac/bin/launcher
|
|
|
|
<
|
2018-08-24 07:20:44 +00:00
|
|
|
|
2019-06-19 02:38:23 +00:00
|
|
|
g:ale_java_javalsp_config *g:ale_java_javalsp_config*
|
|
|
|
*b:ale_java_javalsp_config*
|
|
|
|
Type: |Dictionary|
|
|
|
|
Default: `{}`
|
|
|
|
|
|
|
|
The javalsp linter automatically detects external depenencies for Maven and
|
|
|
|
Gradle projects. In case the javalsp fails to detect some of them, you can
|
|
|
|
specify them setting a dictionary to |g:ale_java_javalsp_config| variable.
|
|
|
|
>
|
|
|
|
let g:ale_java_javalsp_executable =
|
|
|
|
\ {
|
|
|
|
\ 'java': {
|
|
|
|
\ 'externalDependencies': [
|
|
|
|
\ 'junit:junit:jar:4.12:test', " Maven format
|
|
|
|
\ 'junit:junit:4.1' " Gradle format
|
|
|
|
\ ],
|
|
|
|
\ 'classPath': [
|
|
|
|
\ 'lib/some-dependency.jar',
|
|
|
|
\ '/android-sdk/platforms/android-28.jar'
|
|
|
|
\ ]
|
|
|
|
\ }
|
|
|
|
\ }
|
|
|
|
|
|
|
|
The Java language server will look for the dependencies you specify in
|
|
|
|
`externalDependencies` array in your Maven and Gradle caches ~/.m2 and
|
|
|
|
~/.gradle.
|
|
|
|
|
2018-12-01 05:53:49 +00:00
|
|
|
===============================================================================
|
|
|
|
eclipselsp *ale-java-eclipselsp*
|
|
|
|
|
2019-05-08 02:46:19 +00:00
|
|
|
To enable Eclipse LSP linter you need to clone and build the eclipse.jdt.ls
|
2018-12-01 05:53:49 +00:00
|
|
|
language server from https://github.com/eclipse/eclipse.jdt.ls. Simply
|
|
|
|
clone the source code repo and then build the plugin:
|
|
|
|
|
|
|
|
./mvnw clean verify
|
|
|
|
|
|
|
|
Note: currently, the build can only run when launched with JDK 8. JDK 9 or more
|
|
|
|
recent versions can be used to run the server though.
|
|
|
|
|
|
|
|
After build completes the files required to run the language server will be
|
2019-05-08 02:46:19 +00:00
|
|
|
located inside the repository folder `eclipse.jdt.ls`. Please ensure to set
|
2019-05-07 05:55:52 +00:00
|
|
|
|g:ale_java_eclipselsp_path| to the absolute path of that folder.
|
2018-12-01 05:53:49 +00:00
|
|
|
|
2019-04-17 07:38:09 +00:00
|
|
|
You could customize compiler options and code assists of the server.
|
2019-06-03 22:40:22 +00:00
|
|
|
Under your project folder, modify the file `.settings/org.eclipse.jdt.core.prefs`
|
2019-05-08 02:46:19 +00:00
|
|
|
with options presented at
|
2019-04-17 07:38:09 +00:00
|
|
|
https://help.eclipse.org/neon/topic/org.eclipse.jdt.doc.isv/reference/api/org/eclipse/jdt/core/JavaCore.html.
|
|
|
|
|
2018-12-01 05:53:49 +00:00
|
|
|
g:ale_java_eclipselsp_path *g:ale_java_eclipselsp_path*
|
|
|
|
*b:ale_java_eclipselsp_path*
|
|
|
|
|
|
|
|
Type: |String|
|
2019-05-08 02:46:19 +00:00
|
|
|
Default: `'$HOME/eclipse.jdt.ls'`
|
2018-12-01 05:53:49 +00:00
|
|
|
|
2019-05-08 02:46:19 +00:00
|
|
|
Absolute path to the location of the eclipse.jdt.ls repository folder. Or if
|
|
|
|
you have VSCode extension installed the absolute path to the VSCode extensions
|
2019-05-21 04:33:47 +00:00
|
|
|
folder (e.g. $HOME/.vscode/extensions/redhat.java-0.4x.0 in Linux).
|
2018-12-01 05:53:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
g:ale_java_eclipselsp_executable *g:ale_java_eclipse_executable*
|
|
|
|
*b:ale_java_eclipse_executable*
|
|
|
|
Type: |String|
|
|
|
|
Default: `'java'`
|
|
|
|
|
|
|
|
This variable can be set to change the executable path used for java.
|
|
|
|
|
|
|
|
|
2019-06-03 22:40:22 +00:00
|
|
|
g:ale_java_eclipselsp_config_path *g:ale_java_eclipse_config_path*
|
|
|
|
*b:ale_java_eclipse_config_path*
|
2019-05-21 20:13:06 +00:00
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
Set this variable to change the configuration directory path used by
|
|
|
|
eclipselsp (e.g. `$HOME/.jdtls` in Linux).
|
|
|
|
By default ALE will attempt to use the configuration within the installation
|
|
|
|
directory.
|
|
|
|
This setting is particularly useful when eclipselsp is installed in a
|
|
|
|
non-writable directory like `/usr/share/java/jdtls`, as is the case when
|
|
|
|
installed via system package.
|
|
|
|
|
2019-05-21 04:33:47 +00:00
|
|
|
|
2019-06-03 22:40:22 +00:00
|
|
|
g:ale_java_eclipselsp_workspace_path *g:ale_java_eclipselsp_workspace_path*
|
|
|
|
*b:ale_java_eclipselsp_workspace_path*
|
2019-05-21 04:33:47 +00:00
|
|
|
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
If you have Eclipse installed is good idea to set this variable to the
|
|
|
|
absolute path of the Eclipse workspace. If not set this value will be set to
|
|
|
|
the parent folder of the project root.
|
|
|
|
|
2020-03-26 08:14:06 +00:00
|
|
|
g:ale_java_eclipselsp_javaagent *g:ale_java_eclipselsp_javaagent*
|
|
|
|
*b:ale_java_eclipselsp_javaagent*
|
2020-03-26 06:40:07 +00:00
|
|
|
|
|
|
|
Type: |String|
|
|
|
|
Default: `''`
|
|
|
|
|
|
|
|
A variable to add java agent for annotation processing such as Lombok.
|
|
|
|
If you have multiple java agent files, use space to separate them. For example:
|
|
|
|
>
|
|
|
|
let g:ale_java_eclipselsp_javaagent='/eclipse/lombok.jar /eclipse/jacoco.jar'
|
|
|
|
<
|
2019-05-21 04:33:47 +00:00
|
|
|
|
2018-09-05 00:39:32 +00:00
|
|
|
===============================================================================
|
|
|
|
uncrustify *ale-java-uncrustify*
|
|
|
|
|
|
|
|
See |ale-c-uncrustify| for information about the available options.
|
|
|
|
|
|
|
|
|
2017-07-08 13:17:26 +00:00
|
|
|
===============================================================================
|
2017-03-28 22:25:44 +00:00
|
|
|
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|