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

snippets candidate not present in company in python-mode #942

Closed
laishulu opened this issue Oct 10, 2018 · 3 comments
Closed

snippets candidate not present in company in python-mode #942

laishulu opened this issue Oct 10, 2018 · 3 comments
Labels
is:support A request for user support: questions, how-to's, and discussions module:completion/company Pertains to Doom's :completion company module module:editor/snippets Pertains to Doom's :editor snippets module module:lang/python Pertains to Doom's :lang python module re:elisp Personal configuration issues, conflicts or questions status:resolved-elsewhere Issue was addressed outside of Doom, needing no action on Doom's part

Comments

@laishulu
Copy link

Observed behavior

yasnippets candidates do not present in company autocomplete.
Though I can see them from SPC s i, and expend them nicely.
the result of describe-variable for company backends is shown in the following screenshot
snipaste_2018-10-10_17-40-07

Expected behavior

when I input ifm, autocomplete should presents candidates of ifmain for me.

System information

Click to expand
- OS: darwin (x86_64-apple-darwin14.5.0)
- Emacs: 26.1 (May 31, 2018)
- Doom: 2.0.9 (develop cdf745e72a3e8bf9bef1f0fa4d051b00aab351e3)
- Graphic display: nil (daemon: nil)
- System features: NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS
- Details:
  ```elisp
  elc count: 0
  uname -a:  Darwin machw 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64 i386 MacBookPro10,1 Darwin
  modules:   (:feature (evil +everywhere) file-templates (lookup +docsets) snippets spellcheck (syntax-checker +childframe) workspaces :completion (helm +fuzzy) :ui doom-dashboard doom-modeline doom-quit evil-goggles fci hl-todo nav-flash treemacs (popup +all +defaults) unicode vc-gutter vi-tilde-fringe window-select :editor rotate-text :emacs ediff electric hideshow imenu vc :tools magit :lang emacs-lisp markdown (org +attach +babel +capture +export +present) python rust (sh +fish) :config)
  packages:  n/a
  exec-path: (/usr/local/opt/coreutils/libexec/gnubin /usr/local/opt/python/libexec/bin /usr/local/bin /usr/local/sbin /usr/bin /bin /usr/sbin /sbin ~/.cargo/bin ~/bin /usr/local/opt/fzf/bin /Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_10 /Applications/Emacs.app/Contents/MacOS/libexec-x86_64-10_10 /Applications/Emacs.app/Contents/MacOS/libexec /Applications/Emacs.app/Contents/MacOS/bin)
</details>
@hlissner
Copy link
Member

This is to be expected. Company will only use company-anaconda. (:separate company-capf company-yasnippet) is a fallback, in case anaconda fails.

You can either access snippet completion through C-x C-s, or by changing python's backends:

(set-company-backend! 'anaconda-mode '(company-anaconda company-yasnippet))

This will change company-backends to be:

((company-anaconda company-yasnippet)
 (:separate company-capf company-yasnippet)
 company-capf)

In python-mode.

@hlissner hlissner added the re:elisp Personal configuration issues, conflicts or questions label Oct 11, 2018
@laishulu
Copy link
Author

only works for new buffer, existing buffer is not affected.
can you help with this?

@laishulu
Copy link
Author

After checking the codes of doom, I find the company backend is modified here: https://github.com/hlissner/doom-emacs/blob/develop/modules/lang/python/config.el#L64

To enable company-yasnippet by default, the following codes works.

(after! anaconda-mode
  (set-company-backend! 'anaconda-mode '(company-anaconda company-yasnippet)))

@hlissner hlissner added is:support A request for user support: questions, how-to's, and discussions module:completion/company Pertains to Doom's :completion company module module:editor/snippets Pertains to Doom's :editor snippets module module:lang/python Pertains to Doom's :lang python module status:resolved-elsewhere Issue was addressed outside of Doom, needing no action on Doom's part labels Apr 7, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
is:support A request for user support: questions, how-to's, and discussions module:completion/company Pertains to Doom's :completion company module module:editor/snippets Pertains to Doom's :editor snippets module module:lang/python Pertains to Doom's :lang python module re:elisp Personal configuration issues, conflicts or questions status:resolved-elsewhere Issue was addressed outside of Doom, needing no action on Doom's part
Projects
None yet
Development

No branches or pull requests

2 participants