mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
throw error when calling getWordRange with invalid regex
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user