mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-18 19:45:49 +00:00
fixes
This commit is contained in:
parent
38acb8c1a1
commit
c4a9590398
@ -165,7 +165,7 @@ struct IpcMessage_Cout : public BaseIpcMessage<IpcMessage_Cout> {
|
||||
std::string content;
|
||||
|
||||
IpcMessage_Cout() {}
|
||||
IpcMessage_Cout(OutMessage& message) {
|
||||
IpcMessage_Cout(lsOutMessage& message) {
|
||||
std::ostringstream out;
|
||||
message.Send(out);
|
||||
content = out.str();
|
||||
@ -176,7 +176,7 @@ void Reflect(TVisitor& visitor, IpcMessage_Cout& value) {
|
||||
Reflect(visitor, value.content);
|
||||
}
|
||||
|
||||
void SendOutMessageToClient(IpcMessageQueue* queue, OutMessage& response) {
|
||||
void SendOutMessageToClient(IpcMessageQueue* queue, lsOutMessage& response) {
|
||||
IpcMessage_Cout out(response);
|
||||
queue->SendMessage(&queue->for_client, IpcMessage_Cout::kMethod, out);
|
||||
}
|
||||
@ -186,7 +186,7 @@ void SendOutMessageToClient(IpcMessageQueue* queue, OutMessage& response) {
|
||||
template<typename T>
|
||||
void RegisterId(IpcMessageQueue* t) {
|
||||
t->RegisterId(T::kMethod,
|
||||
[](Writer& visitor, lsBaseMessage& message) {
|
||||
[](Writer& visitor, InMessage& message) {
|
||||
T& m = static_cast<T&>(message);
|
||||
Reflect(visitor, m);
|
||||
}, [](Reader& visitor) {
|
||||
|
@ -338,14 +338,7 @@ struct IndexedTypeDef {
|
||||
}
|
||||
};
|
||||
|
||||
namespace std {
|
||||
template <>
|
||||
struct hash<IndexedTypeDef> {
|
||||
size_t operator()(const IndexedTypeDef& k) const {
|
||||
return hash<string>()(k.def.usr);
|
||||
}
|
||||
};
|
||||
}
|
||||
MAKE_HASHABLE(IndexedTypeDef, t.def.usr);
|
||||
|
||||
template <typename TypeId = TypeId,
|
||||
typename FuncId = FuncId,
|
||||
@ -446,15 +439,7 @@ struct IndexedFuncDef {
|
||||
return def.usr < other.def.usr;
|
||||
}
|
||||
};
|
||||
|
||||
namespace std {
|
||||
template <>
|
||||
struct hash<IndexedFuncDef> {
|
||||
size_t operator()(const IndexedFuncDef& k) const {
|
||||
return hash<string>()(k.def.usr);
|
||||
}
|
||||
};
|
||||
}
|
||||
MAKE_HASHABLE(IndexedFuncDef, t.def.usr);
|
||||
|
||||
template <typename TypeId = TypeId,
|
||||
typename FuncId = FuncId,
|
||||
@ -530,15 +515,7 @@ struct IndexedVarDef {
|
||||
return def.usr < other.def.usr;
|
||||
}
|
||||
};
|
||||
|
||||
namespace std {
|
||||
template <>
|
||||
struct hash<IndexedVarDef> {
|
||||
size_t operator()(const IndexedVarDef& k) const {
|
||||
return hash<string>()(k.def.usr);
|
||||
}
|
||||
};
|
||||
}
|
||||
MAKE_HASHABLE(IndexedVarDef, t.def.usr);
|
||||
|
||||
struct IdCache {
|
||||
std::unordered_map<std::string, FileId> file_path_to_file_id;
|
||||
|
@ -187,9 +187,7 @@ MessageRegistry* MessageRegistry::instance() {
|
||||
return instance_;
|
||||
}
|
||||
|
||||
struct lsBaseMessage {};
|
||||
|
||||
struct InMessage : public lsBaseMessage {
|
||||
struct InMessage {
|
||||
const lsMethodId method_id;
|
||||
InMessage(lsMethodId method_id) : method_id(method_id) {}
|
||||
};
|
||||
@ -202,7 +200,7 @@ struct InNotificationMessage : public InMessage {
|
||||
InNotificationMessage(lsMethodId method) : InMessage(method) {}
|
||||
};
|
||||
|
||||
struct OutMessage : public lsBaseMessage {
|
||||
struct lsOutMessage {
|
||||
// Write out the body of the message. The writer expects object key/value
|
||||
// pairs.
|
||||
virtual void WriteMessageBody(Writer& writer) = 0;
|
||||
@ -224,7 +222,7 @@ struct OutMessage : public lsBaseMessage {
|
||||
}
|
||||
};
|
||||
|
||||
struct OutRequestMessage : public OutMessage {
|
||||
struct OutRequestMessage : public lsOutMessage {
|
||||
RequestId id;
|
||||
|
||||
virtual std::string Method() = 0;
|
||||
@ -281,7 +279,7 @@ struct lsResponseError {
|
||||
}
|
||||
};
|
||||
|
||||
struct OutResponseMessage : public OutMessage {
|
||||
struct OutResponseMessage : public lsOutMessage {
|
||||
RequestId id;
|
||||
|
||||
virtual optional<lsResponseError> Error() {
|
||||
@ -307,7 +305,7 @@ struct OutResponseMessage : public OutMessage {
|
||||
}
|
||||
};
|
||||
|
||||
struct OutNotificationMessage : public OutMessage {
|
||||
struct OutNotificationMessage : public lsOutMessage {
|
||||
virtual std::string Method() = 0;
|
||||
virtual void SerializeParams(Writer& writer) = 0;
|
||||
|
||||
@ -1004,15 +1002,15 @@ void Reflect(Reader& reader, lsInitializeParams::lsTrace& value) {
|
||||
|
||||
void Reflect(Writer& writer, lsInitializeParams::lsTrace& value) {
|
||||
switch (value) {
|
||||
case lsInitializeParams::lsTrace::Off:
|
||||
writer.String("off");
|
||||
break;
|
||||
case lsInitializeParams::lsTrace::Messages:
|
||||
writer.String("messages");
|
||||
break;
|
||||
case lsInitializeParams::lsTrace::Verbose:
|
||||
writer.String("verbose");
|
||||
break;
|
||||
case lsInitializeParams::lsTrace::Off:
|
||||
writer.String("off");
|
||||
break;
|
||||
case lsInitializeParams::lsTrace::Messages:
|
||||
writer.String("messages");
|
||||
break;
|
||||
case lsInitializeParams::lsTrace::Verbose:
|
||||
writer.String("verbose");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1028,20 +1026,6 @@ void Reflect(TVisitor& visitor, lsInitializeParams& value) {
|
||||
}
|
||||
|
||||
|
||||
#if false
|
||||
/**
|
||||
* Known error codes for an `InitializeError`;
|
||||
*/
|
||||
export namespace lsInitializeError {
|
||||
/**
|
||||
* If the protocol version provided by the client can't be handled by the server.
|
||||
* @deprecated This initialize error got replaced by client capabilities. There is
|
||||
* no version handshake in version 3.0x
|
||||
*/
|
||||
export const unknownProtocolVersion : number = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
struct lsInitializeError {
|
||||
// Indicates whether the client should retry to send the
|
||||
// initilize request after showing the message provided
|
||||
@ -1071,8 +1055,11 @@ enum class lsTextDocumentSyncKind {
|
||||
Incremental = 2
|
||||
};
|
||||
|
||||
void Reflect(Writer& writer, lsTextDocumentSyncKind& value) {
|
||||
writer.Int(static_cast<int>(value));
|
||||
template<typename TVisitor>
|
||||
void Reflect(TVisitor& visitor, lsTextDocumentSyncKind& value) {
|
||||
int value0 = static_cast<int>(value);
|
||||
Reflect(visitor, value0);
|
||||
value = static_cast<lsTextDocumentSyncKind>(value0);
|
||||
}
|
||||
|
||||
// Completion options.
|
||||
@ -1302,7 +1289,7 @@ struct Out_InitializeResponse : public OutResponseMessage {
|
||||
|
||||
struct In_InitializedNotification : public InNotificationMessage {
|
||||
const static lsMethodId kMethod = lsMethodId::Initialized;
|
||||
|
||||
|
||||
RequestId id;
|
||||
|
||||
In_InitializedNotification() : InNotificationMessage(kMethod) {}
|
||||
|
Loading…
Reference in New Issue
Block a user