Skip to content

Commit 91a15dc

Browse files
committed
improve performance
1 parent 34323b6 commit 91a15dc

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/services/documentHighlights.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ namespace ts.DocumentHighlights {
395395
pushKeywordIf(keywords, node.getFirstToken(), SyntaxKind.AwaitKeyword);
396396
}
397397
// Do not cross function boundaries.
398-
if (!isFunctionLike(node)) {
398+
if (!isFunctionLike(node) && !isClassLike(node) && !isInterfaceDeclaration(node) && !isModuleDeclaration(node) && !isTypeAliasDeclaration(node) && !isTypeNode(node)) {
399399
forEachChild(node, aggregate);
400400
}
401401
}

tests/cases/fourslash/getOccurrencesAsyncAwait.ts

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
////[|async|] function f() {
44
//// [|await|] 100;
55
//// [|a/**/wait|] [|await|] 200;
6+
////class Foo {
7+
//// async memberFunction() {
8+
//// await 1;
9+
//// }
10+
////}
611
//// return [|await|] async function () {
712
//// await 300;
813
//// }

tests/cases/fourslash/getOccurrencesAsyncAwait3.ts

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@
77
//// await 300;
88
////}
99

10-
verify.rangesAreOccurrences(false);
11-
1210
goTo.marker();
1311
verify.occurrencesAtPositionCount(0);

0 commit comments

Comments
 (0)