For counting number of references clangd was relying on merging every
duplication of a symbol. Unfortunately this does not apply to FileIndex(and one
of its users' BackgroundIndex), since we get rid of duplication by simply
dropping symbols coming from non-canonical locations. So only one or two(coming
from canonical declaration header and defined source file, if exists)
replications of the same symbol reaches merging step.
This patch changes reference counting logic to rather count number of different
RefSlabs a given SymbolID exists.
NIT: maybe initialize with =false to avoid potential UB.
Digest seems uninitialized too, could also ={} for it.
Sorry if this was discussed before and I'm repeating myself, I vaguely remember something similar but not sure what the conclusion was.