Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(mason-tool-installer-nvim): Use mappings function for null-ls names #841

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lua/astrocommunity/utility/mason-tool-installer-nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ return {
if plugin == "mason-lspconfig.nvim" then
mappings = require("mason-lspconfig").get_mappings().lspconfig_to_mason
elseif plugin == "mason-null-ls.nvim" then
mappings = require("mason-null-ls.mappings.source").null_ls_to_package
mappings = require("mason-null-ls.mappings.source").getPackageFromNullLs
elseif plugin == "mason-nvim-dap.nvim" then
mappings = require("mason-nvim-dap.mappings.source").nvim_dap_to_package
end
if mappings and mappings[target] then target = mappings[target] end
if mappings then
if type(mappings) == "table" and mappings[target] then
target = mappings[target]
elseif type(mappings) == "function" and mappings(target) then
target = mappings(target)
end
end
if not target_lookup[target] then table.insert(opts.ensure_installed, target) end
end
end
Expand Down
Loading