From f52834f1b8c56de039ad8f1994ea5b8370a31dc1 Mon Sep 17 00:00:00 2001 From: asep komarudin Date: Tue, 20 Feb 2024 10:38:33 +0700 Subject: [PATCH] fix: add validation if dap not installed --- ftplugin/java.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ftplugin/java.lua b/ftplugin/java.lua index 5992c6e..5dc3aa6 100644 --- a/ftplugin/java.lua +++ b/ftplugin/java.lua @@ -115,6 +115,13 @@ local config = { config["on_attach"] = function(client, bufnr) local _, _ = pcall(vim.lsp.codelens.refresh) + + -- valdation if DAP not installed + local dap_status, _ = pcall(require, "nvim-dap") + if not dap_status then + return + end + require("jdtls.dap").setup_dap_main_class_configs() jdtls.setup_dap({ hotcodereplace = "auto" }) require("user.lsp.handlers").on_attach(client, bufnr)