-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
The incorrect result returned by company-fuzzy. #37
Comments
What is your value of See https://github.com/jcs-elpa/company-fuzzy#-2-cause-by-completion-styles. I've tried it and it works! :) |
Currently, I also have the following configuration for minibuffer completion: (use-package orderless
:config
(setq
;; https://github.com/oantolin/orderless#ivy
ivy-re-builders-alist '((t . orderless-ivy-re-builder))
;; Configure a custom style dispatcher (see the Consult wiki)
;; orderless-style-dispatchers '(+orderless-dispatch)
;; orderless-component-separator #'orderless-escapable-split-on-space
completion-styles '(orderless)
completion-category-defaults nil
completion-category-overrides '((file (styles . (partial-completion)))))
(defun anchor-first-component (pattern index _total)
(when (= index 0)
(cons 'orderless-regexp (concat "^" pattern))))
(defun with-anchored-first-component (fn &rest args)
(let ((orderless-style-dispatchers
(cons #'anchor-first-component orderless-style-dispatchers)))
(apply fn args)))
(advice-add 'company-calculate-candidates
:around #'with-anchored-first-component)
) So, how should I use your package and On the other hand, I've tried to comment out all the above (use-package flx)
;; ;; https://github.com/jcs-elpa/company-fuzzy
(use-package company-fuzzy
:hook (company-mode . company-fuzzy-mode)
:init
(setq company-fuzzy-sorting-backend 'flx
company-fuzzy-prefix-on-top nil
completion-styles '(partial-completion)
company-fuzzy-trigger-symbols '("." "->" "<" "\"" "'" "@")
)
) But I still can't get the desired result: |
Ah, hold on. I guess I was wrong about (let ((completion-styles nil))
(message "%s" (all-completions "iso" '("isophene" "isophenomenal"))) ; prints (isophene isophenomenal)
) So I guess that doesn't effect the result. Hmm... I will need you to do some tests since I am not able to reproduce this issue from my end.
(defun company-ispell (command &optional arg &rest ignored)
"`company-mode' completion backend using Ispell."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-ispell))
(prefix (when (company-ispell-available)
(company-grab-word)))
(candidates
(let ((words (company-ispell--lookup-words
arg
(or company-ispell-dictionary ispell-complete-word-dict)))
(completion-ignore-case t))
(if (string= arg "")
;; Small optimization.
words
+ (message "? %s" (all-completions arg words))
;; Work around issue #284.
(all-completions arg words))))
(kind 'text)
(sorted t)
(ignore-case 'keep-prefix))) My best guess is something is "blocking" so it doesn't returns the full list. 🤔 |
I try with
|
Can you try it without
I want to see what candidate is in used, can you show me the "output" from |
Loading server...done
Iedit default key binding is C-;
[yas] Prepared just-in-time loading of snippets (but no snippets found).
Loading /home/werner/.emacs.d/var/recentf-save.el (source)...done
Cleaning up the recentf list...done (0 removed)
Using default formatter emacs-lisp
For information about GNU Emacs and the GNU system, type C-h C-a.
Wrote /home/werner/.emacs.d/var/recentf-save.el
Package cl is deprecated
Automatic display of crossref information was turned on
Starting new Ispell process /usr/bin/aspell with default dictionary...done
Applying style hooks...
Loading /home/werner/Downloads/TopologicalMaterials/caj/SpaceGroupIrep/2012/.auctex-auto/SpaceGroupIrep.el (source)...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/fontenc.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/color.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/babel.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/english.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/array.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/bm.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/multirow.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/amsmath.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/amstext.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/amsbsy.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/amsopn.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/graphicx.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/pdfpages.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/eso-pic.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/ifthen.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/xcolor.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/textcomp.elc...done
Loading /home/werner/.emacs.d/straight/repos/auctex/style/listings.elc...done
Applying style hooks...done
TabNine server started.
Sorting LaTeX-environment...done
Removing duplicates...done
Beginning of buffer [6 times] |
I don't think the bug is from this package. We will need to further investigate it, can you try eval the following code and see if it returns anything? (require 'company-ispell) ; load before override
;;;###autoload
(defun company-ispell (command &optional arg &rest ignored)
"`company-mode' completion backend using Ispell."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-ispell))
(prefix (when (company-ispell-available)
(company-grab-word)))
(candidates
(let ((words '("isophones" ; manually set the candidates and see what happens.
"isophoria"
"isophorone"
"isophot"
"isophotal"
"isophote"
"isophote's"))
(completion-ignore-case t))
(if (string= arg "")
;; Small optimization.
words
;; Work around issue #284.
(all-completions arg words))))
(kind 'text)
(sorted t)
(ignore-case 'keep-prefix))) It should appear every candidate in the company's popup when you type |
It seems like it works?! Then there is something wrong with (defun company-ispell (command &optional arg &rest ignored)
"`company-mode' completion backend using Ispell."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-ispell))
(prefix (when (company-ispell-available)
(company-grab-word)))
(candidates
(message "arg: %s" arg) ; print the `arg` value!
(let ((words (company-ispell--lookup-words
arg
(or company-ispell-dictionary ispell-complete-word-dict)))
(completion-ignore-case t))
(message "reached: %s" words) ; make sure it goes through this line, print words to see what's the candidates.
(if (string= arg "")
;; Small optimization.
words
;; Work around issue #284.
(all-completions arg words))))
(kind 'text)
(sorted t)
(ignore-case 'keep-prefix))) |
Testing code: (require 'company-ispell) ; load before override
(defun company-ispell (command &optional arg &rest ignored)
"`company-mode' completion backend using Ispell."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'company-ispell))
(prefix (when (company-ispell-available)
(company-grab-word)))
(candidates
(message "arg: %s" arg) ; print the `arg` value!
(let ((words (company-ispell--lookup-words
arg
(or company-ispell-dictionary ispell-complete-word-dict)))
(completion-ignore-case t))
(message "reached: %s" words) ; make sure it goes through this line, print words to see what's the candidates.
(if (string= arg "")
;; Small optimization.
words
;; Work around issue #284.
(all-completions arg words))))
(kind 'text)
(sorted t)
(ignore-case 'keep-prefix))) Results: |
Can you give me the result from the |
No, I mean after your evaluate the function |
I use this package with the following configuration:
Now, I use the self-made english-wordlist to do some test as follows:
But, in Emacs, when I'm typing
isoph
, only a few completed candidates are listed, as shown below:Any hints for this problem?
See company-mode/company-mode#1380 (comment) for the related discussion.
Regards,
Zhao
The text was updated successfully, but these errors were encountered: