diff --git a/src/command_line.cc b/src/command_line.cc index 721b76ef..38cb1d1d 100644 --- a/src/command_line.cc +++ b/src/command_line.cc @@ -334,20 +334,12 @@ void LaunchStdoutThread(std::unordered_map* request_times, } if (g_log_stdin_stdout_to_stderr) { - try { - std::cerr << "[COUT] |" << message.content << "|\n"; - std::cerr.flush(); - } catch (std::ios_base::failure&) { - // TODO Ignore for now - } + std::cerr << "[COUT] |" << message.content << "|\n"; + std::cerr.flush(); } - try { - std::cout << message.content; - std::cout.flush(); - } catch (std::ios_base::failure&) { - // TODO Ignore for now - } + std::cout << message.content; + std::cout.flush(); } } }); diff --git a/src/language_server_api.cc b/src/language_server_api.cc index f2416dbd..ed1080de 100644 --- a/src/language_server_api.cc +++ b/src/language_server_api.cc @@ -107,13 +107,6 @@ TEST_SUITE("FindIncludeLine") { } optional ReadCharFromStdinBlocking() { - // Bad stdin means parent process has probably exited. Either way, cquery - // can no longer be communicated with so just exit. - if (!std::cin.good()) { - LOG_S(FATAL) << "std::cin.good() is false; exiting"; - exit(1); - } - char c = 0; std::cin.read(&c, 1); return c; diff --git a/src/messages/shutdown.cc b/src/messages/shutdown.cc index 7a853020..804b1c63 100644 --- a/src/messages/shutdown.cc +++ b/src/messages/shutdown.cc @@ -6,7 +6,7 @@ struct Ipc_Shutdown : public IpcMessage { static const IpcId kIpcId = IpcId::Shutdown; lsRequestId id; }; -MAKE_REFLECT_EMPTY_STRUCT(Ipc_Shutdown, id); +MAKE_REFLECT_STRUCT(Ipc_Shutdown, id); REGISTER_IPC_MESSAGE(Ipc_Shutdown); struct Out_Shutdown : public lsOutMessage { diff --git a/src/query_utils.cc b/src/query_utils.cc index e3d28b55..54504ab7 100644 --- a/src/query_utils.cc +++ b/src/query_utils.cc @@ -349,6 +349,8 @@ optional GetLsRange(WorkingFile* working_file, const Range& location) { // class/struct definitions. if (*end < *start) *end = *start + (location.end.line - location.start.line); + if (*start == *end && start_column > end_column) + end_column = start_column; return lsRange(lsPosition(*start, start_column), lsPosition(*end, end_column));