Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codeium not working #33

Open
b40yd opened this issue May 6, 2023 · 7 comments
Open

codeium not working #33

b40yd opened this issue May 6, 2023 · 7 comments

Comments

@b40yd
Copy link

b40yd commented May 6, 2023

my config:

(use-package codeium
    :ensure nil
    :quelpa (codeium :fetcher github :repo "Exafunction/codeium.el")
    :init
    ;; use globally
    (add-to-list 'completion-at-point-functions #'codeium-completion-at-point)

    :config
    (setq use-dialog-box t ;; do not use popup boxes
          codeium-mode-line t)

    ;; if you don't want to use customize to save the api-key
    ;; (setq codeium/metadata/api_key "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")

    ;; get codeium status in the modeline
    (setq codeium-mode-line-enable
          (lambda (api) (not (memq api '(CancelRequest Heartbeat AcceptCompletion)))))
    (add-to-list 'mode-line-format '(:eval (car-safe codeium-mode-line)) t)
    ;; alternatively for a more extensive mode-line
    ;; (add-to-list 'mode-line-format '(-50 "" codeium-mode-line) t)

    ;; use M-x codeium-diagnose to see apis/fields that would be sent to the local language server
    (setq codeium-api-enabled
          (lambda (api)
            (memq api '(GetCompletions Heartbeat CancelRequest GetAuthToken RegisterUser auth-redirect AcceptCompletion))))
    ;; you can also set a config for a single buffer like this:
    ;; (add-hook 'python-mode-hook
    ;;     (lambda ()
    ;;         (setq-local codeium/editor_options/tab_size 4)))

    ;; You can overwrite all the codeium configs!
    ;; for example, we recommend limiting the string sent to codeium for better performance
    (defun my-codeium/document/text ()
      (buffer-substring-no-properties (max (- (point) 3000) (point-min)) (min (+ (point) 1000) (point-max))))
    ;; if you change the text, you should also change the cursor_offset
    ;; warning: this is measured by UTF-8 encoded bytes
    (defun my-codeium/document/cursor_offset ()
      (codeium-utf8-byte-length
       (buffer-substring-no-properties (max (- (point) 3000) (point-min)) (point))))
    (setq codeium/document/text 'my-codeium/document/text)
    (setq codeium/document/cursor_offset 'my-codeium/document/cursor_offset))

M-x: codeium-install
M-x: codeium-init

but it's not working.

@fortenforge
Copy link
Contributor

Are you using a completion frontend or the default completion-at-point frontend?

@b40yd
Copy link
Author

b40yd commented May 9, 2023

Are you using a completion frontend or the default completion-at-point frontend?
my config:

  (use-package company
    :diminish
    :bind (("C-M-i" . company-complete)
           :map company-mode-map
           ("<backtab>" . company-yasnippet))
    :hook (after-init . global-company-mode)
    :init
    (setq company-tooltip-align-annotations t
          company-tooltip-limit 12
          company-idle-delay 0
          company-echo-delay (if (display-graphic-p) nil 0)
          company-minimum-prefix-length 1
          company-icon-margin 3
          company-require-match nil
          company-dabbrev-ignore-case nil
          company-dabbrev-downcase nil
          company-global-modes '(not erc-mode message-mode help-mode
                                     gud-mode eshell-mode shell-mode)
          company-backends '((company-capf :with company-yasnippet)
                             (company-dabbrev-code company-keywords company-files)
                             company-dabbrev)))

@fortenforge
Copy link
Contributor

@Alan-Chen99 do you have any ideas?

@VentGrey
Copy link

VentGrey commented Oct 3, 2023

Same issue here. After some experimentation I've noticed codeium fails to show completions when some other company completion backend is running, for example with eglot included in Emacs 29.1:

Without eglot running:
image

With eglot running:
image

@lucaspeixotoac
Copy link

lucaspeixotoac commented Jan 1, 2024

There is no suggestion for me if eglot is enabled. Once I turn off eglot, the suggestions come to appear.

Any idea on how to solving this? I would love to test this package.

@finalclass
Copy link

Same problem here. Any help?

@onsails
Copy link

onsails commented Apr 18, 2024

Same problem with config similar to @b40yd, in rust files with lsp-mode. Codeium completions work in comments section but for code there are only LSP completion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants