From b05c4620586109a396bb0aa3c39745b6d0a62f3c Mon Sep 17 00:00:00 2001 From: Asep Komarudin <68836805+pojokcodeid@users.noreply.github.com> Date: Tue, 25 Jun 2024 20:18:14 +0700 Subject: [PATCH] Updated 6. Configurations (markdown) --- 6.-Configurations.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) 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