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

Use company-tabnine with c-c++ layer #12920

Closed
lipeng31 opened this issue Nov 11, 2019 · 4 comments
Closed

Use company-tabnine with c-c++ layer #12920

lipeng31 opened this issue Nov 11, 2019 · 4 comments
Labels
stale marked as a stale issue/pr (usually by a bot)

Comments

@lipeng31
Copy link

Hi. I'm new to emacs, and thanks a lot for the amazing work of spacemacs. Recently I got a problem when working with c-c++ layer and company-tabnine. The problem is that, when I use c-c++ layer, it seems to override the company-backends I set in my .spacemacs file, so I cannot use tabnine as the company backend. I did some web search and dived into c-c++ layer's code, but I can't figure out how to solve it.

I'm grateful for any suggestions.

@sei40kr
Copy link
Contributor

sei40kr commented Nov 11, 2019

I was working on TabNine backend
#11985

company-backends is overridden here:
https://github.com/syl20bnr/spacemacs/blob/develop/layers/%2Bcompletion/auto-completion/funcs.el#L98

In addition, if you're using lsp, it be also overridden by here:
https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-mode.el#L5335

@sei40kr
Copy link
Contributor

sei40kr commented Nov 11, 2019

The reason why I didn't merge the PR above is TabNine without semantic completion was terrible.
It seems TabNine has a feature to handle lsp inside, but it'll be difficult to use it in Spacemacs.

@lipeng31
Copy link
Author

@sei40kr Thank you for the reply. After I filed this issue, I made a further try by slightly modifying two 'add-company-backends' lines in layers/+lang/c-c++/packages.el, adding company-tabnine to the argument. I think it's very dirty, but it works fine.

How ever this method only works for the c-c++ layer, I still can't use tabnine when writing other languages like python. I believe it relates to the completion layer as you mentioned, but that's really beyond my knowledge.

Looking forward to your ultimate solution. Thank you very much.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Nov 11, 2020
@github-actions github-actions bot closed this as completed Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale marked as a stale issue/pr (usually by a bot)
Projects
None yet
Development

No branches or pull requests

2 participants