[clang-tools-extra] 3cb5764 - [clangd] Flush streams when printing HoverInfo Name and Definition
Kadir Cetinkaya via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 28 04:05:53 PDT 2019
Author: Kadir Cetinkaya
Date: 2019-10-28T12:05:03+01:00
New Revision: 3cb5764f900284666dbb0342c487edb1fde4d7fc
URL: https://github.com/llvm/llvm-project/commit/3cb5764f900284666dbb0342c487edb1fde4d7fc
DIFF: https://github.com/llvm/llvm-project/commit/3cb5764f900284666dbb0342c487edb1fde4d7fc.diff
LOG: [clangd] Flush streams when printing HoverInfo Name and Definition
Summary: Fixes some windows breakages when compiled via msvc.
Added:
Modified:
clang-tools-extra/clangd/XRefs.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp
index 2e75e8c80054..3ee04f031795 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -500,6 +500,7 @@ static std::string printDefinition(const Decl *D) {
printingPolicyForDecls(D->getASTContext().getPrintingPolicy());
Policy.IncludeTagDefinition = false;
D->print(OS, Policy);
+ OS.flush();
return Definition;
}
@@ -714,6 +715,7 @@ static HoverInfo getHoverContents(QualType T, const Decl *D, ASTContext &ASTCtx,
llvm::raw_string_ostream OS(HI.Name);
PrintingPolicy Policy = printingPolicyForDecls(ASTCtx.getPrintingPolicy());
T.print(OS, Policy);
+ OS.flush();
if (D) {
HI.Kind = indexSymbolKindToSymbolKind(index::getSymbolInfo(D).Kind);
More information about the cfe-commits
mailing list