From db54fbf6a022f2720f86c6b6d7383ba501211b80 Mon Sep 17 00:00:00 2001 From: Srinesh Nisala Date: Sun, 16 Feb 2025 17:18:48 +0530 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20nvim-java=20mason=20reg=20is=20added?= =?UTF-8?q?=20if=20the=20mason=20config=20does=20not=20consid=E2=80=A6=20(?= =?UTF-8?q?#355)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: nvim-java mason reg is added if the mason config does not consider parent conf * chore: format the config example --- README.md | 13 +++++++++++-- lazy.lua | 12 ++++++------ lua/java/config.lua | 9 +++++++++ lua/java/startup/mason-dep.lua | 10 ++++++++++ 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b2bce7f..3e2328c 100644 --- a/README.md +++ b/README.md @@ -366,7 +366,7 @@ want, following options are available -- load java test plugins java_test = { enable = true, - version = '0.43.0', + version = '0.40.1', }, -- load java debugger plugins @@ -377,7 +377,7 @@ want, following options are available spring_boot_tools = { enable = true, - version = '1.59.0', + version = '1.55.1', }, jdk = { @@ -416,7 +416,16 @@ want, following options are available -- will stop setup invalid_mason_registry = false, }, + + mason = { + -- These mason registries will be prepended to the existing mason + -- configuration + registries = { + 'github:nvim-java/mason-registry', + }, + }, } + ``` diff --git a/lazy.lua b/lazy.lua index 90e58b3..a352b8d 100644 --- a/lazy.lua +++ b/lazy.lua @@ -15,12 +15,12 @@ return { }, { 'williamboman/mason.nvim', - opts = { - registries = { - 'github:nvim-java/mason-registry', - 'github:mason-org/mason-registry', - }, - }, + -- opts = { + -- registries = { + -- 'github:nvim-java/mason-registry', + -- 'github:mason-org/mason-registry', + -- }, + -- }, }, }, } diff --git a/lua/java/config.lua b/lua/java/config.lua index beb552e..7383646 100644 --- a/lua/java/config.lua +++ b/lua/java/config.lua @@ -8,6 +8,7 @@ ---@field jdk { auto_install: boolean, version: string } ---@field notifications { dap: boolean } ---@field verification { invalid_order: boolean, duplicate_setup_calls: boolean, invalid_mason_registry: boolean } +---@field mason { registries: string[] } local config = { -- list of file that exists in root of the project root_markers = { @@ -83,6 +84,14 @@ local config = { -- will stop setup invalid_mason_registry = false, }, + + mason = { + -- These mason registries will be prepended to the existing mason + -- configuration + registries = { + 'github:nvim-java/mason-registry', + }, + }, } return config diff --git a/lua/java/startup/mason-dep.lua b/lua/java/startup/mason-dep.lua index f05e3a5..2e00762 100644 --- a/lua/java/startup/mason-dep.lua +++ b/lua/java/startup/mason-dep.lua @@ -1,6 +1,7 @@ local log = require('java.utils.log') local mason_ui = require('mason.ui') local mason_util = require('java.utils.mason') +local list_util = require('java-core.utils.list') local notify = require('java-core.utils.notify') local async = require('java-core.utils.async') local lazy = require('java.ui.lazy') @@ -13,6 +14,15 @@ local M = {} ---Install mason package dependencies for nvim-java ---@param config java.Config function M.install(config) + local mason_default_config = require('mason.settings').current + + local registries = list_util + :new(config.mason.registries) + :concat(mason_default_config.registries) + + require('mason').setup({ + registries = registries, + }) local packages = M.get_pkg_list(config) local is_outdated = mason_util.is_outdated(packages) From a43809938c756688c153edfec392dcf7b3af76bc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 07:38:07 +0530 Subject: [PATCH 2/2] chore(main): release 2.1.1 (#357) * chore(main): release 2.1.1 * Update CHANGELOG.md --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Srinesh Nisala --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48715b3..6c78ea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.1](https://github.com/nvim-java/nvim-java/compare/v2.1.0...v2.1.1) (2025-02-16) + + +### Bug Fixes + +* nvim-java mason reg is not added if the mason is not merging parent config in user end ([#355](https://github.com/nvim-java/nvim-java/issues/355)) ([db54fbf](https://github.com/nvim-java/nvim-java/commit/db54fbf6a022f2720f86c6b6d7383ba501211b80)) + ## [2.1.0](https://github.com/nvim-java/nvim-java/compare/v2.0.2...v2.1.0) (2025-01-26)