summaryrefslogtreecommitdiff
path: root/lua/config/plugins/completion.lua
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lua/config/plugins/completion.lua44
1 files changed, 43 insertions, 1 deletions
diff --git a/lua/config/plugins/completion.lua b/lua/config/plugins/completion.lua
index 7a02809..2b7e69d 100644
--- a/lua/config/plugins/completion.lua
+++ b/lua/config/plugins/completion.lua
@@ -1,5 +1,32 @@
return {
{
+ "lazydev.nvim",
+ -- NOTE: if lazyloaded, blink will break as `lze` doesn't packadd this package...
+ -- ft = "lua",
+ after = function(_)
+ -- NOTE: this is required to fix strange filtering in `lazydev.nvim`
+ --- @diagnostic disable-next-line: duplicate-set-field
+ require("lazydev.lsp").supports = function(client)
+ local client_names = {
+ -- Default client names from `lazydev.nvim`
+ "lua_ls",
+ "emmylua-analyzer-rust",
+ -- NOTE: I have `lua-language-server` name which was not in list
+ "lua-language-server",
+ }
+
+ return client and vim.tbl_contains(client_names, client.name)
+ end
+
+ require("lazydev").setup({
+ library = {
+ { path = "${3rd}/luv/library", words = { "vim%.uv" } },
+ { path = "snacks.nvim", words = { "Snacks" } },
+ },
+ })
+ end,
+ },
+ {
"blink.cmp",
event = "DeferredUIEnter",
after = function(_)
@@ -18,7 +45,22 @@ return {
ghost_text = { enabled = true },
},
- sources = { default = { "lsp", "path", "snippets", "buffer" } },
+ cmdline = {
+ completion = {
+ ghost_text = { enabled = false },
+ },
+ },
+
+ sources = {
+ default = { "lazydev", "lsp", "path", "snippets", "buffer" },
+ providers = {
+ lazydev = {
+ name = "LazyDev",
+ module = "lazydev.integrations.blink",
+ score_offset = 100,
+ },
+ },
+ },
fuzzy = {
sorts = { "exact", "score", "sort_text" },