-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
Fix #153860 #155086
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
const editorService = accessor.get(IEditorService); | ||
|
||
await editorService.openEditor({ | ||
resource: undefined, | ||
resource: args?.path ? URI.from({ scheme: Schemas.untitled, path: `Untitled-${args.path}` }) : undefined, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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.