summaryrefslogtreecommitdiffstats
path: root/include/clang/Format/Format.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Format/Format.h')
-rw-r--r--include/clang/Format/Format.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/clang/Format/Format.h b/include/clang/Format/Format.h
index 6c6458b33d..58a1bfbbb6 100644
--- a/include/clang/Format/Format.h
+++ b/include/clang/Format/Format.h
@@ -853,17 +853,19 @@ extern const char *StyleOptionHelpDescription;
/// \param[in] FileName Path to start search for .clang-format if ``StyleName``
/// == "file".
/// \param[in] FallbackStyle The name of a predefined style used to fallback to
-/// in case the style can't be determined from \p StyleName.
+/// in case \p StyleName is "file" and no file can be found.
/// \param[in] Code The actual code to be formatted. Used to determine the
/// language if the filename isn't sufficient.
/// \param[in] FS The underlying file system, in which the file resides. By
/// default, the file system is the real file system.
///
-/// \returns FormatStyle as specified by ``StyleName``. If no style could be
-/// determined, the default is LLVM Style (see ``getLLVMStyle()``).
-FormatStyle getStyle(StringRef StyleName, StringRef FileName,
- StringRef FallbackStyle, StringRef Code = "",
- vfs::FileSystem *FS = nullptr);
+/// \returns FormatStyle as specified by ``StyleName``. If ``StyleName`` is
+/// "file" and no file is found, returns ``FallbackStyle``. If no style could be
+/// determined, returns an Error.
+llvm::Expected<FormatStyle> getStyle(StringRef StyleName, StringRef FileName,
+ StringRef FallbackStyle,
+ StringRef Code = "",
+ vfs::FileSystem *FS = nullptr);
// \brief Returns a string representation of ``Language``.
inline StringRef getLanguageName(FormatStyle::LanguageKind Language) {