-
I'm looking to add a source for my plugin, to blink. For context, the buffer I would like blink to work in is a custom filetype but with a buftype of --codecompanion.integrations.blink
local M = {}
function M.new()
return setmetatable({}, { __index = M })
end
function M:get_trigger_characters()
return { "/" }
end
function M:enabled(context)
if context then
return vim.bo[context.bufnr].filetype == "codecompanion"
end
return true -- force this to be enabled for the purposes of this demo
end
function M:get_completions(context, callback)
print("ENABLED")
end
return M and my custom config: -- ...
sources = {
compat = {},
completion = {
enabled_providers = { "lsp", "path", "snippets", "buffer", "codecompanion" },
},
providers = {
codecompanion = {
name = "CodeCompanion",
module = "codecompanion.integrations.blink",
enabled = true,
},
},
},
-- ... I will only ever see the printed message Is this by design? Is there a way I could around this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It automatically disables itself on |
Beta Was this translation helpful? Give feedback.
It automatically disables itself on
buftype ~= ''
but that definitely seems like something we should change. While you're waiting, you can changeis_blocked_buffer()
inlib/utils.lua
to not check thebuftype