Skip to content

Commit 9f9b785

Browse files
authored
feat(conf): capability to remove dap related notifications
- "Configuring DAP" & "DAP configured" messages can be removed using the configuration
1 parent ba1146e commit 9f9b785

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

lua/java.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ local M = {}
1414
function M.setup(custom_config)
1515
local config =
1616
vim.tbl_deep_extend('force', global_config, custom_config or {})
17+
vim.g.nvim_java_config = config
1718

1819
nvim_dep.check()
1920

lua/java/api/dap.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,14 @@ function M.config_dap()
2222
log.info('configuring dap')
2323

2424
return async(function()
25-
notify.warn('Configuring DAP')
25+
local config = vim.g.nvim_java_config
26+
if config.notifications.dap then
27+
notify.warn('Configuring DAP')
28+
end
2629
JavaDap:new(jdtls()):config_dap()
27-
notify.info('DAP configured')
30+
if config.notifications.dap then
31+
notify.info('DAP configured')
32+
end
2833
end)
2934
.catch(get_error_handler('dap configuration failed'))
3035
.run()

lua/java/config.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ local config = {
2626
jdk = {
2727
auto_install = true,
2828
},
29+
notifications = {
30+
dap = true,
31+
},
2932
}
3033

3134
return config

0 commit comments

Comments
 (0)