Community
Participate
Working Groups
Implementations of IASTCompletionContext.findBindings(...) can return duplicate bindings. Each implementation starts by searching the AST with the help of either CPPSemantics or CVisitor. Afterwards, the index is searched as well. This can result in bindings from the AST that are identical to bindings from the index. Although this does not produce any negative side-effects (as duplicate completion proposals are filtered out later on), it is clearly not ideal.
Created attachment 59404 [details] proposed patch This patch moves the index lookups into CPPSemantics and CVisitor. The index is used to get bindings from translation units and namespaces instead of searching through the AST. If there is no index, however, the AST is searched as per usual. The resulting IASTCompletionContext.findBindings(...) implementations now simply consist of a call to the appropriate CPPSemantics or CVisitor helper, followed by any necessary filtering of the bindings.
Avoiding duplicates in the first place is a good thing. I'll try it out.
Committed. Could not find a flaw.