forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
246 additions
and
90 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
97 changes: 97 additions & 0 deletions
97
tests/baselines/reference/linkedEditingJsxTag10.linkedEditing.txt
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,97 @@ | ||
=== /jsx0.tsx === | ||
const jsx = <> | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx1.tsx === | ||
const jsx = </> | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx2.tsx === | ||
const jsx = <div> | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx3.tsx === | ||
const jsx = </div> | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx4.tsx === | ||
const jsx = <div> </>; | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx5.tsx === | ||
const jsx = <> </div>; | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx6.tsx === | ||
const jsx = div> </div>; | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx7.tsx === | ||
const jsx = <div> /div>; | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx8.tsx === | ||
const jsx = <div </div>; | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx9.tsx === | ||
const jsx = <[|/*0*/div|]> </[|/*0*/div|]; | ||
|
||
=== 0 === | ||
{"ranges":[{"start":13,"length":3},{"start":20,"length":3}],"wordPattern":"[a-zA-Z0-9:\\-\\._$]*"} | ||
|
||
|
||
=== /jsx10.tsx === | ||
const jsx = <> </; | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx11.tsx === | ||
const jsx = < </>; | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx12.tsx === | ||
const jsx = > </>; | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx13.tsx === | ||
const jsx = <> />; | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx14.tsx === | ||
const jsx = <> <div> </> </div>; | ||
|
||
--No linked edits found-- | ||
|
||
|
||
=== /jsx15.tsx === | ||
const jsx = <div> <> </div> </>; | ||
|
||
--No linked edits found-- | ||
|
||
|
27 changes: 27 additions & 0 deletions
27
tests/baselines/reference/linkedEditingJsxTag11.linkedEditing.txt
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,27 @@ | ||
=== /customElements.tsx === | ||
const jsx = <[|/*0*/fbt:enum|] knownProp="accepted" | ||
unknownProp="rejected"> | ||
</[|/*0*/fbt:enum|]>; | ||
|
||
const customElement = <[|/*1*/custom-element|]></[|/*1*/custom-element|]>; | ||
|
||
const standardElement = | ||
<[|/*2*/Link|] href="/hello" passHref> | ||
<[|/*3*/Button|] component="a"> | ||
Next | ||
</[|/*3*/Button|]> | ||
</[|/*2*/Link|]>; | ||
|
||
=== 0 === | ||
{"ranges":[{"start":13,"length":8},{"start":73,"length":8}],"wordPattern":"[a-zA-Z0-9:\\-\\._$]*"} | ||
|
||
=== 1 === | ||
{"ranges":[{"start":108,"length":14},{"start":125,"length":14}],"wordPattern":"[a-zA-Z0-9:\\-\\._$]*"} | ||
|
||
=== 2 === | ||
{"ranges":[{"start":172,"length":4},{"start":269,"length":4}],"wordPattern":"[a-zA-Z0-9:\\-\\._$]*"} | ||
|
||
=== 3 === | ||
{"ranges":[{"start":209,"length":6},{"start":256,"length":6}],"wordPattern":"[a-zA-Z0-9:\\-\\._$]*"} | ||
|
||
|
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
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 |
---|---|---|
@@ -1,61 +1,19 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// for readability | ||
////const jsx = ( | ||
//// <div style={{ color: 'red' }}> | ||
//// <p> | ||
//// <img /> | ||
//// </p> | ||
//// </div> | ||
////); | ||
|
||
// @Filename: /customElements.tsx | ||
//// const jsx = </*1*/fbt/*2*/:en/*3*/um knownProp="accepted" | ||
//// /**/const jsx = <fbt:enum knownProp="accepted" | ||
//// unknownProp="rejected"> | ||
//// </f/*4*/bt:e/*5*/num>; | ||
//// </fbt:enum>; | ||
//// | ||
//// const customElement = </*6*/custom/*7*/-element/*8*/></custom/*9*/-element>; | ||
//// const customElement = <custom-element></custom-element>; | ||
//// | ||
//// const standardElement = | ||
//// </*10*/Link/*11*/ href="/hello" passHref> | ||
//// </*12*/But/*13*/ton component="a"> | ||
//// <Link href="/hello" passHref> | ||
//// <Button component="a"> | ||
//// Next | ||
//// </But/*14*/ton> | ||
//// </Li/*15*/nk>; | ||
//// </Button> | ||
//// </Link>; | ||
|
||
const wordPattern = "[a-zA-Z0-9:\\-\\._$]*"; | ||
|
||
const linkedCursors1 = { | ||
ranges: [{ start: test.markerByName("1").position, length: 8 }, { start: test.markerByName("4").position - 1, length: 8 }], | ||
wordPattern, | ||
}; | ||
const linkedCursors2 = { | ||
ranges: [{ start: test.markerByName("6").position, length: 14 }, { start: test.markerByName("9").position - 6, length: 14 }], | ||
wordPattern, | ||
}; | ||
const linkedCursors3 = { | ||
ranges: [{ start: test.markerByName("10").position, length: 4 }, { start: test.markerByName("15").position - 2, length: 4 }], | ||
wordPattern, | ||
}; | ||
const linkedCursors4 = { | ||
ranges: [{ start: test.markerByName("12").position, length: 6 }, { start: test.markerByName("14").position - 3, length: 6 }], | ||
wordPattern, | ||
}; | ||
|
||
verify.linkedEditing( { | ||
"1": linkedCursors1, | ||
"2": linkedCursors1, | ||
"3": linkedCursors1, | ||
"4": linkedCursors1, | ||
"5": linkedCursors1, | ||
"6": linkedCursors2, | ||
"7": linkedCursors2, | ||
"8": linkedCursors2, | ||
"9": linkedCursors2, | ||
"10": linkedCursors3, | ||
"11": linkedCursors3, | ||
"12": linkedCursors4, | ||
"13": linkedCursors4, | ||
"14": linkedCursors4, | ||
"15": linkedCursors3, | ||
}); | ||
verify.baselineLinkedEditing(); |