Skip to content

Unify SuggestionTypes and FilterTypes enums

Warren Gifford requested to merge fa/unify-filters into master

Created by: attfarhan

Addresses https://github.com/sourcegraph/sourcegraph/issues/8151. Unifies SuggestionTypes and FilterTypes enums.

I changed SuggestionTypes to be a union type, which consists of FilterTypes and a new enum called NonFilterSuggestionTypes, which includes symbols, dir, and filters. The values in NonFilterSuggestionTypes are SuggestionTypes that don't have a corresponding filter. As a result, we use FilterTypes when referring to specific filter values, and SuggestionTypes is only used to define the type of suggestion results.

With this change, the other two duplication sites, the FILTERS map and SuggestionTypes, both rely on the FilterTypes enum, which becomes the canonical list of filters.

Merge request reports

Loading