Comments (13)
It is not codeium bug or faulty , but it is related to codeium . Codeium gives brief instructions to work with company but not with Corfu and Cape . That would be really useful for people if they write into readme how to integrate as many folks use Corfu and Cape . Anyway, thank you so much!
from codeium.el.
Yepper, here you go...
If using corfu
, I'd suggest also getting its sibling: cape.
This part matches above, if just wanted to run codeium
by itself outside of completion functions. I.e. matches above. It's bound to C-c p c
below.
(defun my/cape-codeium (&optional interactive)
"Allow codeium capf to be run by itself"
(interactive (list t))
(when interactive
;; if also testing copilot, clear their overlay before showing capf popup
(when (bound-and-true-p copilot-mode) (copilot-clear-overlay))
(cape-interactive #'codeium-completion-at-point)))
(keymap-global-set "C-c p c" #'my/cape-codeium)
For full gory effect, this is my setup for corfu
, cape
and eglot
...
This merges codeium
, eglot
, dabbrev
, cape-line
all together into one capf:
;; Turn on/off if want to use codeium completions
(defvar my/codeium-is-enabled t)
(defalias 'my/capf-eglot+et-al
(cape-capf-super
(cape-capf-silent
(when (bound-and-true-p my/codeium-is-enabled)
(cape-capf-properties #'codeium-completion-at-point
:annotation-function
#'(lambda (_) (propertize " Codeium"
'face font-lock-comment-face))
:company-kind (lambda (_) 'magic))))
(cape-capf-buster #'eglot-completion-at-point 'equal)
(cape-capf-properties #'cape-dabbrev
:annotation-function
#'(lambda (_) (propertize " Dabbrev"
'face font-lock-comment-face)))
;; if line gets too chatty
(cape-capf-silent
(cape-capf-properties #'cape-line
:annotation-function
#'(lambda (_) (propertize " Line"
'face font-lock-comment-face))))))
;; eglot, just to validate with just eglot
(defun my/cape-eglot(&optional interactive)
(interactive (list t))
(when interactive
;; if also testing copilot, clear their overlay before showing capf popup
(when (bound-and-true-p copilot-mode) (copilot-clear-overlay))
(cape-capf-buster (cape-interactive #'eglot-completion-at-point) 'equal)))
(keymap-set eglot-mode-map "C-c p g" #'my/cape-eglot)
;; Since merging eglot and others, assign a key binding to test
;; can remove if feel good
(defun my/cape-eglot+et-al(&optional interactive)
(interactive (list t))
(when interactive
;; if also testing copilot, clear their overlay before showing capf popup
(when (bound-and-true-p copilot-mode) (copilot-clear-overlay))
(cape-interactive #'my/capf-eglot+et-al)))
(keymap-set eglot-mode-map "C-c p z" #'my/cape-eglot+et-al)
(defun my/eglot-capf-config()
(setq-local completion-category-overrides '((file (styles partial-completion)))
completion-category-defaults nil
completion-styles '(orderless partial-completion basic)
;; add in file first, capf will know when in file mode
completion-at-point-functions (list #'cape-file #'my/capf-eglot+et-al)))
(add-hook 'eglot-managed-mode-hook #'my/eglot-capf-config)
You can do about the same for elisp
, lsp-mode
, org-mode
, etc. different mode completions. I'll leave that up to you.
Also, cape
has a bunch of other completions, like tempel
, keywords, emoji's, etc. that could also be combined in like above.
from codeium.el.
(for some reason, a local override of completion-at-point-functions does not seem to work:
Should work... here's fixed version:
(defun complete-codeium-bis ()
(interactive) ; Specify is command.
(let ((completion-at-point-functions #'codeium-completion-at-point))
(call-interactively 'company-complete)))
You had (call-interactively 'company-complete)
still in the let
binding vs in the body.
from codeium.el.
Since nothing to do with Codeium, you should probably start by looking at Corfu's repo for info and help, googling, etc. 🙂
With that said, I believe what you are looking for is corfu-candidate-overlay
:
https://code.bsdgeek.org/adam/corfu-candidate-overlay
from codeium.el.
Seeing the same in Doom Emacs. I suspect this isn't working with a language server that's running.
from codeium.el.
(defun complete-codeium ()
"Codeium." ; Doc string.
(interactive) ; Specify is command.
(setq completion-at-point-bkp completion-at-point-functions)
(setq completion-at-point-functions '(codeium-completion-at-point t))
(call-interactively 'company-complete)
(setq completion-at-point-functions completion-at-point-bkp)
)
Having the same issue, it seems that configuration to add codeium completion to completion-at-point-functions
does not work well - furthermore, I don't want to call codeium for each completion.
Here's a (probably very hacky) function to perform explicit codeium completion (my first elisp interactive function !)
You can then bind the function to specific key e.g. (global-set-key (kbd "s-n") 'complete-codeium)
(for some reason, a local override of completion-at-point-functions
does not seem to work:
(defun complete-codeium-bis ()
"Codeium - this does not work ??"
(interactive) ; Specify is command.
(let (
(completion-at-point-functions '(codeium-completion-at-point t)
)
(call-interactively 'company-complete)
)
)
)
from codeium.el.
I moved to Corfu from company. Any idea how we can use it with Corfu? Thank you for your suggestions!
from codeium.el.
Awesome! Yeah, actually my setup is with Corfu + Cape but not with Eglot. Thank you so much!
from codeium.el.
I just wanted to edit previous post whi is below as not disconnect from the subject.
When run codeium install, downloads arm version. I downloaded x64 manually and it seem that works. I need to add as well this line into init.el
(add-to-list 'completion-at-point-functuons #'codeium-completion-at-point) this solved the issue.
When run codeium init, it doesn't do anything. It supposed to launch the default browser and lead to codeium url. Another one is very slow somehow. I hope this report will help to other users if they face the similar issue. But thank you so much for help and suggestions!
Now that kind of error when run codeium init "Doing vfork: Exec format error: I have API key already in my config. No completions appear. No error in codeium diagnose. Just basic config as it's adviced in readme. I am confused.
from codeium.el.
Good-o, glad it's working. Probably should close this issue.
from codeium.el.
Hi, I reopened this as this is not a bug and related to my first question, Corfu, cape etc.
I would like to see the suggestions as inline not in the box. I disabled the view in box feature, now I don't see anything. I am aware of that I could do this with company-frontends variable (setq company-frontends '(company-pseudo-tooltip-unless-just-one-frontend company-preview-frontend).
How I can do that with Corfu, Cape, lsp-mode?
Could you help please? Thank you!
from codeium.el.
I close now. Thank you!
from codeium.el.
..
from codeium.el.
Related Issues (20)
- codeium-install yields: execute-extended-command: Cannot open load file: No such file or directory, codeium
- Suggestion: Mention integration with Elpy in troubleshooting resources HOT 1
- Building the language server? Support for OSs other than closed source Windon't, fakintosh/crabapple, and ...linux? HOT 2
- No C++ suggestions for code?
- Is codeium package available in melpa? HOT 2
- Language server port file not found after 60 seconds HOT 17
- Codeium with auth-source and password-store (aka pass) HOT 1
- Keeps asking for username and password for local server
- Any chance of supporting BSD? HOT 2
- Code isn't suggested inline HOT 1
- language_server_windows_x64.exe Memory Leak (VS Code 1.84.2) HOT 1
- Is Codeium chat going to be ported to codeium.el? HOT 2
- cape-capf-super seems not support codeium-completion-at-point? HOT 2
- How to get the overlay in the README with corfu and cape ? HOT 3
- Error running timer ‘codeium-defer-until-no-input’: (wrong-type-argument characterp manual) HOT 1
- Auto complete does not work in Emacs 29.3 started with in clean slate (`emacs -q`) HOT 1
- Function void: json-serialize, json-parse-buffer in Emacs 29.3
- Stopping codeium integration and restarting HOT 2
- Instant error when running codeium-install HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeium.el.