mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
Merge pull request #3846 from DickvdBrink/abstract-occurrences
Highlight Abstract occurrences
This commit is contained in:
@@ -4696,6 +4696,11 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
else if (modifier === SyntaxKind.AbstractKeyword) {
|
||||
if (!(container.kind === SyntaxKind.ClassDeclaration || declaration.kind === SyntaxKind.ClassDeclaration)) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// unsupported modifier
|
||||
return undefined;
|
||||
@@ -4708,7 +4713,13 @@ namespace ts {
|
||||
switch (container.kind) {
|
||||
case SyntaxKind.ModuleBlock:
|
||||
case SyntaxKind.SourceFile:
|
||||
nodes = (<Block>container).statements;
|
||||
// Container is either a class declaration or the declaration is a classDeclaration
|
||||
if (modifierFlag & NodeFlags.Abstract) {
|
||||
nodes = (<Node[]>(<ClassDeclaration>declaration).members).concat(declaration);
|
||||
}
|
||||
else {
|
||||
nodes = (<Block>container).statements;
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.Constructor:
|
||||
nodes = (<Node[]>(<ConstructorDeclaration>container).parameters).concat(
|
||||
@@ -4728,6 +4739,9 @@ namespace ts {
|
||||
nodes = nodes.concat(constructor.parameters);
|
||||
}
|
||||
}
|
||||
else if (modifierFlag & NodeFlags.Abstract) {
|
||||
nodes = nodes.concat(container);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Debug.fail("Invalid container kind.")
|
||||
@@ -4755,6 +4769,8 @@ namespace ts {
|
||||
return NodeFlags.Export;
|
||||
case SyntaxKind.DeclareKeyword:
|
||||
return NodeFlags.Ambient;
|
||||
case SyntaxKind.AbstractKeyword:
|
||||
return NodeFlags.Abstract;
|
||||
default:
|
||||
Debug.fail();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user