Allow empty or missing begin
This commit is contained in:
Родитель
6b4f4d7bfd
Коммит
c91ec4ff87
26
src/rule.ts
26
src/rule.ts
|
@ -601,19 +601,6 @@ export class RuleFactory {
|
|||
);
|
||||
}
|
||||
|
||||
if (!desc.begin) {
|
||||
if (desc.repository) {
|
||||
repository = mergeObjects({}, repository, desc.repository);
|
||||
}
|
||||
return new IncludeOnlyRule(
|
||||
desc.$vscodeTextmateLocation,
|
||||
desc.id,
|
||||
desc.name,
|
||||
desc.contentName,
|
||||
RuleFactory._compilePatterns(desc.patterns, helper, repository)
|
||||
);
|
||||
}
|
||||
|
||||
if (desc.while) {
|
||||
return new BeginWhileRule(
|
||||
desc.$vscodeTextmateLocation,
|
||||
|
@ -626,6 +613,19 @@ export class RuleFactory {
|
|||
);
|
||||
}
|
||||
|
||||
if (!desc.begin && !desc.end) {
|
||||
if (desc.repository) {
|
||||
repository = mergeObjects({}, repository, desc.repository);
|
||||
}
|
||||
return new IncludeOnlyRule(
|
||||
desc.$vscodeTextmateLocation,
|
||||
desc.id,
|
||||
desc.name,
|
||||
desc.contentName,
|
||||
RuleFactory._compilePatterns(desc.patterns, helper, repository)
|
||||
);
|
||||
}
|
||||
|
||||
return new BeginEndRule(
|
||||
desc.$vscodeTextmateLocation,
|
||||
desc.id,
|
||||
|
|
Загрузка…
Ссылка в новой задаче