diff --git a/language_server_api.h b/language_server_api.h index 3f9aea2e..abed82e3 100644 --- a/language_server_api.h +++ b/language_server_api.h @@ -29,6 +29,7 @@ enum class lsMethodId : int { CodeLensResolve, WorkspaceSymbol, }; +MAKE_ENUM_HASHABLE(lsMethodId); template void Reflect(TVisitor& visitor, lsMethodId& value) { @@ -1269,7 +1270,6 @@ struct In_InitializeRequest : public InRequestMessage { In_InitializeRequest(optional id, Reader& reader) : InRequestMessage(kMethod, id, reader) { - auto type = reader.GetType(); Reflect(reader, params); std::cerr << "done" << std::endl; } diff --git a/src/typed_bidi_message_queue.h b/src/typed_bidi_message_queue.h index bceedc4d..466833c0 100644 --- a/src/typed_bidi_message_queue.h +++ b/src/typed_bidi_message_queue.h @@ -105,4 +105,4 @@ struct TypedBidiMessageQueue { std::unordered_map serializers_; std::unordered_map deserializers_; -}; \ No newline at end of file +}; diff --git a/utils.h b/utils.h index ff13e6ba..60f79fa7 100644 --- a/utils.h +++ b/utils.h @@ -49,4 +49,13 @@ inline void hash_combine(std::size_t& seed, const T& v, Rest... rest) { return ret;\ }\ };\ - } \ No newline at end of file + } + +#define MAKE_ENUM_HASHABLE(type) \ + namespace std {\ + template<> struct hash {\ + std::size_t operator()(const type &t) const {\ + return hash()(static_cast(t));\ + }\ + };\ + }