From 478e542e8a9384c15aa25c8aaedfa46c4c4e2dc2 Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 7 Mar 2018 13:20:31 -0800 Subject: [PATCH] Move lsSymbolKind to lsp.h --- src/lsp.h | 43 ++++++++++++++++++++++++++++++++++++++++++- src/symbol.h | 44 +------------------------------------------- 2 files changed, 43 insertions(+), 44 deletions(-) diff --git a/src/lsp.h b/src/lsp.h index 87ea5d2a..feca5923 100644 --- a/src/lsp.h +++ b/src/lsp.h @@ -162,7 +162,48 @@ struct lsLocation { MAKE_HASHABLE(lsLocation, t.uri, t.range); MAKE_REFLECT_STRUCT(lsLocation, uri, range); -enum class lsSymbolKind : uint8_t; +enum class lsSymbolKind : uint8_t { + Unknown = 0, + + File = 1, + Module = 2, + Namespace = 3, + Package = 4, + Class = 5, + Method = 6, + Property = 7, + Field = 8, + Constructor = 9, + Enum = 10, + Interface = 11, + Function = 12, + Variable = 13, + Constant = 14, + String = 15, + Number = 16, + Boolean = 17, + Array = 18, + Object = 19, + Key = 20, + Null = 21, + EnumMember = 22, + Struct = 23, + Event = 24, + Operator = 25, + + // For C++, this is interpreted as "template parameter" (including + // non-type template parameters). + TypeParameter = 26, + + // cquery extensions + // See also https://github.com/Microsoft/language-server-protocol/issues/344 + // for new SymbolKind clang/Index/IndexSymbol.h clang::index::SymbolKind + TypeAlias = 252, + Parameter = 253, + StaticMethod = 254, + Macro = 255, +}; +MAKE_REFLECT_TYPE_PROXY(lsSymbolKind); // cquery extension struct lsLocationEx : lsLocation { diff --git a/src/symbol.h b/src/symbol.h index 688a81f5..bcbc6c64 100644 --- a/src/symbol.h +++ b/src/symbol.h @@ -1,5 +1,6 @@ #pragma once +#include "lsp.h" #include "serializer.h" // The order matters. In FindSymbolsAtLocation, we want Var/Func ordered in @@ -79,49 +80,6 @@ struct lsDocumentHighlight { }; MAKE_REFLECT_STRUCT(lsDocumentHighlight, range, kind, role); -enum class lsSymbolKind : uint8_t { - Unknown = 0, - - File = 1, - Module = 2, - Namespace = 3, - Package = 4, - Class = 5, - Method = 6, - Property = 7, - Field = 8, - Constructor = 9, - Enum = 10, - Interface = 11, - Function = 12, - Variable = 13, - Constant = 14, - String = 15, - Number = 16, - Boolean = 17, - Array = 18, - Object = 19, - Key = 20, - Null = 21, - EnumMember = 22, - Struct = 23, - Event = 24, - Operator = 25, - - // For C++, this is interpreted as "template parameter" (including - // non-type template parameters). - TypeParameter = 26, - - // cquery extensions - // See also https://github.com/Microsoft/language-server-protocol/issues/344 - // for new SymbolKind clang/Index/IndexSymbol.h clang::index::SymbolKind - TypeAlias = 252, - Parameter = 253, - StaticMethod = 254, - Macro = 255, -}; -MAKE_REFLECT_TYPE_PROXY(lsSymbolKind); - struct lsSymbolInformation { std::string_view name; lsSymbolKind kind;