Skip to content

Move to file refactor: Debug Failure. False expression: Changes overlapΒ #62378

@Andarist

Description

@Andarist

πŸ”Ž Search Terms

move to file debug failure changes overlap imports move to importing file

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

N/A

πŸ’» Code

/// <reference path='fourslash.ts' />

// @filename: /ctx.ts
//// export class ProcessorContext {}

// @filename: /possibleBreakpoints.ts
//// import { ProcessorContext } from "./ctx";
////
//// export class AllBreakpointsForSource {}
////
//// export function [|createSourceBreakpointsCache|]() {
////   return {
////     get: (cx: ProcessorContext, sourceId: string) => new AllBreakpointsForSource();
////   };
//// }

// @filename: /recordingProcessor.ts
//// import { createSourceBreakpointsCache } from "./possibleBreakpoints";
////
//// export class RecordingProcessor {
////   public allSourceBreakpointsCache = createSourceBreakpointsCache();
//// }

verify.moveToFile({
    newFileContents: {
        "/possibleBreakpoints.ts": `TODO: fill this in`,
        "/recordingProcessor.ts": `TODO: fill this in`,
    },
    interactiveRefactorArguments: { targetFile: "/recordingProcessor.ts" },
});

πŸ™ Actual behavior

This crashes with:

Error: Debug Failure. False expression: Changes overlap
Verbose Debug Information: {"pos":0,"end":70} and {"pos":9,"end":9}

πŸ™‚ Expected behavior

It should move the code correctly

Additional information about the issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: LS: Refactoringse.g. extract to constant or function, rename symbol

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions