Skip to content

Update new file to create a new file - #155544

Merged
Logan Ramos (lramos15) merged 2 commits into
mainfrom
lramos15/betterNewFile
Jul 20, 2022
Merged

Update new file to create a new file#155544
Logan Ramos (lramos15) merged 2 commits into
mainfrom
lramos15/betterNewFile

Conversation

@lramos15

@lramos15 Logan Ramos (lramos15) commented Jul 18, 2022

Copy link
Copy Markdown
Member

Ideally with New File... we want the user to also be able to input a filename to create a file.

This will allow the creation of a file with a given file name using a best guess URI.

Benjamin Pasero (@bpasero) I assigned you since you mentioned the hot exit concerns I figured you might have insight into concerns surrounding the way I select a URI and create a file on disk.

@bpasero Benjamin Pasero (bpasero) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the direction.

There is now 2 somewhat similar commands for creating a file btw:

image

Comment thread src/vs/workbench/contrib/files/browser/fileCommands.ts Outdated
return;
}

await fileService.createFile(saveUri);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you set overwrite: true, this will throw an error if the file exists.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will investigate to see what that experience is like. I assume the native save dialog would warn you so it wouldn't be unexpected if we overwrite

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

This is a bit weird. So all the files are greyed out and if you select one it doesn't have a prompt saying this file will be overwritten. I'm not sure in this case then if it is safe to overwrite the file or if we should just fail out

@lramos15

Copy link
Copy Markdown
Member Author

I like the direction.

There is now 2 somewhat similar commands for creating a file btw:

image

I should look into how to avoid showing this in the command palette since this is only part of the Create New File.... flow, we don't need yet another new file command showing there

@lramos15
Logan Ramos (lramos15) merged commit 5465f25 into main Jul 20, 2022
@lramos15
Logan Ramos (lramos15) deleted the lramos15/betterNewFile branch July 20, 2022 12:57
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants