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

WorkspaceEdit doesn't support creating new files #30801

Closed
DanTup opened this issue Jul 16, 2017 · 1 comment
Closed

WorkspaceEdit doesn't support creating new files #30801

DanTup opened this issue Jul 16, 2017 · 1 comment
Assignees
Labels
api *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality

Comments

@DanTup
Copy link
Contributor

DanTup commented Jul 16, 2017

Not sure if this is a bug or just a missing feature!

I'm using WorkspaceEdit in my Code Actions provider but noticed that when a code action requires a new file (eg. creating a file from an import statement) it crashes because it can't find the file to modify (for both insert and replace).

I can't see anything on the API for allowing creation of new files, nor an easy way to detect if a file exists. I could obviously us node's fs class for this, but it seems a little weird to start doing that separate from the nice WorkspaceEdit class.

Is it valid to have WorkspaceEdit support creation of new files were required or is creating the files "manually" the expected way? I had a quick look at some other extensions (like TypeScript) but it seems like they don't handle it either (presumably none of their code actions need to create new files yet?).

@vscodebot vscodebot bot added the api label Jul 16, 2017
@jrieken jrieken added the feature-request Request for new features or functionality label Jul 17, 2017
@jrieken
Copy link
Member

jrieken commented Jul 17, 2017

Closing as dupe of #10659

@jrieken jrieken closed this as completed Jul 17, 2017
@jrieken jrieken added the *duplicate Issue identified as a duplicate of another issue(s) label Jul 17, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api *duplicate Issue identified as a duplicate of another issue(s) feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants