diff --git a/README.md b/README.md index b15d417..ee42173 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Just install and start writing `public static void main(String[] args)`. ### Starter Configs (Recommend for newbies) Following are forks of original repositories pre-configured for java. If you -don't know how to get started, use one of the following to get started. +don't know how to get started, use one of the following to get started. You can click on **n commits ahead of** link to see the changes made on top of the original project - [LazyVim](https://github.com/nvim-java/starter-lazyvim) @@ -88,7 +88,11 @@ Yep! That's all :) ### Build -- `JavaBuildWorkspace` - Runs a full workspace build +- `JavaBuildBuildWorkspace` - Runs a full workspace build + +- `JavaBuildCleanWorkspace` - Clear the workspace cache + (for now you have to close and reopen to restart the language server after + the deletion) ### Runner @@ -149,6 +153,14 @@ Yep! That's all :) require('java').build.build_workspace() ``` +- `build.clean_workspace` - Clear the workspace cache + (for now you have to close and reopen to restart the language server after + the deletion) + +```lua +require('java').build.clean_workspace() +``` + ### Runner - `built_in.run_app` - Runs the application or selected main class (if there diff --git a/lua/java.lua b/lua/java.lua index 658e033..13c8b25 100644 --- a/lua/java.lua +++ b/lua/java.lua @@ -56,7 +56,7 @@ function M.register_api(path, command, opts) vim.api.nvim_create_user_command(name, command, opts or {}) - local last_index = #path - 1 + local last_index = #path local func_name = path[last_index] table.remove(path, last_index)