diff --git a/6.-Configurations.md b/6.-Configurations.md index cee56c7..89a90e9 100644 --- a/6.-Configurations.md +++ b/6.-Configurations.md @@ -787,4 +787,34 @@ return { }, }, } +``` +# Config LSP JDTLS +```lua +return { + "neovim/nvim-lspconfig", + config = function() + require("lspconfig").jdtls.setup({ + cmd = { + "jdtls", + "-configuration", + vim.fn.expand("$HOME") .. "/.cache/jdtls/config", + "-data", + vim.fn.expand("$HOME") .. "/.cache/jdtls/workspace", + }, + filetypes = { "java" }, + root_dir = require("lspconfig.util").root_pattern( + -- 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(), + singe_file_support = true, + }) + end, +} ``` \ No newline at end of file