-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8366 from Microsoft/Fix7611-2
Fix #7611: Add support for String Literal Types in find all refs and occurances
- Loading branch information
Showing
7 changed files
with
219 additions
and
38 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,14 @@ | ||
/// <reference path='fourslash.ts'/> | ||
|
||
////type Options = "[|option 1|]" | "option 2"; | ||
////let myOption: Options = "[|option 1|]"; | ||
|
||
let ranges = test.ranges(); | ||
for (let range of ranges) { | ||
goTo.position(range.start); | ||
|
||
verify.referencesCountIs(ranges.length); | ||
for (let expectedReference of ranges) { | ||
verify.referencesAtPositionContains(expectedReference); | ||
} | ||
} |
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,13 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////function foo(a: "[|option 1|]") { } | ||
////foo("[|option 1|]"); | ||
|
||
const ranges = test.ranges(); | ||
for (let r of ranges) { | ||
goTo.position(r.start); | ||
|
||
for (let range of ranges) { | ||
verify.occurrencesAtPositionContains(range, false); | ||
} | ||
} |
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' /> | ||
|
||
////var x = "[|string|]"; | ||
////function f(a = "[|initial value|]") { } | ||
|
||
const ranges = test.ranges(); | ||
for (let r of ranges) { | ||
goTo.position(r.start); | ||
verify.occurrencesAtPositionCount(0); | ||
} |
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' /> | ||
|
||
////var y: "string" = "string; | ||
////var x = "/*1*/string"; | ||
////function f(a = "/*2*/initial value") { } | ||
|
||
|
||
goTo.marker("1"); | ||
verify.renameInfoFailed(); | ||
|
||
goTo.marker("2"); | ||
verify.renameInfoFailed(); |
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,20 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////var o = { | ||
//// [|prop|]: 0 | ||
////}; | ||
//// | ||
////o = { | ||
//// "[|prop|]": 1 | ||
////}; | ||
//// | ||
////o["[|prop|]"]; | ||
////o['[|prop|]']; | ||
////o.[|prop|]; | ||
|
||
|
||
let ranges = test.ranges(); | ||
for (let range of ranges) { | ||
goTo.position(range.start); | ||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); | ||
} |
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,18 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
|
||
////interface AnimationOptions { | ||
//// deltaX: number; | ||
//// deltaY: number; | ||
//// easing: "ease-in" | "ease-out" | "[|ease-in-out|]"; | ||
////} | ||
//// | ||
////function animate(o: AnimationOptions) { } | ||
//// | ||
////animate({ deltaX: 100, deltaY: 100, easing: "[|ease-in-out|]" }); | ||
|
||
let ranges = test.ranges(); | ||
for (let range of ranges) { | ||
goTo.position(range.start); | ||
verify.renameLocations(/*findInStrings*/ false, /*findInComments*/ false); | ||
} |