Skip to content

API proposal: save options #245406

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

samestep
Copy link
Contributor

@samestep samestep commented Apr 3, 2025

This PR resolves #245405 by proposing that the save method on TextDocument and NotebookDocument take an optional argument of type SaveOptions, which is essentially just a public subset of the options in the private ISaveOptions interface. Specifically, the only one I've made public here is skipSaveParticipants; in keeping with the API guidelines, I've tried to be conservative while also making it easy to make other ISaveOptions properties public in the future, if desired.

This PR has a couple issues currently, for which I need a maintainer's help:

  1. The implementation is not gated behind isProposedApiEnabled. I tried to do this, but I could not figure out how to get a reference to any specific extension from within the src/vs/workbench/api/common/extHostDocumentData.ts and src/vs/workbench/api/common/extHostNotebookDocument.ts files where the code changes needed to occur. Please let me know how I can gate these properly!

  2. No tests. I wanted to add a couple tests, but it looked like they would belong in extensions/vscode-api-tests/src/singlefolder-tests/editor.test.ts and extensions/vscode-api-tests/src/singlefolder-tests/notebook.document.test.ts, and for the life of me I could not figure out how to run any of the tests under extensions/vscode-api-tests. Could information about that be added to the wiki? Once I know how to do it, I'd be happy to add those tests!

I also have a question about the weekly API call: the wiki page says it's "open to everyone", but I'm having trouble finding information about when it takes place and how to join. When is the next API call and how can I attend it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API to save a non-active document without formatting
2 participants