diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index b8eb4a23..583981d4 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -6,26 +6,23 @@ return { }) end, - -- Extend auto completion + -- LSP for Cargo.toml { - "hrsh7th/nvim-cmp", - optional = true, - dependencies = { - { - "Saecki/crates.nvim", - event = { "BufRead Cargo.toml" }, - opts = { - completion = { - cmp = { enabled = true }, - }, + "Saecki/crates.nvim", + event = { "BufRead Cargo.toml" }, + opts = { + completion = { + crates = { + enabled = true, }, }, + lsp = { + enabled = true, + actions = true, + completion = true, + hover = true, + }, }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - opts.sources = opts.sources or {} - table.insert(opts.sources, { name = "crates" }) - end, }, -- Add Rust & related to treesitter @@ -96,21 +93,6 @@ return { opts = { servers = { rust_analyzer = { enabled = false }, - taplo = { - keys = { - { - "K", - function() - if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then - require("crates").show_popup() - else - vim.lsp.buf.hover() - end - end, - desc = "Show Crate Documentation", - }, - }, - }, }, }, },