Skip to content

Commit b9e6b71

Browse files
authored
fix: refactor and build lua API being registered incorrectly (nvim-java#284)
1 parent 4d07a4e commit b9e6b71

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Just install and start writing `public static void main(String[] args)`.
4747
### Starter Configs (Recommend for newbies)
4848

4949
Following are forks of original repositories pre-configured for java. If you
50-
don't know how to get started, use one of the following to get started.
50+
don't know how to get started, use one of the following to get started.
5151
You can click on **n commits ahead of** link to see the changes made on top of the original project
5252

5353
- [LazyVim](https://github.com/nvim-java/starter-lazyvim)
@@ -88,7 +88,11 @@ Yep! That's all :)
8888

8989
### Build
9090

91-
- `JavaBuildWorkspace` - Runs a full workspace build
91+
- `JavaBuildBuildWorkspace` - Runs a full workspace build
92+
93+
- `JavaBuildCleanWorkspace` - Clear the workspace cache
94+
(for now you have to close and reopen to restart the language server after
95+
the deletion)
9296

9397
### Runner
9498

@@ -149,6 +153,14 @@ Yep! That's all :)
149153
require('java').build.build_workspace()
150154
```
151155

156+
- `build.clean_workspace` - Clear the workspace cache
157+
(for now you have to close and reopen to restart the language server after
158+
the deletion)
159+
160+
```lua
161+
require('java').build.clean_workspace()
162+
```
163+
152164
### Runner
153165

154166
- `built_in.run_app` - Runs the application or selected main class (if there

lua/java.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function M.register_api(path, command, opts)
5656

5757
vim.api.nvim_create_user_command(name, command, opts or {})
5858

59-
local last_index = #path - 1
59+
local last_index = #path
6060
local func_name = path[last_index]
6161

6262
table.remove(path, last_index)

0 commit comments

Comments
 (0)