tree-sitter and lsp-methods

This commit is contained in:
csh
2025-09-14 12:28:37 +08:00
parent e9972fd869
commit aac12137cb
214 changed files with 350938 additions and 142202 deletions
@@ -67,6 +67,7 @@ namespace lsp::protocol
struct TextDocumentContentChangeEvent
{
Range range;
std::optional<uinteger> rangeLength;
string text;
};
+2 -2
View File
@@ -3,7 +3,7 @@
namespace lsp::protocol
{
enum class ErrorCode : int
enum class ErrorCodes : int
{
kParseError = -32700,
kInvalidRequest = -32600,
@@ -37,7 +37,7 @@ namespace lsp::protocol
struct ResponseError: Message
{
ErrorCode code;
ErrorCodes code;
string message;
std::optional<LSPAny> data;
};
@@ -56,7 +56,7 @@ namespace lsp::protocol
struct SemanticTokensLegend
{
std::vector<string> tokenType;
std::vector<string> tokenTypes;
std::vector<string> tokenModifiers;
};
@@ -91,7 +91,7 @@ namespace lsp::protocol
SemanticTokensLegend legend;
std::optional<boolean> range;
std::variant<Full, boolean> full;
std::optional<std::variant<Full, boolean>> full;
};
struct SemanticTokensRegistrationOptions : TextDocumentRegistrationOptions, SemanticTokensOptions, StaticRegistrationOptions
@@ -124,7 +124,7 @@ namespace lsp::protocol
{
uinteger start;
uinteger deleteCount;
std::optional<uinteger> data;
std::optional<std::vector<uinteger>> data;
};
struct SemanticTokensDelta
@@ -52,6 +52,16 @@ namespace lsp::protocol
std::optional<std::vector<DocumentSymbol>> children;
};
struct SymbolInformation
{
string name;
SymbolKind kind;
std::optional<std::vector<SymbolTag>> tags;
std::optional<boolean> deprecated;
Location location;
std::optional<string> containerName;
};
struct DocumentSymbolClientCapabilities
{
struct SymbolKinds
@@ -1,7 +1,6 @@
#pragma once
#include <type_traits>
#include <stdexcept>
#include <exception>
#include "../detail/basic_types.hpp"
namespace lsp::transform
+1 -1
View File
@@ -15,7 +15,7 @@ namespace lsp::transform
}
template<typename T>
std::optional<std::string> Serialize(const T& obj)
inline std::optional<std::string> Serialize(const T& obj)
{
std::string json;
auto ce = glz::write_json(obj, json);