diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index e989591..3570471 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -171,8 +171,15 @@ return { lazy = false, ft = { "rust" }, config = function() + local rust_analyzer_path = vim.fn.trim(vim.fn.system("rustup which rust-analyzer")) + if rust_analyzer_path == "" then + vim.notify("rust-analyzer not found! Install it with: rustup component add rust-analyzer", + vim.log.levels.ERROR) + return + end vim.g.rustaceanvim = { server = { + cmd = { rust_analyzer_path }, on_attach = lsp_attach, settings = { -- rust-analyzer language server configuration