From 1bf76d5c1721100f2e6a12d872fb1f0f284788e6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 09:28:41 +0530 Subject: [PATCH 1/8] chore(doc): automatic vimdoc update (#285) Co-authored-by: s1n7ax <18459807+s1n7ax@users.noreply.github.com> --- doc/nvim-java.txt | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/doc/nvim-java.txt b/doc/nvim-java.txt index 545faef..c8dc219 100644 --- a/doc/nvim-java.txt +++ b/doc/nvim-java.txt @@ -1,4 +1,4 @@ -*nvim-java.txt* For Neovim >= 0.9.4 Last change: 2024 July 14 +*nvim-java.txt* For Neovim >= 0.9.4 Last change: 2024 December 24 ============================================================================== Table of Contents *nvim-java-table-of-contents* @@ -24,9 +24,15 @@ Table of Contents *nvim-java-table-of-contents* Just install and start writing `public static void main(String[] args)`. - [!WARNING] You cannot use `nvim-java` alongside `nvim-jdtls`. So remove + [!CAUTION] You cannot use `nvim-java` alongside `nvim-jdtls`. So remove `nvim-jdtls` before installing this + [!TIP] You can find cool tips & tricks here + https://github.com/nvim-java/nvim-java/wiki/Tips-&-Tricks + + [!NOTE] If you are facing errors while using, please check troubleshoot wiki + https://github.com/nvim-java/nvim-java/wiki/Troubleshooting + DEMO *nvim-java-demo* @@ -106,7 +112,9 @@ COMMANDS *nvim-java-commands* 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 ~ @@ -171,6 +179,14 @@ BUILD ~ 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 ~ @@ -361,14 +377,24 @@ want, following options are available '.git', }, + jdtls = { + version = 'v1.37.0', + }, + + lombok = { + version = 'nightly', + }, + -- load java test plugins java_test = { enable = true, + version = '0.40.1', }, -- load java debugger plugins java_debug_adapter = { enable = true, + version = '0.58.1', }, spring_boot_tools = { @@ -408,7 +434,7 @@ want, following options are available -- mason.nvim plugin. -- IF it's not registered correctly, an error will be thrown and nvim-java -- will stop setup - invalid_mason_registry = true, + invalid_mason_registry = false, }, } < From c5b4329d116b68eeaf751e57b4ec159c55f8c4b8 Mon Sep 17 00:00:00 2001 From: Srinesh Nisala Date: Tue, 24 Dec 2024 10:37:07 +0530 Subject: [PATCH 2/8] chore: add sts & jdk versions to config (#334) --- README.md | 6 ++++-- lua/java/config.lua | 10 ++++++---- lua/java/startup/mason-dep.lua | 7 +++++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 6d4108b..b2bce7f 100644 --- a/README.md +++ b/README.md @@ -356,7 +356,7 @@ want, following options are available }, jdtls = { - version = 'v1.37.0', + version = 'v1.43.0', }, lombok = { @@ -366,7 +366,7 @@ want, following options are available -- load java test plugins java_test = { enable = true, - version = '0.40.1', + version = '0.43.0', }, -- load java debugger plugins @@ -377,11 +377,13 @@ want, following options are available spring_boot_tools = { enable = true, + version = '1.59.0', }, jdk = { -- install jdk using mason.nvim auto_install = true, + version = '17.0.2', }, notifications = { diff --git a/lua/java/config.lua b/lua/java/config.lua index b560545..838a5c2 100644 --- a/lua/java/config.lua +++ b/lua/java/config.lua @@ -4,8 +4,8 @@ ---@field lombok { version: string } ---@field java_test { enable: boolean, version: string } ---@field java_debug_adapter { enable: boolean, version: string } ----@field spring_boot_tools { enable: boolean } ----@field jdk { auto_install: boolean } +---@field spring_boot_tools { enable: boolean, version: string } +---@field jdk { auto_install: boolean, version: string } ---@field notifications { dap: boolean } ---@field verification { invalid_order: boolean, duplicate_setup_calls: boolean, invalid_mason_registry: boolean } local config = { @@ -23,7 +23,7 @@ local config = { }, jdtls = { - version = 'v1.37.0', + version = 'v1.43.0', }, lombok = { @@ -33,7 +33,7 @@ local config = { -- load java test plugins java_test = { enable = true, - version = '0.40.1', + version = '0.43.0', }, -- load java debugger plugins @@ -44,11 +44,13 @@ local config = { spring_boot_tools = { enable = true, + version = '1.59.0', }, jdk = { -- install jdk using mason.nvim auto_install = true, + version = '17.0.2', }, notifications = { diff --git a/lua/java/startup/mason-dep.lua b/lua/java/startup/mason-dep.lua index b239381..f05e3a5 100644 --- a/lua/java/startup/mason-dep.lua +++ b/lua/java/startup/mason-dep.lua @@ -59,11 +59,14 @@ function M.get_pkg_list(config) }) if config.jdk.auto_install then - deps:push({ name = 'openjdk-17', version = '17.0.2' }) + deps:push({ name = 'openjdk-17', version = config.jdk.version }) end if config.spring_boot_tools.enable then - deps:push({ name = 'spring-boot-tools', version = '1.55.1' }) + deps:push({ + name = 'spring-boot-tools', + version = config.spring_boot_tools.version, + }) end return deps From 724a8ce2ea464d168117d4e24a5c42679b9123ae Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Tue, 24 Dec 2024 10:58:26 +0530 Subject: [PATCH 3/8] refactor: switch back to 1.55.1 sts version due to error in latest --- lua/java/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/java/config.lua b/lua/java/config.lua index 838a5c2..7a1b8bb 100644 --- a/lua/java/config.lua +++ b/lua/java/config.lua @@ -44,7 +44,7 @@ local config = { spring_boot_tools = { enable = true, - version = '1.59.0', + version = '1.55.1', }, jdk = { From cb6ba6ce46fce7474171d41e8cd921c0e0dab1db Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 12:01:34 +0530 Subject: [PATCH 4/8] chore(doc): automatic vimdoc update (#335) Co-authored-by: s1n7ax <18459807+s1n7ax@users.noreply.github.com> --- doc/nvim-java.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/nvim-java.txt b/doc/nvim-java.txt index c8dc219..6d24539 100644 --- a/doc/nvim-java.txt +++ b/doc/nvim-java.txt @@ -378,7 +378,7 @@ want, following options are available }, jdtls = { - version = 'v1.37.0', + version = 'v1.43.0', }, lombok = { @@ -388,7 +388,7 @@ want, following options are available -- load java test plugins java_test = { enable = true, - version = '0.40.1', + version = '0.43.0', }, -- load java debugger plugins @@ -399,11 +399,13 @@ want, following options are available spring_boot_tools = { enable = true, + version = '1.59.0', }, jdk = { -- install jdk using mason.nvim auto_install = true, + version = '17.0.2', }, notifications = { From e8e84413ca03e7d0541921e795b2e6bf8801f186 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Tue, 24 Dec 2024 12:03:28 +0530 Subject: [PATCH 5/8] chore: downgrade java-test version --- lua/java/config.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/java/config.lua b/lua/java/config.lua index 7a1b8bb..beb552e 100644 --- a/lua/java/config.lua +++ b/lua/java/config.lua @@ -33,7 +33,7 @@ local config = { -- load java test plugins java_test = { enable = true, - version = '0.43.0', + version = '0.40.1', }, -- load java debugger plugins From 4d810a546c262ca8f60228dc98ba51f81f5649c6 Mon Sep 17 00:00:00 2001 From: Luis Calle <53507599+TheLeoP@users.noreply.github.com> Date: Fri, 10 Jan 2025 00:25:15 -0500 Subject: [PATCH 6/8] fix(dap): do not override previously defined user config (#342) --- lua/java/dap/init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/java/dap/init.lua b/lua/java/dap/init.lua index 42d78f7..15804a9 100644 --- a/lua/java/dap/init.lua +++ b/lua/java/dap/init.lua @@ -105,7 +105,8 @@ function M:config_dap() end end -- end - nvim_dap.configurations.java = dap_config + nvim_dap.configurations.java = nvim_dap.configurations.java or {} + vim.list_extend(nvim_dap.configurations.java, dap_config) end return M From c616f72fa2ea0ad9d7798e1d7cab56aa6de56108 Mon Sep 17 00:00:00 2001 From: Srinesh Nisala Date: Sun, 26 Jan 2025 15:41:48 +0530 Subject: [PATCH 7/8] feat: add sync ui select util (#345) --- lua/java/utils/ui.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lua/java/utils/ui.lua b/lua/java/utils/ui.lua index d487775..91860d4 100644 --- a/lua/java/utils/ui.lua +++ b/lua/java/utils/ui.lua @@ -26,6 +26,30 @@ function M.select(prompt, values, format_item, opts) end) end +--Sync vim.ui.select function +---@generic T +---@param prompt string +---@param values T[] +---@param format_item? fun(item: T, index: number): string +---@param opts? { return_one: boolean } +---@return T | nil +function M.select_sync(prompt, values, format_item, opts) + opts = opts or { prompt_single = false } + + if not opts.prompt_single and #values == 1 then + return values[1] + end + + local labels = { prompt } + for index, value in ipairs(values) do + table.insert(labels, format_item and format_item(value, index) or value) + end + + local selected_index = vim.fn.inputlist(labels) + + return values[selected_index] +end + ---Async vim.ui.select function ---@generic T ---@param prompt string From 04e3a41afce7357ad7c8d9c6676f0f3b5f5634e6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 26 Jan 2025 15:42:41 +0530 Subject: [PATCH 8/8] chore(main): release 2.1.0 (#343) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a6c617..48715b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.1.0](https://github.com/nvim-java/nvim-java/compare/v2.0.2...v2.1.0) (2025-01-26) + + +### Features + +* add sync ui select util ([#345](https://github.com/nvim-java/nvim-java/issues/345)) ([c616f72](https://github.com/nvim-java/nvim-java/commit/c616f72fa2ea0ad9d7798e1d7cab56aa6de56108)) + + +### Bug Fixes + +* **dap:** do not override previously defined user config ([#342](https://github.com/nvim-java/nvim-java/issues/342)) ([4d810a5](https://github.com/nvim-java/nvim-java/commit/4d810a546c262ca8f60228dc98ba51f81f5649c6)) + ## [2.0.2](https://github.com/nvim-java/nvim-java/compare/v2.0.1...v2.0.2) (2024-12-24)