Sarcasm / company-irony

company-mode completion back-end for irony-mode
118 stars 11 forks source link

Irony doesn't update completion base on the fly #42

Open steughar opened 6 years ago

steughar commented 6 years ago
** company
#+begin_src emacs-lisp :tangle yes

  (use-package company
    :ensure t
    :config
    (setq company-idle-delay 0)
    (setq company-minimum-prefix-length 1))

  (with-eval-after-load 'company
    (define-key company-active-map (kbd "M-n") nil)
    (define-key company-active-map (kbd "M-p") nil)
    (define-key company-active-map (kbd "C-n")  #'company-select-next)
    (define-key company-active-map (kbd "C-p")  #'company-select-previous))
#+end_src

** irony
#+begin_src emacs-lisp :tangle yes
  (use-package company-irony
    :ensure t
    :config
    (require 'company)
    (add-to-list 'company-backends 'company-irony))

  (use-package irony
    :ensure t
    :config
    (add-hook 'c++-mode-hook 'irony-mode)
    (add-hook 'c-mode-hook 'irony-mode)
    (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))

  (with-eval-after-load 'company
    (add-hook 'c++-mode-hook 'company-mode)
    (add-hook 'c-mode-hook 'company-mode)
    (add-hook 'emacs-lisp-mode-hook 'company-mode))

  (when (boundp 'w32-pipe-read-delay)
    (setq w32-pipe-read-delay 0))
  (when (boundp 'w32-pipe-buffer-size)
    (setq irony-server-w32-pipe-buffer-size (* 64 1024)))
#+end_src

Part of config that set up company\irony\company-irony.

The problem is: when i type a new function for example:

int
bar(int a, int b) {
return(0);
}

in my main-function company doesn't propose my newly created function for auto-completion. Only when i kill buffer and after reopen this buffer, it will be available. When new variables come up in the scope it's add it to base on the fly.

int
main(void) {
int a;
a = 4; // on this point company will show me auto-completion for a
return(0);
}

What can i do, to make irony update base on the fly?