You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"rename file" and "move to new file" refactors do not work when using files #24857
A known workaround is to use the include option instead of files. However, I am curious why this is necessary. I prefer to list the entry file and let TypeScript work the rest out. This is especially helpful when a folder has a combination of source and test files—TypeScript automatically knows not to include the test files because they are not part of the dependency graph.
If there is a good reason why these commands/refactors can't work with files, could we make the experience clearer? Why is the "move to new file" command suggested in VSCode when it leads to nothing? If so, perhaps this is an issue for VSCode.
Matt Bierner (@mjbvz) this seems like there are 2 open requests on same file. Can you check why? We do not expect open on same file without closing it first. Thats the assert that raised error in the log.
Interesting open requests:
Info 7 [11:4:3.833] request:
{"seq":0,"type":"request","command":"open","arguments":{"file":"/Users/OliverJAsh/Development/temp/typescript-files-refactors-test/src/index.ts","fileContent":"// ./src/index.ts\nimport foo from './other';"}}
nfo 52 [11:4:7.163] request:
{"seq":6,"type":"request","command":"open","arguments":{"file":"/Users/OliverJAsh/Development/temp/typescript-files-refactors-test/src/index.ts","fileContent":"// ./src/index.ts\nimport foo from './other';","scriptKindName":"TS","projectRootPath":"/Users/OliverJAsh/Development/temp/typescript-files-refactors-test"}}
Oliver Joseph Ash (@OliverJAsh) Can you please try collecting the TS Server log again in the latest VS Code insiders build. I made some changes to how we track opened files and haven't been able to reproduce the duplicate open requests in recent VS Code builds
Oliver Joseph Ash (@OliverJAsh) The error you are seeing in the log, i think is fixed by #24613. Please try typescript@next and let us know if you still see the issue. Thank you.
Oliver Joseph Ash (@OliverJAsh) Sorry for getting back but can you please try your repro with typescript@next and see if it repros. Providing log if it repros will help. Thanks.
Oliver Joseph Ash (@OliverJAsh) its been now fixed by #26280 Please verify with typescript@next and report back with tsserver log if it still repros. Thank you,
It fixes the problem—thank you! One small thing though: it adds the new file to files even though it doesn't need to be (when it's included via the dependency graph of existing files).
Oliver Joseph Ash (@OliverJAsh) can you please share tsserver log where your newFile gets added to the files list? I don't see that when I do it with typescript@next
Activity
mhegazy commentedon Jun 11, 2018
Can you share the log from your tsserver? i suspect it is a duplicate of #24613
OliverJAsh commentedon Jun 12, 2018
Mohamed Hegazy (@mhegazy) Does this help? tsserver.log
mhegazy commentedon Jun 12, 2018
This looks different.
sheetalkamat commentedon Jun 13, 2018
Matt Bierner (@mjbvz) this seems like there are 2 open requests on same file. Can you check why? We do not expect open on same file without closing it first. Thats the assert that raised error in the log.
Interesting open requests:
mjbvz commentedon Jun 27, 2018
Oliver Joseph Ash (@OliverJAsh) Can you please try collecting the TS Server log again in the latest VS Code insiders build. I made some changes to how we track opened files and haven't been able to reproduce the duplicate open requests in recent VS Code builds
OliverJAsh commentedon Jun 28, 2018
Matt Bierner (@mjbvz) In this log I attempt to use the "move to new file" command as described in my original post.
tsserver.log
Matt Bierner (@mjbvz) Are you able to reproduce the issue as I described?
mhegazy commentedon Jun 30, 2018
Oliver Joseph Ash (@OliverJAsh) looks like this log is using
typescript@2.9.1can you try withtypescript@next?sheetalkamat commentedon Jul 2, 2018
Oliver Joseph Ash (@OliverJAsh) The error you are seeing in the log, i think is fixed by #24613. Please try typescript@next and let us know if you still see the issue. Thank you.
43 remaining items
sheetalkamat commentedon Jan 3, 2019
Oliver Joseph Ash (@OliverJAsh) Sorry for getting back but can you please try your repro with typescript@next and see if it repros. Providing log if it repros will help. Thanks.
OliverJAsh commentedon Jan 5, 2019
Testing "move to new file", unfortunately that doesn't seem to help.
tsserver.log
sheetalkamat commentedon Jan 7, 2019
Oliver Joseph Ash (@OliverJAsh) Thank you for the log. Will investigate.
sheetalkamat commentedon Jan 11, 2019
Oliver Joseph Ash (@OliverJAsh) its been now fixed by #26280 Please verify with typescript@next and report back with tsserver log if it still repros. Thank you,
OliverJAsh commentedon Jan 13, 2019
It fixes the problem—thank you! One small thing though: it adds the new file to
fileseven though it doesn't need to be (when it's included via the dependency graph of existingfiles).sheetalkamat commentedon Jan 14, 2019
Oliver Joseph Ash (@OliverJAsh) can you please share tsserver log where your newFile gets added to the files list? I don't see that when I do it with typescript@next