If you confirm this completion, nothing happens because it just replaces the typed identifier, which already was the exact same text. Even if you haven't typed the end yet, it won't be inserted for you. So I think this completion item is pretty useless and could be removed. (In Sublime the popup heavily flickers if there are no other completions visible, and I wasn't able to find a good workaround for that on the client side).
This is an ok solution for the symptom, but imho the more correct fix here is to not offer the current binding. Otherwise you wouldn't get these somewhat useful completions:
When you type a new identifier, for example a struct or function definition, there is one completion item with the exact part of the name that you have already typed. This will update after each key stroke, because
CompletionList.isIncomplete
is always set totrue
, so the client will continuously re-request completions: https://github.com/julia-vscode/LanguageServer.jl/blob/864e4efde07611e309d315cf180003155ac990ad/src/requests/completions.jl#L98Example screenshot from VSCode:
If you confirm this completion, nothing happens because it just replaces the typed identifier, which already was the exact same text. Even if you haven't typed the
end
yet, it won't be inserted for you. So I think this completion item is pretty useless and could be removed. (In Sublime the popup heavily flickers if there are no other completions visible, and I wasn't able to find a good workaround for that on the client side).I was able to remove the completion by excluding exact matches at https://github.com/julia-vscode/LanguageServer.jl/blob/864e4efde07611e309d315cf180003155ac990ad/src/requests/completions.jl#L262
like this:
Although I don't know where the
x.names
exactly come from or whether there is a better solution.