add support crates.nvim
This commit is contained in:
parent
bf3e4855b9
commit
7b3220b36d
3 changed files with 30 additions and 2 deletions
|
|
@ -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
17
lua/plugins/crates.lua
Normal 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,
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue