summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clangd/ClangDMain.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/ClangDMain.cpp b/clang-tools-extra/clangd/ClangDMain.cpp
index 997c66748a0..eee0fb5aee3 100644
--- a/clang-tools-extra/clangd/ClangDMain.cpp
+++ b/clang-tools-extra/clangd/ClangDMain.cpp
@@ -11,6 +11,7 @@
#include "JSONRPCDispatcher.h"
#include "ProtocolHandlers.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Program.h"
#include <iostream>
#include <string>
using namespace clang::clangd;
@@ -19,6 +20,9 @@ int main(int argc, char *argv[]) {
llvm::raw_ostream &Outs = llvm::outs();
llvm::raw_ostream &Logs = llvm::errs();
+ // Change stdin to binary to not lose \r\n on windows.
+ llvm::sys::ChangeStdinToBinary();
+
// Set up a document store and intialize all the method handlers for JSONRPC
// dispatching.
DocumentStore Store;
OpenPOWER on IntegriCloud