admin管理员组

文章数量:1346676

The VS Code TextDocument type has a save method which saves the document normally; if autoformatting is enabled then that will run before saving. Separately, as documented in #38695, there exists a workbench.action.files.saveWithoutFormatting command which can be executed programmatically to save the document associated with the active text editor, without triggering autoformatting.

However, I don't see a way to use the latter with a document that is not associated with the active text editor. Does the VS Code API provide a way to save an arbitrary TextDocument without formatting?

本文标签: In a VS Code extensionhow can I save a nonactive document without formattingStack Overflow