-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(51223): Go-to-definition for yield and await keyword; jump to res…
…pective function definition (#51838)
- Loading branch information
Showing
9 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
//// async function /*end1*/foo() { | ||
//// [|/*start1*/await|] Promise.resolve(0); | ||
//// } | ||
|
||
//// function notAsync() { | ||
//// [|/*start2*/await|] Promise.resolve(0); | ||
//// } | ||
|
||
verify.goToDefinition("start1", "end1"); | ||
verify.goToDefinition("start2", []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
//// [|/*start*/await|] Promise.resolve(0); | ||
|
||
verify.goToDefinition("start", []); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
//// class C { | ||
//// notAsync() { | ||
//// [|/*start1*/await|] Promise.resolve(0); | ||
//// } | ||
//// | ||
//// async /*end2*/foo() { | ||
//// [|/*start2*/await|] Promise.resolve(0); | ||
//// } | ||
//// } | ||
|
||
verify.goToDefinition("start1", []); | ||
verify.goToDefinition("start2", "end2"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
//// async function outerAsyncFun() { | ||
//// let /*end*/af = async () => { | ||
//// [|/*start*/await|] Promise.resolve(0); | ||
//// } | ||
//// } | ||
|
||
verify.goToDefinition("start", "end"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
//// function* /*end1*/gen() { | ||
//// [|/*start1*/yield|] 0; | ||
//// } | ||
//// | ||
//// const /*end2*/genFunction = function*() { | ||
//// [|/*start2*/yield|] 0; | ||
//// } | ||
|
||
verify.goToDefinition("start1", "end1"); | ||
verify.goToDefinition("start2", "end2"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
//// function* outerGen() { | ||
//// function* /*end*/gen() { | ||
//// [|/*start*/yield|] 0; | ||
//// } | ||
//// return gen | ||
//// } | ||
|
||
verify.goToDefinition("start", "end"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
//// class C { | ||
//// notAGenerator() { | ||
//// [|/*start1*/yield|] 0; | ||
//// } | ||
//// | ||
//// foo*/*end2*/() { | ||
//// [|/*start2*/yield|] 0; | ||
//// } | ||
//// } | ||
|
||
verify.goToDefinition("start1", []); | ||
verify.goToDefinition("start2", "end2"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
//// function* gen() { | ||
//// class C { [/*start*/yield 10]() {} } | ||
//// } | ||
|
||
verify.goToDefinition("start", []); |