forked from nvim-java/nvim-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjava.lua
More file actions
33 lines (24 loc) · 963 Bytes
/
java.lua
File metadata and controls
33 lines (24 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
local java = require('java')
local function c(cmd, callback, opts)
vim.api.nvim_create_user_command(cmd, callback, opts or {})
end
local cmd_map = {
JavaDapConfig = { java.dap.config_dap },
JavaTestRunCurrentClass = { java.test.run_current_class },
JavaTestDebugCurrentClass = { java.test.debug_current_class },
JavaTestRunCurrentMethod = { java.test.run_current_method },
JavaTestDebugCurrentMethod = { java.test.debug_current_method },
JavaTestViewLastReport = { java.test.view_last_report },
JavaRunnerRunMain = { java.runner.built_in.run_app, { nargs = '?' } },
JavaRunnerStopMain = { java.runner.built_in.stop_app },
JavaRunnerToggleLogs = { java.runner.built_in.toggle_logs },
JavaRunnerSwitchLogs = { java.runner.built_in.switch_app },
JavaProfile = { java.profile.ui },
JavaRefactorExtractVariable = {
java.refactor.extract_variable,
{ range = 2 },
},
}
for cmd, details in pairs(cmd_map) do
c(cmd, details[1], details[2])
end