From 670c92520470875b8f8f5d4ed9f0f4b8a624bf5f Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Mon, 4 Dec 2017 00:16:19 -0800 Subject: [PATCH] Remove Ipc_Cout; rename IpcId::Cout to IpcId::Unknown. --- src/command_line.cc | 6 +++--- src/ipc.cc | 4 ++-- src/ipc.h | 9 +-------- src/match.cc | 2 +- 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/command_line.cc b/src/command_line.cc index d9fdd1b6..51808f11 100644 --- a/src/command_line.cc +++ b/src/command_line.cc @@ -85,7 +85,7 @@ bool ShouldDisplayIpcTiming(IpcId id) { switch (id) { case IpcId::TextDocumentPublishDiagnostics: case IpcId::CqueryPublishInactiveRegions: - case IpcId::Cout: + case IpcId::Unknown: return false; default: return true; @@ -126,7 +126,7 @@ bool FindFileOrFail(QueryDatabase* db, out.id = *id; out.error.code = lsErrorCodes::InternalError; out.error.message = "Unable to find file " + absolute_path; - IpcManager::WriteStdout(IpcId::Cout, out); + IpcManager::WriteStdout(IpcId::Unknown, out); } return false; @@ -876,7 +876,7 @@ void EmitProgress(Config* config, QueueManager* queue) { out.params.onIdMappedCount = queue->on_id_mapped.Size(); out.params.onIndexedCount = queue->on_indexed.Size(); - IpcManager::WriteStdout(IpcId::Cout, out); + IpcManager::WriteStdout(IpcId::Unknown, out); } } diff --git a/src/ipc.cc b/src/ipc.cc index d92cd5a7..f612f0bc 100644 --- a/src/ipc.cc +++ b/src/ipc.cc @@ -73,8 +73,8 @@ const char* IpcIdToString(IpcId id) { case IpcId::CqueryDerived: return "$cquery/derived"; - case IpcId::Cout: - return "$cout"; + case IpcId::Unknown: + return "$unknown"; case IpcId::CqueryIndexFile: return "$cquery/indexFile"; diff --git a/src/ipc.h b/src/ipc.h index 6ac12760..6a144cf6 100644 --- a/src/ipc.h +++ b/src/ipc.h @@ -50,7 +50,7 @@ enum class IpcId : int { CqueryDerived, // Show all derived types/methods. // Internal implementation detail. - Cout, + Unknown, // Index the given file contents. Used in tests. CqueryIndexFile, @@ -80,13 +80,6 @@ struct IpcMessage : public BaseIpcMessage { IpcMessage() : BaseIpcMessage(T::kIpcId) {} }; -struct Ipc_Cout : public IpcMessage { - static constexpr IpcId kIpcId = IpcId::Cout; - std::string content; - IpcId original_ipc_id; -}; -MAKE_REFLECT_STRUCT(Ipc_Cout, content); - struct Ipc_CqueryIndexFile : public IpcMessage { static constexpr IpcId kIpcId = IpcId::CqueryIndexFile; diff --git a/src/match.cc b/src/match.cc index 773c7cde..ae762b8f 100644 --- a/src/match.cc +++ b/src/match.cc @@ -33,7 +33,7 @@ optional Matcher::Create(const std::string& search) { out.params.type = lsMessageType::Error; out.params.message = "cquery: Parsing EMCAScript regex \"" + search + "\" failed; " + e.what(); - IpcManager::WriteStdout(IpcId::Cout, out); + IpcManager::WriteStdout(IpcId::Unknown, out); return nullopt; } }