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

Allow Untitled documents that do not require save dialog when closing #154664

Closed
sandipchitale opened this issue Jul 10, 2022 · 6 comments
Closed
Labels
api feature-request Request for new features or functionality workbench-untitled-editors Managing of untitled editors in workbench window

Comments

@sandipchitale
Copy link

sandipchitale commented Jul 10, 2022

Extensions may generate some content and show it in Untitled document with a specific language id so that syntax coloring and other possible language-specific features are activated. For example, the Helm extras loads Manifests, Templates, Values, Hooks, or Notes from a Helm release. It sets the correct language id for these Untitled documents. However, these documents are just previews, and as such users should not be required to save these preview documents. If they simply want to close the documents they should not encounter the Save dialog. Of course, they can click on Don't Save, but that is a hiccup. This hiccup also happens when closing the VSCode window. I guess this could be done by clearing the dirty flag of the editor/document. For security reasons, only the creating extension should be allowed to do so. Or this could be a flag while creating the document in the first place via vscode.workspace.openTextDocument 's options parameter. For example:

options?: { language?: string; content?: string; saveNotRequired?: boolean;}

@sandipchitale
Copy link
Author

sandipchitale commented Jul 14, 2022

I have seen some extensions use TextDocumentContentProvider, but that is too heavy and does not work well when the content is already available.

@roblourens roblourens assigned bpasero and unassigned roblourens Jul 16, 2022
@bpasero bpasero added feature-request Request for new features or functionality workbench-untitled-editors Managing of untitled editors in workbench window api labels Jul 16, 2022
@bpasero bpasero removed their assignment Jul 16, 2022
@vscodenpa vscodenpa added this to the Backlog Candidates milestone Jul 16, 2022
@vscodenpa
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@riccardoferretti
Copy link

Just came across this: #154457

Not sure how it relates and whether the handler will be available to extension authors?

@sandipchitale
Copy link
Author

sandipchitale commented Jul 25, 2022

@riccardoferretti I guess this is a special case of #154457. My request is to let untitled editors not require any Save/Discard/Cancel Dialog hiccup, under the control of the extension which creates the editor with pre-created content. Of course Save As, Pinning, etc should still be possible.

@vscodenpa
Copy link

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa
Copy link

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api feature-request Request for new features or functionality workbench-untitled-editors Managing of untitled editors in workbench window
Projects
None yet
Development

No branches or pull requests

5 participants