diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 34df049..13d15ec 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -23,7 +23,7 @@ jobs: with: vimdoc: "nvim-java" dedupsubheadings: false - version: "Neovim >= 0.9.4" + version: "Neovim >= 0.11.5" demojify: true - name: create pull request diff --git a/CHANGELOG.md b/CHANGELOG.md index eefe98e..6734155 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [4.0.4](https://github.com/nvim-java/nvim-java/compare/v4.0.3...v4.0.4) (2025-12-11) + + +### Bug Fixes + +* **dap:** allow running mains without project ([#459](https://github.com/nvim-java/nvim-java/issues/459)) ([9b6c907](https://github.com/nvim-java/nvim-java/commit/9b6c907e2616a8ada8419d7b3e68e85056ba5d57)) + ## [4.0.3](https://github.com/nvim-java/nvim-java/compare/v4.0.2...v4.0.3) (2025-12-10) diff --git a/README.md b/README.md index 5137180..125650d 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Just install and start writing `public static void main(String[] args)`. :small_orange_diamond:details -**Requirements:** Neovim 0.11+ +**Requirements:** Neovim 0.11.5+ ### Using `vim.pack` diff --git a/doc/nvim-java.txt b/doc/nvim-java.txt index aba0b52..b90a1b7 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: 2025 December 03 +*nvim-java.txt* For Neovim >= 0.11.5 Last change: 2025 December 10 ============================================================================== Table of Contents *nvim-java-table-of-contents* @@ -54,7 +54,7 @@ HOW TO INSTALL *nvim-java-how-to-install* :small_orange_diamond:details ~ -**Requirements:** Neovim 0.11+ +**Requirements:** Neovim 0.11.5+ USING VIM.PACK ~ @@ -300,16 +300,14 @@ Use `vim.lsp.config()` to override the default JDTLS settings: >lua vim.lsp.config('jdtls', { - default_config = { - settings = { - java = { - configuration = { - runtimes = { - { - name = "JavaSE-21", - path = "/opt/jdk-21", - default = true, - } + settings = { + java = { + configuration = { + runtimes = { + { + name = "JavaSE-21", + path = "/opt/jdk-21", + default = true, } } } diff --git a/lua/java-dap/setup.lua b/lua/java-dap/setup.lua index 5973998..cf73550 100644 --- a/lua/java-dap/setup.lua +++ b/lua/java-dap/setup.lua @@ -41,11 +41,17 @@ end function Setup:enrich_config(config) config = vim.deepcopy(config) + -- skip enriching if already enriched + if config.mainClass and config.projectName and config.modulePaths and config.classPaths and config.javaExec then + return config + end + local main = config.mainClass - local project = config.projectName + -- when we set it to empty string, it will create a project with some random + -- string as name + local project = config.projectName or '' assert(main, 'To enrich the config, mainClass should already be present') - assert(project, 'To enrich the config, projectName should already be present') if config.request == 'launch' then self.java_debug:build_workspace(main, project, nil, false) diff --git a/lua/java/checks/nvim-version.lua b/lua/java/checks/nvim-version.lua index a18325f..f5b6b49 100644 --- a/lua/java/checks/nvim-version.lua +++ b/lua/java/checks/nvim-version.lua @@ -7,13 +7,11 @@ function M:run(config) return end - if vim.fn.has('nvim-0.11') ~= 1 then + if not vim.version.ge(vim.version(), '0.11.5') then local err = require('java-core.utils.errors') err.throw([[ - nvim-java is only tested on Neovim 0.11 or greater - Please upgrade to Neovim 0.11 or greater. - If you are sure it works on your version, disable the version check: - checks = { nvim_version = false }' + nvim-java is only tested on Neovim 0.11.5 or greater + Please upgrade to Neovim 0.11.5 or greater. ]]) end end