WorkspaceEdit doesn't support creating new files #30801
Labels
api
*duplicate
Issue identified as a duplicate of another issue(s)
feature-request
Request for new features or functionality
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 bothinsert
andreplace
).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 niceWorkspaceEdit
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?).The text was updated successfully, but these errors were encountered: