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

Fix #153860 #155086

Merged
merged 1 commit into from
Jul 13, 2022
Merged

Fix #153860 #155086

merged 1 commit into from
Jul 13, 2022

Conversation

lramos15
Copy link
Member

This PR fixes #153860

Allows creation of a named untitled file.

cc @bpasero As I added an arg to the command. Also can menus take arguments I only see command ID.

@lramos15 lramos15 self-assigned this Jul 13, 2022
@lramos15 lramos15 added this to the July 2022 milestone Jul 13, 2022
Copy link
Contributor

@rzhao271 rzhao271 left a comment

Choose a reason for hiding this comment

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

LGTM

@lramos15 lramos15 merged commit 9bed873 into main Jul 13, 2022
@lramos15 lramos15 deleted the lramos15/legitimate-clam branch July 13, 2022 17:19
Yoyokrazy pushed a commit to Yoyokrazy/vscode that referenced this pull request Jul 13, 2022
const editorService = accessor.get(IEditorService);

await editorService.openEditor({
resource: undefined,
resource: args?.path ? URI.from({ scheme: Schemas.untitled, path: `Untitled-${args.path}` }) : undefined,
Copy link
Member

Choose a reason for hiding this comment

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

This might break untitled assumptions: either it should be an untitled with associated path on disk or not set a resource at all, why is this done?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

I see for what it was added for. I am a bit worried that this could break the following regex:

private static readonly UNTITLED_REGEX = /Untitled-\d+/;

So far, we had the assumption that Untitled-(number) is for untitled without associated resource and anything else has an associated resource. Untitled with associated resources typically do not ask where to save to because of the path.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm is there a way we could make this work? This is a very nice experience so far

andreamah pushed a commit that referenced this pull request Jul 14, 2022
jrieken pushed a commit that referenced this pull request Jul 18, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 27, 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.

Improve New File... experience
3 participants