File tree Expand file tree Collapse file tree 4 files changed +39
-8
lines changed
Expand file tree Collapse file tree 4 files changed +39
-8
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,21 @@ Yep! That's all :)
8282
8383</details >
8484
85+ ## :keyboard : Commands
86+
87+ <details >
88+
89+ <summary >:pushpin: details</summary >
90+
91+ - ` JavaDapConfig ` - DAP is autoconfigured on start up, but in case you want to force configure it again, you can use this API
92+ - ` JavaTestRunCurrentClass ` - Run the test class in the active buffer
93+ - ` JavaTestDebugCurrentClass ` - Debug the test class in the active buffer
94+ - ` JavaTestRunCurrentMethod ` - Run the test method on the cursor
95+ - ` JavaTestDebugCurrentMethod ` - Debug the test method on the cursor
96+ - ` JavaTestViewLastReport ` - Open the last test report in a popup window
97+
98+ </details >
99+
85100## :computer : APIs
86101
87102<details >
@@ -125,7 +140,7 @@ require('java').test.debug_current_method()
125140- ` view_report ` - Open the last test report in a popup window
126141
127142``` lua
128- require (' java' ).test .view_report ()
143+ require (' java' ).test .view_last_report ()
129144```
130145
131146</details >
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ M.test.debug_current_class = test.debug_current_class
4040M .test .run_current_method = test .run_current_method
4141M .test .debug_current_method = test .debug_current_method
4242
43- M .test .view_report = test .view_report
43+ M .test .view_last_report = test .view_last_report
4444
4545---- ------------------------------------------------------------------
4646-- Manipulate --
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ function M.run_current_method()
5959 .run ()
6060end
6161
62- function M .view_report ()
62+ function M .view_last_report ()
6363 if M .last_report then
6464 M .last_report :show_report ()
6565 end
Original file line number Diff line number Diff line change 1- -- vim.api.nvim_create_user_command(
2- -- 'MyFirstFunction',
3- -- require('plugin_name').hello,
4- -- {}
5- -- )
1+ local java = require (' java' )
2+
3+ local function c (cmd , callback , opts )
4+ vim .api .nvim_create_user_command (cmd , callback , opts or {})
5+ end
6+
7+ local cmd_map = {
8+ JavaDapConfig = { java .dap .config_dap },
9+
10+ JavaTestRunCurrentClass = { java .test .run_current_class },
11+ JavaTestDebugCurrentClass = { java .test .debug_current_class },
12+
13+ JavaTestRunCurrentMethod = { java .test .run_current_method },
14+ JavaTestDebugCurrentMethod = { java .test .debug_current_method },
15+
16+ JavaTestViewLastReport = { java .test .view_last_report },
17+ }
18+
19+ for cmd , details in pairs (cmd_map ) do
20+ c (cmd , details [1 ], details [2 ])
21+ end
You can’t perform that action at this time.
0 commit comments