dunn / company-emoji

MOVED to codeberg
https://codeberg.org/egirl/company-emoji
82 stars 7 forks source link

Does not complete #10

Closed AtomicNess123 closed 3 years ago

AtomicNess123 commented 4 years ago

Upon installation (just require line, installed via Melpa), I type ( :cat however, not list of autocompletion shows up :(

tigermonkey commented 4 years ago

This happens for me as well. However it depends on the starting letter I think. For example with :c I get no completion menu, but with :g I do

c-alpha commented 4 years ago

Same here (Emacs 27.1, company-mode 20200813.2229, company-emoji 20200612.1902).

When I type :, the very first completion candidate I get is :grinning:, which happens to be the first entry in the list returned by company-emoji-list-create. Since completion candidates are sorted alphabetically, this means that all emojis starting with the letters a through f (inclusive) are not accessible.

Maybe somehow emoji-list, which is generated in line 195, seems to not be what it should? Didn't debug, so just guessing here.

dunn commented 4 years ago

Sorry I didn't get to this for so long. I'm trying to reproduce it now and having trouble. :a works for me, though to be fair it takes a bit of time, because the emoji list is so long. If it never actually loads for you, is there any debug or error message?

https://github.com/dunn/company-emoji/pull/13 was opened to address this, but now I'm not sure if it's necessary.

cc @tonyaldon

YellowApple commented 3 years ago

I'm experiencing the same issue (well, closer to what's described in #14, where candidates before :grinning: are present exactly once and then disappear). Either of the following two approaches in my ~/.emacs seem to do the trick in resolving the issue for me:

;; Approach in PR #13 
(require 'dash) ; assuming it's installed
(defconst company-emojis (-sort 'string-lessp (company-emoji-list-create)))

;; Bypass aliases and in-constant caching entirely
(defun company-emoji--add-aliases (aliases candidates) (company-emoji-list-create))
dunn commented 3 years ago

if the first fix is just sorting the list, can you try manually sorting the list in company-emoji-list.el and see if that helps? if it does, i can just add a step to the generator to sort it

mattford63 commented 3 years ago

I manually sorted the list and everything started working :smile:

mattford63 commented 3 years ago

Also though the aliases don't work for me, so perhaps they need to be inserted in order?

dunn commented 3 years ago

@mattford63 thanks for checking! i'll make the change

dunn commented 3 years ago

tagged as 2.6.1, let me know if you're still seeing problems

tigermonkey commented 3 years ago

I just checked and it's working for me. Thanks!

dunn commented 3 years ago

great! i'll close this, but lmk if there's any lingering problems