================ @@ -166,14 +166,29 @@ TextEdit toTextEdit(const FixItHint &FixIt, const SourceManager &M, std::optional<std::string> getCanonicalPath(const FileEntryRef F, FileManager &FileMgr); +/// A flag passed to getFormatStyleForFile() that specifies what kind of +/// formatting operation the returned FormatStyle will be used for. +enum class FormatKind { + // Formatting a snippet of synthesized code (e.g. a code snippet + // shown in a hover) that's not part of the main file. + Snippet, + // Formatting edits made by an editor action such as code completion + // or rename. + Replacements, + // Formatting the entire main file (or a range selected by the user, + // which can be arbitrarily long). + EntireFileOrRange ---------------- hokein wrote:
nit: this is the case we want to work around, not sure whether we need to separate the `Snippet` and `Replacements` cases. An alternative is to use a bool flag (`FormatFile`), which is simpler and avoids a new `FormatKind` enum. https://github.com/llvm/llvm-project/pull/84133 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits