From 905013eb83c58bda992724b3ecbe20f60b58513f Mon Sep 17 00:00:00 2001 From: Srinesh Nisala Date: Tue, 22 Oct 2024 07:50:41 +0530 Subject: [PATCH 1/5] chore(doc): add wiki links (#317) --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ee42173..ae7ccdd 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,15 @@ Just install and start writing `public static void main(String[] args)`. -> [!WARNING] +> [!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 + ## :loudspeaker: Demo From a36f50c82f922f352d4ce7ac6a3c6b238b3e0a36 Mon Sep 17 00:00:00 2001 From: atm1020 <30997516+atm1020@users.noreply.github.com> Date: Tue, 3 Dec 2024 04:51:46 +0100 Subject: [PATCH 2/5] fix: runner cmd #241 (#329) The `Run` class always uses the command passed during the initialization, so the profile config changes don't apply. --- lua/java/runner/run.lua | 12 ++++++------ lua/java/runner/runner.lua | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lua/java/runner/run.lua b/lua/java/runner/run.lua index d5214b2..1691823 100644 --- a/lua/java/runner/run.lua +++ b/lua/java/runner/run.lua @@ -7,7 +7,6 @@ local notify = require('java-core.utils.notify') ---@field buffer number ---@field is_running boolean ---@field is_manually_stoped boolean ----@field private cmd string ---@field private term_chan_id number ---@field private job_chan_id number | nil ---@field private is_failure boolean @@ -15,10 +14,9 @@ local Run = class() ---@param dap_config java-dap.DapLauncherConfig ---@param cmd string[] -function Run:_init(dap_config, cmd) +function Run:_init(dap_config) self.name = dap_config.name self.main_class = dap_config.mainClass - self.cmd = table.concat(cmd, ' ') self.buffer = vim.api.nvim_create_buf(false, true) self.term_chan_id = vim.api.nvim_open_term(self.buffer, { on_input = function(_, _, _, data) @@ -27,11 +25,13 @@ function Run:_init(dap_config, cmd) }) end -function Run:start() +---@param cmd string[] +function Run:start(cmd) + local merged_cmd = table.concat(cmd, ' ') self.is_running = true - self:send_term(self.cmd) + self:send_term(merged_cmd) - self.job_chan_id = vim.fn.jobstart(self.cmd, { + self.job_chan_id = vim.fn.jobstart(merged_cmd, { pty = true, on_stdout = function(_, data) self:send_term(data) diff --git a/lua/java/runner/runner.lua b/lua/java/runner/runner.lua index 8705ed2..1120224 100644 --- a/lua/java/runner/runner.lua +++ b/lua/java/runner/runner.lua @@ -41,7 +41,7 @@ function Runner:start_run(args) self.curr_run = run self.logger:set_buffer(run.buffer) - run:start() + run:start(cmd) end ---Stops the user selected run From 60e5d968c17d77dcc499e5def752af35626663a2 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Tue, 24 Dec 2024 09:19:08 +0530 Subject: [PATCH 3/5] chore: add versions to config --- lua/java/config.lua | 16 ++++++++++++++-- lua/java/startup/mason-dep.lua | 11 +++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/lua/java/config.lua b/lua/java/config.lua index 5cd2d29..b560545 100644 --- a/lua/java/config.lua +++ b/lua/java/config.lua @@ -1,7 +1,9 @@ ---@class java.Config ---@field root_markers string[] ----@field java_test { enable: boolean } ----@field java_debug_adapter { enable: boolean } +---@field jdtls { version: string } +---@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 notifications { dap: boolean } @@ -20,14 +22,24 @@ local config = { '.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 = { diff --git a/lua/java/startup/mason-dep.lua b/lua/java/startup/mason-dep.lua index 8aed3fd..b239381 100644 --- a/lua/java/startup/mason-dep.lua +++ b/lua/java/startup/mason-dep.lua @@ -49,10 +49,13 @@ end ---@return table function M.get_pkg_list(config) local deps = List:new({ - { name = 'jdtls', version = 'v1.37.0' }, - { name = 'lombok-nightly', version = 'nightly' }, - { name = 'java-test', version = '0.40.1' }, - { name = 'java-debug-adapter', version = '0.58.0' }, + { name = 'jdtls', version = config.jdtls.version }, + { name = 'lombok-nightly', version = config.lombok.version }, + { name = 'java-test', version = config.java_test.version }, + { + name = 'java-debug-adapter', + version = config.java_debug_adapter.version, + }, }) if config.jdk.auto_install then From 50c8ce09755fc72d1f839a2b93b154b661984881 Mon Sep 17 00:00:00 2001 From: s1n7ax Date: Tue, 24 Dec 2024 09:22:01 +0530 Subject: [PATCH 4/5] chore: document update --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ae7ccdd..6d4108b 100644 --- a/README.md +++ b/README.md @@ -355,14 +355,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 = { @@ -402,7 +412,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 5d8d87ccb42fd699f41656c3a6428aa4fc1ded09 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:26:48 +0530 Subject: [PATCH 5/5] chore(main): release 2.0.2 (#330) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9feae68..0a6c617 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.0.2](https://github.com/nvim-java/nvim-java/compare/v2.0.1...v2.0.2) (2024-12-24) + + +### Bug Fixes + +* runner cmd [#241](https://github.com/nvim-java/nvim-java/issues/241) ([#329](https://github.com/nvim-java/nvim-java/issues/329)) ([a36f50c](https://github.com/nvim-java/nvim-java/commit/a36f50c82f922f352d4ce7ac6a3c6b238b3e0a36)) + ## [2.0.1](https://github.com/nvim-java/nvim-java/compare/v2.0.0...v2.0.1) (2024-08-01)