Skip to content
Merged
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions lua/modules/configs/completion/mason-lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ M.setup = function()
---A handler to setup all servers defined under `completion/servers/*.lua`
---@param lsp_name string
local function mason_lsp_handler(lsp_name)
-- rust_analyzer is configured using mrcjkb/rustaceanvim
-- warn users if they have set it up manually
if lsp_name == "rust_analyzer" then
local config_exist = pcall(require, "completion.servers." .. lsp_name)
if config_exist then
vim.notify(
[[
`rust_analyzer` is configured independently via `mrcjkb/rustaceanvim`. To get rid of this warning,
please REMOVE your LSP configuration (rust_analyzer.lua) from the `servers` directory and configure
`rust_analyzer` using the appropriate init options provided by `rustaceanvim` instead.]],
vim.log.levels.WARN,
{ title = "nvim-lspconfig" }
)
end
return
end

local ok, custom_handler = pcall(require, "user.configs.lsp-servers." .. lsp_name)
-- Use preset if there is no user definition
if not ok then
Expand Down
12 changes: 4 additions & 8 deletions lua/modules/configs/lang/rust.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
return function()
vim.g.rustaceanvim = {
-- DAP configuration
dap = {
adapter = {
type = "executable",
command = "lldb-vscode",
name = "rt_lldb",
},
},
-- Disable automatic DAP configuration to avoid conflicts with previous user configs
dap = { adapter = false, configuration = false },
}

require("modules.utils").load_plugin("rustaceanvim", nil, true)
end