throw error when calling getWordRange with invalid regex

This commit is contained in:
Johannes Rieken 2019-11-11 09:54:33 +01:00
parent 34bf3d97eb
commit cb6f3e55e7

View file

@ -239,8 +239,7 @@ export class ExtHostDocumentData extends MirrorTextModel {
} else if (regExpLeadsToEndlessLoop(regexp)) {
// use default when custom-regexp is bad
console.warn(`[getWordRangeAtPosition]: ignoring custom regexp '${regexp.source}' because it matches the empty string.`);
regexp = getWordDefinitionFor(this._languageId);
throw new Error(`[getWordRangeAtPosition]: ignoring custom regexp '${regexp.source}' because it matches the empty string.`);
}
const wordAtText = getWordAtText(