vscode-allautocomplete icon indicating copy to clipboard operation
vscode-allautocomplete copied to clipboard

Don't show duplicates that AllAutoComplete has found

Open jackfranklin opened this issue 6 years ago • 2 comments

Hey,

Firstly, thank you for the great work on this plugin! It's improved my workflow a lot :)

I was wondering if it's possible to not include additions from AllAutoComplete in the case that they are duplicates?

e.g, often I'll have a variable, say foo, that is in two files, a.js and b.js. If I'm in a.js, the autocomplete will find foo twice:

  • VSCode's inbuilt autocomplete will find the reference in a.js
  • AllAutoComplete will find the reference in b.js.

This leads to foo being in the autocomplete menu twice. Is there anyway that AllAutoComplete can check if foo is present, before adding it to the autocomplete menu?

Thanks!

jackfranklin avatar Jul 25 '18 11:07 jackfranklin

VS Code does not have an API to determine the rest of items shown. I can try to be smarter by ignoring words in the current file but that would most likely start ignoring stuff that we do not want ignore like strings. Leaving it open to see if the language server can help (maybe ask for language specific words from the server and ignore them).

atishay avatar Jul 27 '18 23:07 atishay

Hi @atishay, I would also thank you for the excellent extension!

I just gave a brief look to the code and I wondering if you can't simply add a kind of global variable with the list of word you add to the trie and compare them before to be added with trie.add(), or something like that.

jota0222 avatar Apr 22 '23 01:04 jota0222