-
Notifications
You must be signed in to change notification settings - Fork 161
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
ess company-tabnine backend #955
Comments
I'm surprised modifying
As a disclaimer I'm not a company user myself :-) |
Thank you. That worked. For others who may come here with the same issue, here are two approaches to the config in spacemacs (which would likely work very similarly in a plain .emacs init file) In the user-config section of .spacemacs
Alternatively, in a private layer, mylayer, (
For users of doom emacs, first uncomment
|
Thanks for letting us know! I'm reopening this because it's not clear to me why ess sets company-backends buffer locally the way it does. |
Setting them buffer locally is pretty standard. It's easier to manage effective backends per mode, since they tend to behave differently and ordering matters. |
Indeed. The idea is to make company work out of the box by default. Those familiar with company can overwrite |
Ah, OK. That all makes sense I guess. And if it's standard to treat it this way I suppose we can just close this issue then. |
I was wondering how to setup the user-config for ess-julia together using company-tabnine. |
company-tabnine is a completion backend for company mode. It provides completion based on a machine learning completer called TabNine
This backend works successfully in all modes except ess. Attempts to solve the problem included adding it as a company-backend to ess following the discussion in #565 or adding it to the list
ess-r-company-backends.
Completion is tested in the source buffer after starting an inferior R. However, the TabNIne backend completion is ignored in ESS. Switching to fundamental-mode immediately restores functionality.Example of one configuration attempt:
(require 'company-tabnine)
(add-to-list 'company-backends #'company-tabnine)
;; Trigger completion immediately.
(setq company-idle-delay 0)
;; Number the candidates (use M-1, M-2 etc to select completions).
(setq company-show-numbers t)
;; Use the tab-and-go frontend.
;; Allows TAB to select and complete at the same time.
(company-tng-configure-default)
(setq company-frontends
'(company-tng-frontend
company-pseudo-tooltip-frontend
company-echo-metadata-frontend))
;; don't auto-insert ess backends
(setq ess-use-company nil)
(defun my-ess-config ()
(make-variable-buffer-local 'company-backends)
(add-to-list 'company-backends
'(company-tabnine company-R-args company-R-objects company-dabbrev-code :separate)))
(add-hook 'ess-mode-hook #'my-ess-config)
The text was updated successfully, but these errors were encountered: