Skip to content

Commit 2e97cff

Browse files
authored
Merge pull request #12898 from Microsoft/NavigateToFixForIIFE
NavigateTo is not working correctly for declarations in IIFEs
2 parents 757af49 + 97641e7 commit 2e97cff

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/services/services.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,9 +592,8 @@ namespace ts {
592592
else {
593593
declarations.push(functionDeclaration);
594594
}
595-
596-
forEachChild(node, visit);
597595
}
596+
forEachChild(node, visit);
598597
break;
599598

600599
case SyntaxKind.ClassDeclaration:
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// @Filename: file1.ts
4+
/////*1*/(function () {
5+
//// "use strict";
6+
//// function onResume() {
7+
//// };
8+
////} )();
9+
// @Filename: file2.ts
10+
/////*2*/class EventManager {
11+
//// public onResume(name: string) { }
12+
////}
13+
////class MyOtherEventManager {
14+
//// public onResume(name: string) { }
15+
////}
16+
verify.navigationItemsListCount(3, "onResume");
17+
verify.navigationItemsListCount(1, "onResume", undefined, test.marker("1").fileName);
18+
verify.navigationItemsListContains("onResume", "function", "onResume", "exact", test.marker("1").fileName);
19+
verify.navigationItemsListCount(2, "onResume", undefined, test.marker("2").fileName);

0 commit comments

Comments
 (0)