Code Monkey home page Code Monkey logo

Comments (8)

Alan-Chen99 avatar Alan-Chen99 commented on August 23, 2024

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"

from codeium.el.

akhil3417 avatar akhil3417 commented on August 23, 2024

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))))

from codeium.el.

Alan-Chen99 avatar Alan-Chen99 commented on August 23, 2024

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.

from codeium.el.

Alan-Chen99 avatar Alan-Chen99 commented on August 23, 2024

Also, if you don't have any other deferred things, you shouldn't need the timer.

from codeium.el.

apmanol avatar apmanol commented on August 23, 2024

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"

Its value is
(lsp-completion-at-point codeium-completion-at-point tags-completion-at-point-function)
Local in buffer xxx.cpp```

from codeium.el.

apmanol avatar apmanol commented on August 23, 2024

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.

from codeium.el.

apmanol avatar apmanol commented on August 23, 2024

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?

from codeium.el.

fortenforge avatar fortenforge commented on August 23, 2024

Closing this since your issue is resolved. I created a new issue to track the particular problem you had with company.

from codeium.el.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.