Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to file fails when selecting existing with: Expected isNewFile for (only) new files #54285

Closed
mjbvz opened this issue May 17, 2023 · 0 comments 路 Fixed by #54358
Closed
Assignees
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol Fix Available A PR has been opened for this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented May 17, 2023

Bug Report

馃攷 Search Terms

  • refactor
  • refactoring

馃晽 Version & Regression Information

5.1.0-dev.20230509

Repo

  1. For the code:
export const a = 1;
const b = 2;
console.log(a, b);
  1. Select the first line and try running move to existing file
  2. Select an existing file (in this case, an empty file)

bug

See the following error for the request:

2023-05-16 17:02:06.057 [trace] <semantic> Sending request: getEditsForRefactor (119). Response expected: yes. Current queue length: 0 {
    "file": "/Users/matb/projects/san/x.ts",
    "startLine": 1,
    "startOffset": 1,
    "endLine": 1,
    "endOffset": 20,
    "action": "Move to file",
    "refactor": "Move to file",
    "interactiveRefactorArguments": {
        "targetFile": "/Users/matb/projects/san/other.ts"
    }
}
2023-05-16 17:02:06.061 [trace] <semantic> Response received: getEditsForRefactor (119). Request took 3 ms. Success: false . Message: Error processing request. Debug Failure. Expected isNewFile for (only) new files. {"isNewFile":true,"hasScriptInfo":true}
Error: Debug Failure. Expected isNewFile for (only) new files. {"isNewFile":true,"hasScriptInfo":true}
    at IpcIOSession.mapTextChangeToCodeEdit (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:181970:13)
    at /Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:181962:46
    at Array.map (<anonymous>)
    at IpcIOSession.mapTextChangesToCodeEdits (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:181962:25)
    at IpcIOSession.getEditsForRefactor (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:181842:21)
    at getEditsForRefactor (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:180076:43)
    at /Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:182201:69
    at IpcIOSession.executeWithRequestId (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:182193:14)
    at IpcIOSession.executeCommand (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:182201:29)
    at IpcIOSession.onMessage (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:182243:51)
    at process.<anonymous> (/Users/matb/projects/vscode/extensions/node_modules/typescript/lib/tsserver.js:183823:14)
    at process.emit (node:events:513:28)
    at process.emit (/Users/matb/projects/vscode/node_modules/source-map-support/source-map-support.js:395:21)
    at emit (node:internal/child_process:939:14)
    at processTicksAndRejections (node:internal/process/task_queues:84:21)
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 5.1.2 milestone May 18, 2023
@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol labels May 18, 2023
@typescript-bot typescript-bot added the Fix Available A PR has been opened for this issue label May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Refactorings e.g. extract to constant or function, rename symbol Fix Available A PR has been opened for this issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants