-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
New File opens untitled editor #10868
New File opens untitled editor #10868
Conversation
5cb7e06
to
9472dfb
Compare
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.
Looking quite good! Tested this with an active workspace, a multi-workspace and no workspace:
- Using the
New File
command creates an untitled editor widget - Saving (Ctrl+S) it delegates to the
SAVE_AS
mechanism - Untitled files (from my test extension) are marked as dirty
- Saving these also delegates to the
SAVE_AS
mechanism
I have some minor questions and comment though.
packages/filesystem/src/browser/filesystem-save-resource-service.ts
Outdated
Show resolved
Hide resolved
a85cab3
to
9689bc4
Compare
46d8a0b
to
40aaca6
Compare
…feature/open-untitled-editor
40aaca6
to
f64e087
Compare
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.
Looking good 👍
…feature/open-untitled-editor
…feature/open-untitled-editor Conflicts: CHANGELOG.md packages/plugin-ext/src/main/browser/documents-main.ts packages/plugin-ext/src/main/browser/editor/untitled-resource.ts
…feature/open-untitled-editor
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 confirmed that the behavior works well 👍
- creating untitled documents works
- creating multiple untitled documents
- the untitled document is closeable without a prompt if not dirty
- the untitled document produces a prompt if dirty using
save
- the untitled document produces a prompt if dirty and we close the editor
- the
save all
command does not apply for untitled documents (similarly to vscode) - performing
save all
will properly save workspace documents, but not untitled documents - toggling the
auto save
does not apply for untitled documents (does not produce a save)
I looked at the code at a high level and it seems fine to me as well.
…feature/open-untitled-editor
Rely on untitled scheme from eclipse-theia/theia#10868 to create an editor for a file that will be saved as the path passed on the command line. The protocol was changed to use `uri` instead of `filePath`. The python client was updated to keep compatibility with the new protocol, but the feature of opening non existent files is only implemented in the nodejs client.
Rely on untitled scheme from eclipse-theia/theia#10868 to create an editor for a file that will be saved as the path passed on the command line. The protocol was changed to use `uri` instead of `filePath`. The python client was updated to keep compatibility with the new protocol, but the feature of opening non existent files is only implemented in the nodejs client.
Rely on untitled scheme from eclipse-theia/theia#10868 to create an editor for a file that will be saved as the path passed on the command line. The protocol was changed to use `uri` instead of `filePath`. The python client was updated to keep compatibility with the new protocol, but the feature of opening non existent files is only implemented in the nodejs client.
@Tesbarmix1, I'm not sure what you mean; could you clarify? |
What it does
Fixes #3354 by building on #10608, and moving the code necessary to handle untitled resources into
core
rather thanplugin-ext
.How to test
Review checklist
Reminder for reviewers