-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Adds linked editing for JSX tags #53284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
409d949
add tests and fourslash framework
iisaduan 94c4b65
cd
iisaduan a5192e8
first implementation, all tests except 3 (namespace) passes
iisaduan 21aa9e7
forgot to include into last commit
iisaduan 398f673
passes tests!
iisaduan 2bafe8d
change testing structure
iisaduan da0ddf1
change testing structure
iisaduan 9d7f32c
add correct content into tests (and some more test cases)
iisaduan 1fff99d
changes to getLinkedEdit.., saving some extra code in comments as well
iisaduan 0b0541d
remove comments, extra code, rename functions
iisaduan b70ee90
remove commented code and todos, also renames functions
iisaduan 25393f1
revert changes to lib
iisaduan bb98df0
Merge branch 'mirror' of https://github.com/iisaduan/TypeScript into …
iisaduan 6ba6321
link everything together (fix session client)
iisaduan 92875ce
missed renames
iisaduan 57ef9b8
linted
iisaduan 06afbbd
update baselines
iisaduan f4ec7bd
debugged whitespace issues
iisaduan 803b292
fixed some whitespace in code
iisaduan 34f5e40
adds better behavior for whitespace and trivia in fragments
iisaduan 03fa5bb
refactor getJsxLinkedEditAtPosition
iisaduan 4faee99
change type to TextSpan
iisaduan 6a1d3dd
updated tests to have textspan
iisaduan c8ea559
fix names
iisaduan fef7ab6
fix names
iisaduan bb720e1
Merge branch 'mirror' of https://github.com/iisaduan/TypeScript into …
iisaduan be34a1e
update protocol, refactor services
iisaduan 7f2f885
cleaned up tests
iisaduan 5164495
rename to match lsp
iisaduan a3bdf2e
rename tests
iisaduan 228e0ae
more-readable code/comments in getLinkedEditingAtPosition
iisaduan 32e43c8
add more tests + add `range` to function names
iisaduan da4f1cd
more tests
iisaduan db67aee
update `Body`, simplify call to `findAncestor`
iisaduan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,57 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
// the content of basic.tsx | ||
//const jsx = ( | ||
// <div> | ||
// </div> | ||
//); | ||
|
||
// @Filename: /basic.tsx | ||
/////*a*/const j/*b*/sx = ( | ||
//// /*c*/</*0*/d/*1*/iv/*2*/>/*3*/ | ||
//// </*4*///*5*/di/*6*/v/*7*/>/*8*/ | ||
////); | ||
////const jsx2 = ( | ||
//// <d/*9*/iv> | ||
//// <d/*10*/iv> | ||
//// <p/*11*/> | ||
//// <//*12*/p> | ||
//// </d/*13*/iv> | ||
//// </d/*14*/iv> | ||
////);/*d*/ | ||
|
||
const linkedCursors1 = { | ||
ranges: [{ start: test.markerByName("0").position, length: 3 }, { start: test.markerByName("5").position, length: 3 }], | ||
}; | ||
const linkedCursors2 = { | ||
ranges: [{ start: test.markerByName("9").position - 1, length: 3 }, { start: test.markerByName("14").position - 1, length: 3 }], | ||
}; | ||
const linkedCursors3 = { | ||
ranges: [{ start: test.markerByName("10").position - 1, length: 3 }, { start: test.markerByName("13").position - 1, length: 3 }], | ||
}; | ||
const linkedCursors4 = { | ||
ranges: [{ start: test.markerByName("11").position - 1, length: 1 }, { start: test.markerByName("12").position, length: 1 }], | ||
}; | ||
|
||
verify.linkedEditing( { | ||
"0": linkedCursors1, | ||
"1": linkedCursors1, | ||
"2": linkedCursors1, | ||
"3": undefined, | ||
"4": undefined, | ||
"5": linkedCursors1, | ||
"6": linkedCursors1, | ||
"7": linkedCursors1, | ||
"8": undefined, | ||
"9": linkedCursors2, | ||
"10": linkedCursors3, | ||
"11": linkedCursors4, | ||
"12": linkedCursors4, | ||
"13": linkedCursors3, | ||
"14": linkedCursors2, | ||
"a": undefined, | ||
"b": undefined, | ||
"c": undefined, | ||
"d": undefined, | ||
}); | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.