提交 2c7cb5cf 编写于 作者: S Sandeep Somavarapu

Settings search: Do not trust schema type instead check type of value to match search string

上级 553baf9b
......@@ -123,13 +123,11 @@ export abstract class AbstractSettingsModel extends Disposable {
keyMatchingWords.set(word, keyMatches.map(match => this.toKeyRange(setting, match)));
}
if (setting.value && (schema.type === 'string' || schema.enum)) {
const valueMatches = matchesContiguousSubString(word, setting.value);
if (valueMatches) {
valueMatchingWords.set(word, valueMatches.map(match => this.toValueRange(setting, match)));
} else if (schema.enum && schema.enum.some(enumValue => enumValue && !!matchesContiguousSubString(word, enumValue))) {
valueMatchingWords.set(word, []);
}
const valueMatches = typeof setting.value === 'string' ? matchesContiguousSubString(word, setting.value) : null;
if (valueMatches) {
valueMatchingWords.set(word, valueMatches.map(match => this.toValueRange(setting, match)));
} else if (schema.enum && schema.enum.some(enumValue => typeof enumValue === 'string' && !!matchesContiguousSubString(word, enumValue))) {
valueMatchingWords.set(word, []);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册