diff options
| author | github-actions <github-actions@github.com> | 2021-07-27 17:05:47 +0000 |
|---|---|---|
| committer | github-actions <github-actions@github.com> | 2021-07-27 17:05:47 +0000 |
| commit | 98bbce6dd3e1a4692860117c5f833c06d79ef5ab (patch) | |
| tree | 3a4cc2a9075841708946f8633c179e29f434397d /CONFIG.md | |
| parent | improve(jdtls): Simplify configuration and improve documentation (#1082) (diff) | |
| download | nvim-lspconfig-98bbce6dd3e1a4692860117c5f833c06d79ef5ab.tar nvim-lspconfig-98bbce6dd3e1a4692860117c5f833c06d79ef5ab.tar.gz nvim-lspconfig-98bbce6dd3e1a4692860117c5f833c06d79ef5ab.tar.bz2 nvim-lspconfig-98bbce6dd3e1a4692860117c5f833c06d79ef5ab.tar.lz nvim-lspconfig-98bbce6dd3e1a4692860117c5f833c06d79ef5ab.tar.xz nvim-lspconfig-98bbce6dd3e1a4692860117c5f833c06d79ef5ab.tar.zst nvim-lspconfig-98bbce6dd3e1a4692860117c5f833c06d79ef5ab.zip | |
[docgen] Update CONFIG.md
skip-checks: true
Diffstat (limited to 'CONFIG.md')
| -rw-r--r-- | CONFIG.md | 54 |
1 files changed, 39 insertions, 15 deletions
@@ -2370,23 +2370,41 @@ require'lspconfig'.java_language_server.setup{} ## jdtls - https://projects.eclipse.org/projects/eclipse.jdt.ls Language server for Java. -See project page for installation instructions. +IMPORTANT: If you want all the features jdtls has to offer, [nvim-jdtls](https://github.com/mfussenegger/nvim-jdtls) +is highly recommended. If all you need is diagnostics, completion, imports, gotos and formatting and some code actions +you can keep reading here. + +For manual installation you can download precompiled binaries from the +[official downloads site](http://download.eclipse.org/jdtls/snapshots/?d) -Due to the nature of java, the settings for eclipse jdtls cannot be automatically -inferred. Please set the following environmental variables to match your installation. You can set these locally for your project with the help of [direnv](https://github.com/direnv/direnv). Note version numbers will change depending on your project's version of java, your version of eclipse, and in the case of JDTLS_CONFIG, your OS. +Due to the nature of java, settings cannot be inferred. Please set the following +environmental variables to match your installation. If you need per-project configuration +[direnv](https://github.com/direnv/direnv) is highly recommended. ```bash -export JAR=/path/to/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/plugins/org.eclipse.equinox.launcher_1.6.0.v20200915-1508.jar -export GRADLE_HOME=$HOME/gradle -export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::") -export JDTLS_CONFIG=/path/to/eclipse.jdt.ls/org.eclipse.jdt.ls.product/target/repository/config_linux -export WORKSPACE=$HOME/workspace +# Mandatory: +# .bashrc +export JDTLS_HOME=/path/to/jdtls_root # Directory with the plugin and configs directories + +# Optional: +export JAVA_HOME=/path/to/java_home # In case you don't have java in path or want to use a version in particular +export WORKSPACE=/path/to/workspace # Defaults to $HOME/workspace ``` +```lua + -- init.lua + require'lspconfig'.jdtls.setup{} +``` + +For automatic installation you can use the following unofficial installers/launchers under your own risk: + - [jdtls-launcher](https://github.com/eruizc-dev/jdtls-launcher) (Includes lombok support by default) + ```lua + -- init.lua + require'lspconfig'.jdtls.setup{ cmd = { 'jdtls' } } + ``` This server accepts configuration via the `settings` key. <details><summary>Available settings:</summary> @@ -2834,11 +2852,7 @@ require'lspconfig'.jdtls.setup{} Commands: Default Values: - cmd = { "/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/java", "-Declipse.application=org.eclipse.jdt.ls.core.id1", "-Dosgi.bundles.defaultStartLevel=4", "-Declipse.product=org.eclipse.jdt.ls.core.product", "-Dlog.protocol=true", "-Dlog.level=ALL", "-Xms1g", "-Xmx2G", "-jar", "vim.NIL", "-configuration", "vim.NIL", "-data", "vim.NIL", "--add-modules=ALL-SYSTEM", "--add-opens java.base/java.util=ALL-UNNAMED", "--add-opens java.base/java.lang=ALL-UNNAMED" } - cmd_env = { - GRADLE_HOME = "/usr/share/gradle-7.1.1", - JAR = vim.NIL - } + cmd = { "/usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/java", "-Declipse.application=org.eclipse.jdt.ls.core.id1", "-Dosgi.bundles.defaultStartLevel=4", "-Declipse.product=org.eclipse.jdt.ls.core.product", "-Dlog.protocol=true", "-Dlog.level=ALL", "-Xms1g", "-Xmx2G", "-jar", "/plugins/org.eclipse.equinox.launcher_*.jar", "-configuration", "config_linux", "-data", "/home/runner/workspace", "--add-modules=ALL-SYSTEM", "--add-opens", "java.base/java.util=ALL-UNNAMED", "--add-opens", "java.base/java.lang=ALL-UNNAMED" } filetypes = { "java" } handlers = { ["language/status"] = <function 1>, @@ -2850,7 +2864,17 @@ require'lspconfig'.jdtls.setup{} jvm_args = {}, workspace = "/home/runner/workspace" } - root_dir = root_pattern(".git") + root_dir = { + -- Single-module projects + { + 'build.xml', -- Ant + 'pom.xml', -- Maven + 'settings.gradle', -- Gradle + 'settings.gradle.kts', -- Gradle + }, + -- Multi-module projects + { 'build.gradle', 'build.gradle.kts' }, + } or vim.fn.getcwd() ``` |
