add support crates.nvim

This commit is contained in:
Zoty 2026-04-13 16:08:21 -03:00
parent bf3e4855b9
commit 7b3220b36d
Signed by: Zoty
SSH key fingerprint: SHA256:WsGEGivgl37t3Mth6uugXMOgMCTR7QolIepNbC+j/tA
3 changed files with 30 additions and 2 deletions

View file

@ -1,6 +1,6 @@
return {
'saghen/blink.cmp',
dependencies = { 'rafamadriz/friendly-snippets' },
dependencies = { 'rafamadriz/friendly-snippets', 'saghen/blink.compat' },
version = '1.*',
---@module 'blink.cmp'
@ -30,7 +30,16 @@ return {
},
},
sources = {
default = { 'lsp', 'path', 'snippets', 'buffer' }
default = { 'lsp', 'path', 'snippets', 'buffer' },
per_filetype = {
toml = { 'lsp', 'path', 'snippets', 'buffer', 'crates' },
},
providers = {
crates = {
name = 'crates',
module = 'blink.compat.source',
},
},
},
fuzzy = {
implementation = 'prefer_rust_with_warning',

17
lua/plugins/crates.lua Normal file
View file

@ -0,0 +1,17 @@
return {
'Saecki/crates.nvim',
event = { 'BufRead Cargo.toml' },
opts = {
completion = {
crates = {
enabled = true,
},
},
lsp = {
enabled = true,
actions = true,
completion = true,
hover = true,
},
},
}