7ec467e270
* fix: extract const in jsx * Update src/services/refactors/extractSymbol.ts Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com> * Update src/services/refactors/extractSymbol.ts Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com> Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com>
21 lines
484 B
TypeScript
21 lines
484 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
// GH#35372
|
|
|
|
// @jsx: preserve
|
|
// @filename: main.tsx
|
|
////function foo() {
|
|
//// return <div>/*a*/<a>content</a>/*b*/</div>;
|
|
////}
|
|
|
|
goTo.select("a", "b");
|
|
edit.applyRefactor({
|
|
refactorName: "Extract Symbol",
|
|
actionName: "constant_scope_0",
|
|
actionDescription: "Extract to constant in enclosing scope",
|
|
newContent:
|
|
`function foo() {
|
|
const /*RENAME*/newLocal = <a>content</a>;
|
|
return <div>{newLocal}</div>;
|
|
}`
|
|
});
|