From 866faed4fce05bd7b8bf6aa36eaad958a15b5e7a Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Thu, 18 May 2017 18:13:51 -0700 Subject: [PATCH] Exit when there is no more stdin input --- src/language_server_api.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/language_server_api.cc b/src/language_server_api.cc index 3c94d42b..0211eb58 100644 --- a/src/language_server_api.cc +++ b/src/language_server_api.cc @@ -35,8 +35,10 @@ std::unique_ptr MessageRegistry::ReadMessageFromStdin() { std::getline(std::cin, line); // No content; end of stdin. - if (line.empty()) - return nullptr; + if (line.empty()) { + std::cerr << "stdin closed; exiting" << std::endl; + exit(0); + } // std::cin >> line; // std::cerr << "Read line " << line;