This if a fix of a problem related to
https://github.com/clangd/clangd/issues/39. Currently, for this code:
c++ namespace ns { enum Color { Green }; enum class Vehicle { Car }; }
The following is true:
- Vehicle::Car scope is ns::Vehicle:: - it can't be accessed without spelling full enum class name
- Color::Green scope is ns:: because it can be accessed as ns::Car
However, this causes index FuzzyFind to show empty results when querying
ns::Color:: - Color::Green will only show up for ns::.
This patch changes the behavior and makes SymbolCollector treat plain enum
the same way it does handle enum class. Ideally, the index would point to the
same symbol for both ns::Green and ns::Color::Green but that increases
coupling since the enum information has to be propagated to the index builder
which is logically quite far from the SymbolCollector.