491
let baseScore: number;
492
if (labelPrefixMatch) {
494
>
495
>
// We give another boost to labels that are short, e.g. given
496
>
// files "window.ts" and "windowActions.ts" and a query of
497
>
// "window", we want "window.ts" to receive a higher score.
498
>
// As such we compute the percentage the query has within the
499
>
// label and add that to the baseScore.
500
>
const prefixLengthBoost = Math.round((query.normalized.length / label.length) * 100);
501
>
baseScore += prefixLengthBoost;
502
} else {
503
baseScore = LABEL_SCORE_THRESHOLD;