improve performance

This commit is contained in:
Zen
2018-05-09 22:42:44 +08:00
parent 34323b69fb
commit 91a15dc609
3 changed files with 6 additions and 3 deletions

View File

@@ -395,7 +395,7 @@ namespace ts.DocumentHighlights {
pushKeywordIf(keywords, node.getFirstToken(), SyntaxKind.AwaitKeyword);
}
// Do not cross function boundaries.
if (!isFunctionLike(node)) {
if (!isFunctionLike(node) && !isClassLike(node) && !isInterfaceDeclaration(node) && !isModuleDeclaration(node) && !isTypeAliasDeclaration(node) && !isTypeNode(node)) {
forEachChild(node, aggregate);
}
}

View File

@@ -3,6 +3,11 @@
////[|async|] function f() {
//// [|await|] 100;
//// [|a/**/wait|] [|await|] 200;
////class Foo {
//// async memberFunction() {
//// await 1;
//// }
////}
//// return [|await|] async function () {
//// await 300;
//// }

View File

@@ -7,7 +7,5 @@
//// await 300;
////}
verify.rangesAreOccurrences(false);
goTo.marker();
verify.occurrencesAtPositionCount(0);