title: Can a `DocumentFormattingEditProvider` distinguish between a manual `Format Document` command and a `Format on Save` event?
body: <p>I'm authoring a VSCode <a href="https://code.visualstudio.com/blogs/2016/11/15/formatters-best-practices" rel="nofollow noreferrer">Formatter Extension</a>; it's little more than a class that extends <code>DocumentFormattingEditProvider</code> that I'm using to hook into VSCode's native <code>Format Document</code> and <code>Format On Save</code> functionality.</p>
  
  <p>I'd like to provide some kind of 'ignore these specific files' behavior (to mirror the behavior of the external tool I'm using to generate edits) such that matching documents ignore all <code>Format on Save</code> requests. I think it would be useful to allow the tool to still run on matching documents when a user explicitly enters a <code>Format Document</code> command from the Command Palette. Doing so would require knowing what event generated the formatting request, and only ignoring some of them.</p>
  
  <p>Is there there any way to detect the source of a format request, (<code>Format Document</code>, <code>Format on Save</code>, <code>Format on Paste</code>, etc.) either from within the body of <a href="https://code.visualstudio.com/api/references/vscode-api#DocumentFormattingEditProvider" rel="nofollow noreferrer"><code>provideDocumentFormattingEdits</code></a> or externally through another piece of the extension API?</p>
  
  <p>I've not been able to find anything in the API documentation, or in the state of the running extension (when I drop a breakpoint inside my <code>provideDocumentFormattingEdits</code> method) that could provide that information.</p>