-
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.
fix(50068): Refactors trigger debug failure when JSX text has a ' and…
… a tag on the same line. (#51299) * fix(50068): rescan JsxText on JsxElement context * fix lint errors * add tests
- Loading branch information
1 parent
8bee69a
commit 88d25b4
Showing
5 changed files
with
97 additions
and
1 deletion.
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,24 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @jsx: preserve | ||
// @filename: a.tsx | ||
////function Foo() { | ||
//// const foo = [ | ||
//// /*a*/<div>' <span></span></div>/*b*/ | ||
//// ]; | ||
////} | ||
|
||
goTo.file("a.tsx"); | ||
goTo.select("a", "b"); | ||
edit.applyRefactor({ | ||
refactorName: "Extract Symbol", | ||
actionName: "constant_scope_1", | ||
actionDescription: "Extract to constant in global scope", | ||
newContent: | ||
`const newLocal = <div>' <span></span></div>; | ||
function Foo() { | ||
const foo = [ | ||
/*RENAME*/newLocal | ||
]; | ||
}` | ||
}); |
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,24 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @jsx: preserve | ||
// @filename: a.tsx | ||
////function Foo() { | ||
//// const foo = [ | ||
//// /*a*/<div>'" <span></span></div>/*b*/ | ||
//// ]; | ||
////} | ||
|
||
goTo.file("a.tsx"); | ||
goTo.select("a", "b"); | ||
edit.applyRefactor({ | ||
refactorName: "Extract Symbol", | ||
actionName: "constant_scope_1", | ||
actionDescription: "Extract to constant in global scope", | ||
newContent: | ||
`const newLocal = <div>'" <span></span></div>; | ||
function Foo() { | ||
const foo = [ | ||
/*RENAME*/newLocal | ||
]; | ||
}` | ||
}); |
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,24 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @jsx: preserve | ||
// @filename: a.tsx | ||
////function Foo() { | ||
//// const foo = [ | ||
//// /*a*/<div>text' <span>text' </span>text ' text " </div>/*b*/ | ||
//// ]; | ||
////} | ||
|
||
goTo.file("a.tsx"); | ||
goTo.select("a", "b"); | ||
edit.applyRefactor({ | ||
refactorName: "Extract Symbol", | ||
actionName: "constant_scope_1", | ||
actionDescription: "Extract to constant in global scope", | ||
newContent: | ||
`const newLocal = <div>text' <span>text' </span>text ' text " </div>; | ||
function Foo() { | ||
const foo = [ | ||
/*RENAME*/newLocal | ||
]; | ||
}` | ||
}); |
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,24 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
// @jsx: preserve | ||
// @filename: a.tsx | ||
////function Foo() { | ||
//// const foo = [ | ||
//// /*a*/<div>' {1}</div>/*b*/ | ||
//// ]; | ||
////} | ||
|
||
goTo.file("a.tsx"); | ||
goTo.select("a", "b"); | ||
edit.applyRefactor({ | ||
refactorName: "Extract Symbol", | ||
actionName: "constant_scope_1", | ||
actionDescription: "Extract to constant in global scope", | ||
newContent: | ||
`const newLocal = <div>' {1}</div>; | ||
function Foo() { | ||
const foo = [ | ||
/*RENAME*/newLocal | ||
]; | ||
}` | ||
}); |