8000 Completion is not triggered after member access operators · Issue #45 · Sarcasm/company-irony · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Completion is not triggered after member access operators #45

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

Open
Pouya-moh opened this issue Jul 17, 2019 · 5 comments
Open

Completion is not triggered after member access operators #45

Pouya-moh opened this issue Jul 17, 2019 · 5 comments

Comments

@Pouya-moh
Copy link

Hi. First thanks for awesome package. I am having some trouble with company-irony: After typing . for class members or :: for namespace the company menu is not shown.

In my settings I have company-clang-begin-after-member-access set to 1, however, with company-irony backend it seems it is not respected. If I remove the company-irony backend and use the company-clan then . and :: triggers completion.

I opened an issue in company repo (company-mode/company-mode#534) but I was suggested to post it here and I think it is right.

The relevant part of my setup reads as follow:

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

(use-package company-c-headers
  :ensure t)

(use-package company-irony
  :ensure t
  :config
  (setq company-backends '((company-c-headers
			    company-dabbrev-code
			    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))

Any idea?

@Sarcasm
Copy link
Owner
Sarcasm commented Jul 21, 2019

What happens if you do M-: (company-irony-prefix) RET after . or ::?
If this function returns something, then irony is okay, and something is tampering with it, maybe company-dabbrev-code?

@Pouya-moh
Copy link
Author

Thanks for swift response.

What happens if you do M-: (company-irony-prefix)RETafter.or::`?

It returns ("" . t)

Is this the expected return?

@Sarcasm
Copy link
Owner
Sarcasm commented Jul 22, 2019

Yeah, I think it is okay, it would expect nil or 'stop if irony could not do anything.
Can you try to set just irony as a backend?

  (setq company-backends '(company-irony))

@Pouya-moh
Copy link
Author

Interestingly enough, keeping company-irony as the only backend solves the issue. Am I going to miss something important in terms of completion if I keep the backends to company-irony only?

@Sarcasm
Copy link
Owner
Sarcasm commented Jul 24, 2019

The thing is, company interrogates the backends, and stop on the first one that can handle the request, other backends in the list aren't tried.

So you have to order the list from the most to the least specific backend.

That is, either:

  (setq company-backends '((
			    company-irony
                            company-c-headers
			    company-dabbrev-code
))))

Or:

  (setq company-backends '((company-c-headers
			    company-irony
			    company-dabbrev-code
))))

dabbrev-code is very generic.

And company-c-headers, I don't know.

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

2 participants
0