As discussed in https://github.com/clangd/clangd/issues/1082:
"Without all-scopes-completion, such nested symbols would indeed be unnecessary in the
index, because the only way you could get them as a completion result is if you're
invoking the completion in the nested scope (e.g. Foo::^), in which case result can be
obtained from the AST. All-scopes-completion breaks this assumption, so the decision needs to be reevaluated."
I tested this on the LLVM codebase and there was no significant increase in index size
(less than 1MB). I think this makes sense if we look at the additional data that is stored
in SymbolCollector::addDeclaration when IndexedForCodeCompletion is set:
- Signature: Empty string for enum constants
- SnippetSuffix: Empty
- Documentation: Empty most of the time
- ReturnType and Type: Same string for all enum constants within a enum, so only two additional strings per indexed enum
Just to make sure I understand:
By also removing the !isScoped() condition, in addition to changing the behaviour for the scenario described in https://github.com/clangd/clangd/issues/1082 (enum declared at class scope), you are also changing the behaviour for scenarios like this:
Completing Bar will now offer Foo::Bar when previously it didn't.
Is this your intention?