gocode icon indicating copy to clipboard operation
gocode copied to clipboard

go-autocomplete candidate duplicate

Open lienhua34 opened this issue 9 years ago • 2 comments

At my emacs, go-autocomplete gave me a duplicate candidate, dup

After I read the go-autocomplete.el, I found the following code,

(add-hook 'go-mode-hook #'(lambda ()
                           (add-to-list 'ac-sources 'ac-source-go)))

Because the ac-sources list default is '(ac-source-abbrev ac-source-dictionary ac-source-words-in-same-mode-buffers), the ac-sources will get the candidates both from ac-source-go and ac-source-words-in-samge-mode-buffers in go-mode buffer.

In my copy, I edited the go-autocomplete.el,

(add-hook 'go-mode-hook #'(lambda ()
                         (setq ac-sources '(ac-source-go ac-source-abbrev ac-source-dictionary))))

Then the duplicate candidate is gone, normal

lienhua34 avatar Sep 04 '16 15:09 lienhua34

I'm sorry! My english is poor. I have no idea whether you can understand what I say above . ^_^

lienhua34 avatar Sep 04 '16 15:09 lienhua34

Well by default gocode adds itself to the list, you can redefine the list to whatever you want I guess. The duplicates you get doesn't seem like they come from gocode. The type is missing, it's more like local code autocompletion. The backends you've added in go-autocomplete.el are not defined there or whatever, I don't know elisp.

nsf avatar Sep 04 '16 15:09 nsf