diff options
author | Eric Liu <ioeric@google.com> | 2018-06-26 12:49:09 +0000 |
---|---|---|
committer | Eric Liu <ioeric@google.com> | 2018-06-26 12:49:09 +0000 |
commit | bbadbe016f3f1d72aa7adff1a8863c4128fc39ca (patch) | |
tree | 7812fdef77dab5cffb8c82686a40e849afa8a10b | |
parent | 7c45debaea9147693e61f310ab57a7cba8a71bce (diff) | |
download | bcm5719-llvm-bbadbe016f3f1d72aa7adff1a8863c4128fc39ca.tar.gz bcm5719-llvm-bbadbe016f3f1d72aa7adff1a8863c4128fc39ca.zip |
[clangd] Use default clang-format styles.
llvm-svn: 335598
-rw-r--r-- | clang-tools-extra/clangd/ClangdServer.cpp | 3 | ||||
-rw-r--r-- | clang-tools-extra/clangd/CodeComplete.cpp | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp index 17d09e6f241..10c26eeb741 100644 --- a/clang-tools-extra/clangd/ClangdServer.cpp +++ b/clang-tools-extra/clangd/ClangdServer.cpp @@ -375,7 +375,8 @@ ClangdServer::formatCode(llvm::StringRef Code, PathRef File, ArrayRef<tooling::Range> Ranges) { // Call clang-format. auto FS = FSProvider.getFileSystem(); - auto Style = format::getStyle("file", File, "LLVM", Code, FS.get()); + auto Style = format::getStyle(format::DefaultFormatStyle, File, + format::DefaultFallbackStyle, Code, FS.get()); if (!Style) return Style.takeError(); diff --git a/clang-tools-extra/clangd/CodeComplete.cpp b/clang-tools-extra/clangd/CodeComplete.cpp index d2e71b6e472..12bed7a01ba 100644 --- a/clang-tools-extra/clangd/CodeComplete.cpp +++ b/clang-tools-extra/clangd/CodeComplete.cpp @@ -825,10 +825,11 @@ bool semaCodeComplete(std::unique_ptr<CodeCompleteConsumer> Consumer, // Initialize Includes if provided. // FIXME(ioeric): needs more consistent style support in clangd server. - auto Style = format::getStyle("file", Input.FileName, "LLVM", - Input.Contents, Input.VFS.get()); + auto Style = format::getStyle(format::DefaultFormatStyle, Input.FileName, + format::DefaultFallbackStyle, Input.Contents, + Input.VFS.get()); if (!Style) { - log("Failed to get FormatStyle for file" + Input.FileName + + log("ERROR: failed to get FormatStyle for file " + Input.FileName + ". Fall back to use LLVM style. Error: " + llvm::toString(Style.takeError())); Style = format::getLLVMStyle(); |