-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
Untitled files aren't well supported in custom editors #114711
Labels
custom-editors
Custom editor API (webview based editors)
*duplicate
Issue identified as a duplicate of another issue(s)
under-discussion
Issue is under discussion for relevance, priority, approach
Milestone
Comments
@bpasero what's the deal with untitled files? Those are always text document, right? Who is owning them and disposing them? |
Can we have a meeting rather than Q&A in this issue please with everyone involved, I am not up to speed with the issues around untitled and custom editors and would like to get a intro + discussion in person. |
bpasero
added
the
under-discussion
Issue is under discussion for relevance, priority, approach
label
Jan 27, 2021
Marking as a duplicate of #115631 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
custom-editors
Custom editor API (webview based editors)
*duplicate
Issue identified as a duplicate of another issue(s)
under-discussion
Issue is under discussion for relevance, priority, approach
The custom editor flow is normally as follows:
fs
APIs to perform actions on that file URI.This flow is of course broken when the URI passed in isn't a file URI as the custom editor can no longer utilize the
fs
APIs. We currently don't have a good story on how to handle untitled files in custom editors. Taking the hex editor for example, if the user callsreopen editor with
->hex editor
on an untitled file the custom editor will crash due to the fs APIs failing. The current workaround is:vscode.workspace.textDocuments
..getText()
on the matching text document.Uint8Array
as that is the form of datavscode.workspace.fs.readFile(uri)
would normally return.The text was updated successfully, but these errors were encountered: