microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.32k stars 29.31k forks source link

'Move to new file' option isn't working #65448

Closed trulysinclair closed 5 years ago

trulysinclair commented 5 years ago

Issue Type: Bug

Click on a TypeScript method and hit Ctrl + . and click 'Move to new file`. At first nothing happened. I tried several times. Eventually I opened up the "TypeScript" output in the terminal and found the following error.

[Error  - 12:01:53 AM] 'getEditsForRefactor' request failed with error.
Error processing request. Debug Failure. Expected isNewFile for (only) new files. {"isNewFile":false,"hasScriptInfo":false}
Error: Debug Failure. Expected isNewFile for (only) new files. {"isNewFile":false,"hasScriptInfo":false}
    at IOSession.Session.mapTextChangeToCodeEdit (c:\Users\adria\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:125715:30)
    at c:\Users\adria\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:125707:73
    at Array.map (<anonymous>)
    at IOSession.Session.mapTextChangesToCodeEdits (c:\Users\adria\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:125707:36)
    at IOSession.Session.getEditsForRefactor (c:\Users\adria\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:125623:112)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (c:\Users\adria\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:124482:61)
    at c:\Users\adria\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:125824:88
    at IOSession.Session.executeWithRequestId (c:\Users\adria\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:125815:28)
    at IOSession.Session.executeCommand (c:\Users\adria\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:125824:33)
    at IOSession.Session.onMessage (c:\Users\adria\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:125846:35)
    at Interface.<anonymous> (c:\Users\adria\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:127106:27)
    at emitOne (events.js:116:13)
    at Interface.emit (events.js:211:7)
    at Interface._onLine (readline.js:282:10)
    at Interface._normalWrite (readline.js:424:12)
    at Socket.ondata (readline.js:141:10)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at Socket.Readable.push (_stream_readable.js:208:10)
    at Pipe.onread (net.js:594:20)

VS Code version: Code 1.30.1 (dea8705087adb1b5e5ae1d9123278e178656186a, 2018-12-18T18:12:07.165Z) OS version: Windows_NT x64 10.0.17763

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i3-7100T CPU @ 3.40GHz (4 x 3408)| |GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled| |Memory (System)|11.89GB (5.91GB free)| |Process Argv|C:\Users\adria\Desktop\Repositories - X-Tech\xtouch| |Screen Reader|no| |VM|0%|
Extensions (20) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|2.0.3 vscode-apollo|apo|1.2.7 github-markdown-preview|bie|0.0.2 markdown-checkbox|bie|0.1.1 markdown-emoji|bie|0.0.7 markdown-preview-github-styles|bie|0.1.4 markdown-yaml-preamble|bie|0.0.2 path-intellisense|chr|1.4.2 vscode-markdownlint|Dav|0.22.0 gitlens|eam|9.2.2 react-native-react-redux|EQu|1.9.2 vsc-material-theme|Equ|2.6.2 prettier-vscode|esb|1.7.3 docthis|joe|0.7.1 import-sorter|mik|3.2.0 cpptools|ms-|0.20.1 vscode-typescript-tslint-plugin|ms-|0.2.1 material-icon-theme|PKi|3.6.1 vscode-graphql|Pri|0.1.6 code-spell-checker|str|1.6.10
vscodebot[bot] commented 5 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

mjbvz commented 5 years ago

Thanks. This is already tracked upstream by https://github.com/Microsoft/TypeScript/issues/27867