最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

In a VS Code extension, how can I save a non-active document without formatting? - Stack Overflow

programmeradmin2浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论