vscode-allautocomplete
vscode-allautocomplete copied to clipboard
Don't show duplicates that AllAutoComplete has found
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!
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).
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.