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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing deleteFile function in VirtualTypeScriptEnvironment #2799

Closed
flurrux opened this issue Apr 23, 2023 · 3 comments · Fixed by #3173
Closed

missing deleteFile function in VirtualTypeScriptEnvironment #2799

flurrux opened this issue Apr 23, 2023 · 3 comments · Fixed by #3173

Comments

@flurrux
Copy link

flurrux commented Apr 23, 2023

the VirtualTypeScriptEnvironment interface has two file-related functions createFile and updateFile, but seemingly no deleteFile.

createFile: (fileName: string, content: string) => void
updateFile: (fileName: string, content: string, replaceTextSpan?: import("typescript").TextSpan) => void

is this intended?
i've tried using the VirtualTypeScriptEnvironment.sys.deleteFile function, but it is undefined.

my current workaround is to set the file contents to a single-space string (completely empty strings currently throw errors as reported here: #2713).
it's not too big an issue for me right now since my virtual files are not directly visible and their names are auto-incremented, but i figured this would be worth posting here.

@orta
Copy link
Contributor

orta commented Apr 24, 2023

I never needed one for the Playground, / twoslash so I never thought to add it - I think it makes sense to send a PR adding it 👍🏻

@typescript-bot
Copy link
Collaborator

Hello! As per #2804, we are automatically closing all open issues. Please see #2804 for a description of what issues and PRs can be accepted going forward.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 25, 2023
@marklundin
Copy link
Contributor

Just following up on this. Is there a reason deleteFile is no included? I could take a look at a PR, but wanted to make sure the omission is not by design

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants