mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 16:39:06 +02:00
fix(rust): only use mason.nvim if it is present (#4963)
## Description Fix the lang/rust extra for users that don't use mason. Uses the fix suggested in https://github.com/LazyVim/LazyVim/issues/4957#issuecomment-2521787846, which works perfectly! ## Related Issue(s) Fixes https://github.com/LazyVim/LazyVim/issues/4957 ## Screenshots n/a ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. Co-authored-by: Felix Rath <frath@cloudflare.com>
This commit is contained in:
parent
b2f750558a
commit
5ddad99bac
1 changed files with 11 additions and 9 deletions
|
@ -97,16 +97,18 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
local package_path = require("mason-registry").get_package("codelldb"):get_install_path()
|
if LazyVim.has("mason.nvim") then
|
||||||
local codelldb = package_path .. "/extension/adapter/codelldb"
|
local package_path = require("mason-registry").get_package("codelldb"):get_install_path()
|
||||||
local library_path = package_path .. "/extension/lldb/lib/liblldb.dylib"
|
local codelldb = package_path .. "/extension/adapter/codelldb"
|
||||||
local uname = io.popen("uname"):read("*l")
|
local library_path = package_path .. "/extension/lldb/lib/liblldb.dylib"
|
||||||
if uname == "Linux" then
|
local uname = io.popen("uname"):read("*l")
|
||||||
library_path = package_path .. "/extension/lldb/lib/liblldb.so"
|
if uname == "Linux" then
|
||||||
|
library_path = package_path .. "/extension/lldb/lib/liblldb.so"
|
||||||
|
end
|
||||||
|
opts.dap = {
|
||||||
|
adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb, library_path),
|
||||||
|
}
|
||||||
end
|
end
|
||||||
opts.dap = {
|
|
||||||
adapter = require("rustaceanvim.config").get_codelldb_adapter(codelldb, library_path),
|
|
||||||
}
|
|
||||||
vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {})
|
vim.g.rustaceanvim = vim.tbl_deep_extend("keep", vim.g.rustaceanvim or {}, opts or {})
|
||||||
if vim.fn.executable("rust-analyzer") == 0 then
|
if vim.fn.executable("rust-analyzer") == 0 then
|
||||||
LazyVim.error(
|
LazyVim.error(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue