Closed kade5 closed 2 months ago
Hi @kade5 thanks for the extensive issue.
Nice to hear you made it work by using the previous commit. Perhaps that solves issue #18 as well.
Let me do some more tests later tonight or tomorrow to decide if I'm going to revert the is_available part by just using the after/ loading.
Again, thanks!
Hi @kade5 please checkout the branch #23 and see if that does the trick!
Hi @kade5
Try adding opt = {}
or config = function() require("cmp-dbee").setup({}) end
to see if that does the trick.
Hi @MattiasMTS,
Thanks for all the work you're doing! completion works for me when I use the ms/updates branch #23 , and it also works on the main branch when I add config = function() require("cmp-dbee").setup({}) end
to my config.
Testing out your other suggestion, If I use the main branch and add just opt = {}
, without the config = function()
part it does not work.
Ah sorry, I meant opts = {}
instead of opt
. Glad to hear it worked out! Closing this now 😋
@kade5 @MattiasMTS hello, guys! 👋
Same thing happening to me. I'm trying from commit 9b0b969 (most recent changes from master branch until now).
It doesn't work even with:
config = function() require("cmp-dbee").setup({}) end
Screenshot:
CmpStatus output:
OBS: I also tried with opts = {}
(not opt)
Hi @MattiasMTS after #23 the plugin stopped working even when adding an explict require('cmp-dbee').setup()
call. When I open a sql file I see:
Hi @MattiasMTS after #23 the plugin stopped working even when adding an explict
require('cmp-dbee').setup()
call.
Thanks for highlighting it. cd409ef was the fix.
Accidentally forgot to remove the after setup. Hope that does the trick.
@Hugobsb could you send a screenshot of your setup? I'm wondering if you've the nvim-dbee and cmp-dbee dependency setup correctly since we have this https://github.com/MattiasMTS/cmp-dbee/blob/main/lua/cmp-dbee/source.lua#L6 which requires nvim-dbee to be loaded before cmp-dbee.
Accidentally forgot to remove the after setup. Hope that does the trick.
Yes! Thanks!
Hi @MattiasMTS after #23 the plugin stopped working even when adding an explict
require('cmp-dbee').setup()
call.Thanks for highlighting it. cd409ef was the fix.
Accidentally forgot to remove the after setup. Hope that does the trick.
@Hugobsb could you send a screenshot of your setup? I'm wondering if you've the nvim-dbee and cmp-dbee dependency setup correctly since we have this https://github.com/MattiasMTS/cmp-dbee/blob/main/lua/cmp-dbee/source.lua#L6 which requires nvim-dbee to be loaded before cmp-dbee.
Hi, @MattiasMTS! Thanks for the support.
About the screenshot, sure! Everything is public and available here.
All of this fixed the original issue. However, now it is an unavailable source name. Same as @Hugobsb issue
The above line is false until dbee is opened.
If I set is_available
to be true everything works
If I set
is_available
to be true everything works
Same for me. I ended up moving the setting of the is_available
into the constructor as a member function of the source class
--- Constructor for nvim-cmp source
---@param cfg Config
function source:new(cfg)
local is_available = self:is_available()
local cls = { handler = handler:new(cfg, is_available) }
setmetatable(cls, self)
self.__index = self
return cls
end
-- and some code...
function source:is_available()
return dbee.api.core.is_loaded() and dbee.api.ui.is_loaded()
end
And then I had to call the setup({})
after I had opened dbee
to make this true
.
@MattiasMTS , what would be a good solution for this, I can make a PR to fix this tomorrow using this approach if wanted?
Edit: See that you added the is_available
in the constructor of the handler in commit a40b22c668c9. Think the only problem now is how that variable is now set before dbee
is available? Which is solved by the above code snippet.
Hello,
I'm unable to get completion working. Lazy shows the plugin as loaded, but running :Cmpstatus shows cmp-dbee under "unknown source names".
My configuration can be found here https://github.com/kade5/kickstart.nvim/tree/dbee and my nvim-cmp configuration is on lines 653 to 770 in init.lua. See below.
I was able to get completion working using commit 0feabc1, but it doesn't work starting with commit 67976ff.