From 917e69c24783ef64a509527c7fe6cae1f90e263a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 14 Jul 2025 18:25:34 +0000 Subject: [PATCH] Initial commit: Analyzing move to file refactor issue with React components Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com> --- .../fourslash/moveToNewFileReactComponent.ts | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/cases/fourslash/moveToNewFileReactComponent.ts diff --git a/tests/cases/fourslash/moveToNewFileReactComponent.ts b/tests/cases/fourslash/moveToNewFileReactComponent.ts new file mode 100644 index 00000000000..c3193b77722 --- /dev/null +++ b/tests/cases/fourslash/moveToNewFileReactComponent.ts @@ -0,0 +1,34 @@ +/// + +// @jsx: react + +// @Filename: /Component.tsx +////import React from 'react'; +//// +////export const ComponentA = () => { +//// return
Component A
; +////}; +//// +////[|export const ComponentB = () => { +//// return
Component B
; +////};|] + +verify.moveToNewFile({ + newFileContents: { + "/Component.tsx": +`import React from 'react'; + +export const ComponentA = () => { + return
Component A
; +}; +`, + + "/ComponentB.tsx": +`import React from 'react'; + +export const ComponentB = () => { + return
Component B
; +}; +`, + }, +}); \ No newline at end of file