Remove Ipc_Cout; rename IpcId::Cout to IpcId::Unknown.

This commit is contained in:
Jacob Dufault 2017-12-04 00:16:19 -08:00
parent 6c5f1d9c88
commit 670c925204
4 changed files with 7 additions and 14 deletions

View File

@ -85,7 +85,7 @@ bool ShouldDisplayIpcTiming(IpcId id) {
switch (id) { switch (id) {
case IpcId::TextDocumentPublishDiagnostics: case IpcId::TextDocumentPublishDiagnostics:
case IpcId::CqueryPublishInactiveRegions: case IpcId::CqueryPublishInactiveRegions:
case IpcId::Cout: case IpcId::Unknown:
return false; return false;
default: default:
return true; return true;
@ -126,7 +126,7 @@ bool FindFileOrFail(QueryDatabase* db,
out.id = *id; out.id = *id;
out.error.code = lsErrorCodes::InternalError; out.error.code = lsErrorCodes::InternalError;
out.error.message = "Unable to find file " + absolute_path; out.error.message = "Unable to find file " + absolute_path;
IpcManager::WriteStdout(IpcId::Cout, out); IpcManager::WriteStdout(IpcId::Unknown, out);
} }
return false; return false;
@ -876,7 +876,7 @@ void EmitProgress(Config* config, QueueManager* queue) {
out.params.onIdMappedCount = queue->on_id_mapped.Size(); out.params.onIdMappedCount = queue->on_id_mapped.Size();
out.params.onIndexedCount = queue->on_indexed.Size(); out.params.onIndexedCount = queue->on_indexed.Size();
IpcManager::WriteStdout(IpcId::Cout, out); IpcManager::WriteStdout(IpcId::Unknown, out);
} }
} }

View File

@ -73,8 +73,8 @@ const char* IpcIdToString(IpcId id) {
case IpcId::CqueryDerived: case IpcId::CqueryDerived:
return "$cquery/derived"; return "$cquery/derived";
case IpcId::Cout: case IpcId::Unknown:
return "$cout"; return "$unknown";
case IpcId::CqueryIndexFile: case IpcId::CqueryIndexFile:
return "$cquery/indexFile"; return "$cquery/indexFile";

View File

@ -50,7 +50,7 @@ enum class IpcId : int {
CqueryDerived, // Show all derived types/methods. CqueryDerived, // Show all derived types/methods.
// Internal implementation detail. // Internal implementation detail.
Cout, Unknown,
// Index the given file contents. Used in tests. // Index the given file contents. Used in tests.
CqueryIndexFile, CqueryIndexFile,
@ -80,13 +80,6 @@ struct IpcMessage : public BaseIpcMessage {
IpcMessage() : BaseIpcMessage(T::kIpcId) {} IpcMessage() : BaseIpcMessage(T::kIpcId) {}
}; };
struct Ipc_Cout : public IpcMessage<Ipc_Cout> {
static constexpr IpcId kIpcId = IpcId::Cout;
std::string content;
IpcId original_ipc_id;
};
MAKE_REFLECT_STRUCT(Ipc_Cout, content);
struct Ipc_CqueryIndexFile : public IpcMessage<Ipc_CqueryIndexFile> { struct Ipc_CqueryIndexFile : public IpcMessage<Ipc_CqueryIndexFile> {
static constexpr IpcId kIpcId = IpcId::CqueryIndexFile; static constexpr IpcId kIpcId = IpcId::CqueryIndexFile;

View File

@ -33,7 +33,7 @@ optional<Matcher> Matcher::Create(const std::string& search) {
out.params.type = lsMessageType::Error; out.params.type = lsMessageType::Error;
out.params.message = "cquery: Parsing EMCAScript regex \"" + search + out.params.message = "cquery: Parsing EMCAScript regex \"" + search +
"\" failed; " + e.what(); "\" failed; " + e.what();
IpcManager::WriteStdout(IpcId::Cout, out); IpcManager::WriteStdout(IpcId::Unknown, out);
return nullopt; return nullopt;
} }
} }