mirror of
https://github.com/Microsoft/vscode
synced 2024-10-13 06:48:17 +00:00
throw error when calling getWordRange with invalid regex
This commit is contained in:
parent
34bf3d97eb
commit
cb6f3e55e7
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue