Improve mason deps' assets resolution

This commit is contained in:
TheDSCPL 2025-05-14 02:29:56 +00:00
parent 759e410984
commit 060b7ca704
No known key found for this signature in database
GPG key ID: 47B781E11EFDE8AD
3 changed files with 10 additions and 9 deletions

View file

@ -50,7 +50,7 @@ return {
local dap = require("dap")
dap.adapters.php = {
type = "executable",
command = "php-debug-adapter",
command = vim.fn.exepath("php-debug-adapter"),
args = {},
}
end,

View file

@ -111,13 +111,9 @@ return {
},
config = function(_, opts)
if LazyVim.has("mason.nvim") then
local package_path = LazyVim.get_pkg_path("codelldb")
local codelldb = package_path .. "/extension/adapter/codelldb"
local library_path = package_path .. "/extension/lldb/lib/liblldb.dylib"
local uname = io.popen("uname"):read("*l")
if uname == "Linux" then
library_path = package_path .. "/extension/lldb/lib/liblldb.so"
end
local codelldb = vim.fn.exepath("codelldb")
local codelldb_lib_ext = io.popen("uname"):read("*l") == "Linux" and ".so" or ".dylib"
local library_path = vim.fn.expand("$MASON/opt/lldb/lib/liblldb" .. codelldb_lib_ext)
opts.dap = {
adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb, library_path),
}

View file

@ -26,7 +26,12 @@ describe("Extra", function()
return not vim.tbl_contains(ignore, extra.modname)
end, extras)
local lsp_to_pkg = require("mason-lspconfig").get_mappings().lspconfig_to_package
local lsp_to_pkg = {}
if vim.fn.has("nvim-0.11") == 1 then
lsp_to_pkg = require("mason-lspconfig.mappings").get_mason_map().lspconfig_to_package
else
lsp_to_pkg = require("mason-lspconfig.mappings.server").lspconfig_to_package
end
local tsspec = Plugin.Spec.new({
import = "lazyvim.plugins.treesitter",