29 lines
547 B
TypeScript
29 lines
547 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
// @jsx: preserve
|
|
// @filename: a.tsx
|
|
////function Foo() {
|
|
//// return (
|
|
//// <div>
|
|
//// /*a*/<></>/*b*/
|
|
//// </div>
|
|
//// );
|
|
////}
|
|
|
|
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 /*RENAME*/newLocal = <></>;
|
|
function Foo() {
|
|
return (
|
|
<div>
|
|
{newLocal}
|
|
</div>
|
|
);
|
|
}`
|
|
});
|