Closed apmanol closed 1 year ago
whats the value of completion-at-point-functions
local to the buffer you are completing in?
If you instead see lsp completions, then you need to manually reorder the priorities (probably on your mode hook). If you want to see both I recommend cape-super-capf
Edit: I meant "completion-at-point-functions" instead of "codeium-completion-at-point"
a better way would be to prepend codeium-completion-at-point to current value of completion-at-point-functions and call it manually in buffers you want codeium completion , different modes have different buffer local values for completion , if you are trying to add a hook add an delay of few seconds so that its setup correctly after the default mode hooks have been setup.
(defun add-codeium-completion ()
(interactive)
(setq completion-at-point-functions
(cons 'codeium-completion-at-point
completion-at-point-functions))
(setq-local company-frontends
'(company-pseudo-tooltip-frontend
company-preview-frontend))
(setq company-minimum-prefix-length 0))
(defun remove-codeium-completion ()
(interactive)
(setq completion-at-point-functions
(delete 'codeium-completion-at-point
completion-at-point-functions))
(setq company-frontends
'(company-box-frontend company-preview-frontend))
(setq company-minimum-prefix-length 2))
for adding delay you can use :
(add-hook 'python-mode-hook
(lambda)
(run-with-timer 2 nil
(lambda()
(add-hook 'post-command-hook
#'add-codeium-completion))))
While what @akhil3417 have is fine, you probably want something much less aggressive, like
(add-hook 'python-mode-hook
(let ((buf (current-buffer)))
(run-with-timer 2 nil
(lambda ()
(with-current-buffer buf
(add-codeium-completion))))))
You would otherwise have a very hard time of turning codeium off.
Also, if you don't have any other deferred things, you shouldn't need the timer.
whats the value of
completion-at-point-functions
local to the buffer you are completing in? If you instead see lsp completions, then you need to manually reorder the priorities (probably on your mode hook). If you want to see both I recommendcape-super-capf
Edit: I meant "completion-at-point-functions" instead of "codeium-completion-at-point"
Its value is
(lsp-completion-at-point codeium-completion-at-point tags-completion-at-point-function)
Local in buffer xxx.cpp```
I removed the company-lsp
because it isn't supported anymore, from lsp-mode
and now codeium
is autocompleting only the comments in the code! That is some progress.
I replaced the company with corfu
and cape + capf
and things are much better now.
Would you like to leave the bug open, since the setup with the company
didn't go very smoothly?
Closing this since your issue is resolved. I created a new issue to track the particular problem you had with company.
Hello all,
trying to play around with this awesome software, bad it doesn't work in
C++
mode withlsp
enabled.A snippet of the
.emacs
can be found https://gist.github.com/apmanol/6ab0bb12174d3f1fc9b7b2ff1e4fa909 it's a setup withlsp + company + company lsp
.The server seems to work as it seems in the logs and in the
diagnose
but autocomplete doesn't work. Furthermore, withoutlsp mode
i.e. scratch, I can see suggestions and server communication.Probably, I miss something, but I can't find out anything.
thanks for any tips.