♻️ 使用module重构所有代码
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./code_action.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string CodeAction::GetMethod() const
|
||||
{
|
||||
return "textDocument/codeAction";
|
||||
}
|
||||
|
||||
std::string CodeAction::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentCodeAction";
|
||||
}
|
||||
|
||||
std::string CodeAction::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentCodeActionProvider: Providing response for method {}", request.method);
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.code_action;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class CodeAction : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
CodeAction() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string CodeAction::GetMethod() const
|
||||
{
|
||||
return "textDocument/codeAction";
|
||||
}
|
||||
|
||||
std::string CodeAction::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentCodeAction";
|
||||
}
|
||||
|
||||
std::string CodeAction::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentCodeActionProvider: Providing response for method {}", request.method);
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
#include <unordered_map>
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class CodeAction : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
CodeAction() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+26
-4
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./code_lens.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.code_lens;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class CodeLens : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
CodeLens() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,7 +35,8 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentCodeLens";
|
||||
}
|
||||
|
||||
std::string CodeLens::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string CodeLens::ProvideResponse(const protocol::RequestMessage& request,
|
||||
[[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentCodeLensProvider: Providing response for method {}", request.method);
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
#include <unordered_map>
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class CodeLens : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
CodeLens() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+26
-4
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./color_presentation.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.color_presentation;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class ColorPresentation : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
ColorPresentation() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,7 +35,8 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentColorPresentation";
|
||||
}
|
||||
|
||||
std::string ColorPresentation::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string ColorPresentation::ProvideResponse(const protocol::RequestMessage& request,
|
||||
[[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentColorPresentationProvider: Providing response for method {}", request.method);
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
#include <unordered_map>
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class ColorPresentation : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
ColorPresentation() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+50
-38
@@ -1,22 +1,33 @@
|
||||
#include "./completion.hpp"
|
||||
module;
|
||||
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <cstdint>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <optional>
|
||||
#include <set>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
export module lsp.provider.text_document.completion;
|
||||
import spdlog;
|
||||
|
||||
#include "../../language/keyword/repo.hpp"
|
||||
#include "../../language/symbol/table.hpp"
|
||||
#include "../../language/symbol/types.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
#include "../../utils/string.hpp"
|
||||
#include "../../utils/text_coordinates.hpp"
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
import lsp.language.ast;
|
||||
import lsp.language.symbol;
|
||||
import lsp.language.keyword;
|
||||
import lsp.utils.string;
|
||||
import lsp.utils.text_coordinates;
|
||||
|
||||
namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Completion : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& execution_context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -97,7 +108,7 @@ namespace lsp::provider::text_document
|
||||
std::string BuildSignature(const std::vector<language::symbol::Parameter>& params, const std::optional<std::string>& return_type)
|
||||
{
|
||||
std::string detail = "(";
|
||||
for (size_t i = 0; i < params.size(); ++i)
|
||||
for (std::size_t i = 0; i < params.size(); ++i)
|
||||
{
|
||||
if (i > 0)
|
||||
detail += ", ";
|
||||
@@ -114,7 +125,7 @@ namespace lsp::provider::text_document
|
||||
bool IsNewContext(const std::string& line)
|
||||
{
|
||||
std::string line_lower = utils::ToLower(line);
|
||||
size_t new_pos = line_lower.rfind("new ");
|
||||
std::size_t new_pos = line_lower.rfind("new ");
|
||||
if (new_pos == std::string::npos)
|
||||
return false;
|
||||
|
||||
@@ -125,16 +136,16 @@ namespace lsp::provider::text_document
|
||||
bool IsClassMethodContext(const std::string& line, std::string& out_class_name, std::string& out_prefix)
|
||||
{
|
||||
std::string line_lower = utils::ToLower(line);
|
||||
size_t class_pos = line_lower.rfind("class(");
|
||||
std::size_t class_pos = line_lower.rfind("class(");
|
||||
if (class_pos == std::string::npos)
|
||||
return false;
|
||||
|
||||
std::string after_class = line.substr(class_pos + 6);
|
||||
size_t close_paren = after_class.find(')');
|
||||
std::size_t close_paren = after_class.find(')');
|
||||
if (close_paren == std::string::npos)
|
||||
return false;
|
||||
|
||||
size_t dot_pos = after_class.find('.', close_paren);
|
||||
std::size_t dot_pos = after_class.find('.', close_paren);
|
||||
if (dot_pos == std::string::npos)
|
||||
return false;
|
||||
|
||||
@@ -149,7 +160,7 @@ namespace lsp::provider::text_document
|
||||
bool IsUnitContext(const std::string& line)
|
||||
{
|
||||
std::string line_lower = utils::ToLower(line);
|
||||
size_t unit_pos = line_lower.rfind("unit(");
|
||||
std::size_t unit_pos = line_lower.rfind("unit(");
|
||||
if (unit_pos == std::string::npos)
|
||||
return false;
|
||||
|
||||
@@ -160,7 +171,7 @@ namespace lsp::provider::text_document
|
||||
bool IsClassContext(const std::string& line)
|
||||
{
|
||||
std::string line_lower = utils::ToLower(line);
|
||||
size_t class_pos = line_lower.rfind("class(");
|
||||
std::size_t class_pos = line_lower.rfind("class(");
|
||||
if (class_pos == std::string::npos)
|
||||
return false;
|
||||
|
||||
@@ -174,15 +185,15 @@ namespace lsp::provider::text_document
|
||||
// unit(xxx).prefix
|
||||
{
|
||||
std::string line_lower = utils::ToLower(line);
|
||||
size_t unit_pos = line_lower.rfind("unit(");
|
||||
std::size_t unit_pos = line_lower.rfind("unit(");
|
||||
if (unit_pos != std::string::npos)
|
||||
{
|
||||
std::string after_unit = line.substr(unit_pos + 5);
|
||||
size_t close_paren = after_unit.find(')');
|
||||
size_t dot_pos = after_unit.find('.');
|
||||
std::size_t close_paren = after_unit.find(')');
|
||||
std::size_t dot_pos = after_unit.find('.');
|
||||
if (dot_pos != std::string::npos && dot_pos > 0)
|
||||
{
|
||||
size_t name_end = close_paren != std::string::npos && close_paren < dot_pos ? close_paren : dot_pos;
|
||||
std::size_t name_end = close_paren != std::string::npos && close_paren < dot_pos ? close_paren : dot_pos;
|
||||
ctx.unit_name = utils::Trim(after_unit.substr(0, name_end));
|
||||
ctx.member_prefix = utils::Trim(after_unit.substr(dot_pos + 1));
|
||||
ctx.is_unit_member_context = !ctx.unit_name.empty();
|
||||
@@ -193,11 +204,11 @@ namespace lsp::provider::text_document
|
||||
}
|
||||
|
||||
// alias.prefix
|
||||
size_t dot_pos = line.rfind('.');
|
||||
std::size_t dot_pos = line.rfind('.');
|
||||
if (dot_pos != std::string::npos)
|
||||
{
|
||||
// find token before dot
|
||||
size_t start = dot_pos;
|
||||
std::size_t start = dot_pos;
|
||||
while (start > 0)
|
||||
{
|
||||
char ch = line[start - 1];
|
||||
@@ -219,9 +230,9 @@ namespace lsp::provider::text_document
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
std::string ExtractPrefixByScan(size_t cursor_pos, size_t line_start, const std::string& content)
|
||||
std::string ExtractPrefixByScan(std::size_t cursor_pos, std::size_t line_start, const std::string& content)
|
||||
{
|
||||
size_t prefix_start = cursor_pos;
|
||||
std::size_t prefix_start = cursor_pos;
|
||||
while (prefix_start > line_start)
|
||||
{
|
||||
char ch = content[prefix_start - 1];
|
||||
@@ -242,9 +253,9 @@ namespace lsp::provider::text_document
|
||||
return result;
|
||||
|
||||
const std::string& content = *document_content;
|
||||
size_t line_start = 0;
|
||||
size_t current_line = 0;
|
||||
for (size_t i = 0; i < content.length(); ++i)
|
||||
std::size_t line_start = 0;
|
||||
std::size_t current_line = 0;
|
||||
for (std::size_t i = 0; i < content.length(); ++i)
|
||||
{
|
||||
if (current_line == result.position.line)
|
||||
{
|
||||
@@ -255,7 +266,7 @@ namespace lsp::provider::text_document
|
||||
++current_line;
|
||||
}
|
||||
|
||||
size_t cursor_pos = std::min(line_start + result.position.character, content.length());
|
||||
std::size_t cursor_pos = std::min(line_start + result.position.character, content.length());
|
||||
result.line_content = content.substr(line_start, cursor_pos - line_start);
|
||||
|
||||
std::string class_name;
|
||||
@@ -315,7 +326,7 @@ namespace lsp::provider::text_document
|
||||
// Gather imports from current symbol scope
|
||||
if (content_opt)
|
||||
{
|
||||
uint32_t offset = utils::text_coordinates::ToOffset(position, *content_opt);
|
||||
std::uint32_t offset = utils::text_coordinates::ToOffset(position, *content_opt);
|
||||
language::ast::Location loc{};
|
||||
loc.start_line = loc.end_line = position.line;
|
||||
loc.start_column = loc.end_column = position.character;
|
||||
@@ -557,7 +568,8 @@ namespace lsp::provider::text_document
|
||||
item.kind = protocol::CompletionItemKind::Function;
|
||||
item.labelDetails = protocol::CompletionItemLabelDetails{
|
||||
.detail = BuildSignature(method->parameters, method->return_type),
|
||||
.description = SourceTag(source) };
|
||||
.description = SourceTag(source)
|
||||
};
|
||||
out.push_back({ std::move(item), source });
|
||||
}
|
||||
}
|
||||
@@ -674,7 +686,7 @@ namespace lsp::provider::text_document
|
||||
auto after = context.prefix.substr(5);
|
||||
auto close = after.find(')');
|
||||
auto dot = after.find('.');
|
||||
size_t name_end = std::min(
|
||||
std::size_t name_end = std::min(
|
||||
close == std::string::npos ? after.size() : close,
|
||||
dot == std::string::npos ? after.size() : dot);
|
||||
context.unit_name = utils::Trim(after.substr(0, name_end));
|
||||
@@ -1,14 +0,0 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class Completion : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& execution_context) override;
|
||||
};
|
||||
}
|
||||
+51
-10
@@ -1,12 +1,53 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
module;
|
||||
|
||||
#include <cstring>
|
||||
#include "./definition.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
#include "../../manager/manager_hub.hpp"
|
||||
#include "../../utils/text_coordinates.hpp"
|
||||
#include "../../language/symbol/table.hpp"
|
||||
#include "../../language/semantic/semantic_model.hpp"
|
||||
#include "../../utils/string.hpp"
|
||||
|
||||
export module lsp.provider.text_document.definition;
|
||||
import tree_sitter;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.utils.text_coordinates;
|
||||
import lsp.utils.string;
|
||||
import lsp.provider.base.interface;
|
||||
import lsp.language.ast;
|
||||
import lsp.language.symbol;
|
||||
import lsp.language.semantic;
|
||||
import lsp.manager.manager_hub;
|
||||
|
||||
extern "C" {
|
||||
}
|
||||
|
||||
namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Definition : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Definition() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
|
||||
private:
|
||||
static constexpr const char* kIdentifier = "identifier";
|
||||
|
||||
std::optional<protocol::Location> BuildDefinitionResponse(const protocol::DefinitionParams& params, ExecutionContext& context);
|
||||
std::optional<protocol::Location> ResolveInCurrentDocument(const protocol::DocumentUri& uri,
|
||||
const std::string& identifier,
|
||||
const language::ast::Location& location,
|
||||
ExecutionContext& context);
|
||||
std::optional<protocol::Location> ResolveInIndex(const std::string& identifier, ExecutionContext& context);
|
||||
std::string GetIdentifierAtPosition(const protocol::DocumentUri& uri, const protocol::Position& position, ExecutionContext& context);
|
||||
static protocol::Location ToLocation(const protocol::DocumentUri& uri, const language::ast::Location& loc);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -174,14 +215,14 @@ namespace lsp::provider::text_document
|
||||
if (!content.has_value() || !tree)
|
||||
return "";
|
||||
|
||||
size_t byte_offset = utils::text_coordinates::ToOffset(position, *content);
|
||||
std::size_t byte_offset = utils::text_coordinates::ToOffset(position, *content);
|
||||
TSNode root = ts_tree_root_node(tree);
|
||||
TSNode node = ts_node_descendant_for_byte_range(root, static_cast<uint32_t>(byte_offset), static_cast<uint32_t>(byte_offset));
|
||||
|
||||
while (!ts_node_is_null(node))
|
||||
{
|
||||
const char* node_type = ts_node_type(node);
|
||||
if (strcmp(node_type, kIdentifier) == 0)
|
||||
if (std::strcmp(node_type, kIdentifier) == 0)
|
||||
{
|
||||
uint32_t start = ts_node_start_byte(node);
|
||||
uint32_t end = ts_node_end_byte(node);
|
||||
@@ -1,36 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
#include "../../language/ast/types.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <tree_sitter/api.h>
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class Definition : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Definition() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
|
||||
private:
|
||||
std::optional<protocol::Location> BuildDefinitionResponse(const protocol::DefinitionParams& params, ExecutionContext& context);
|
||||
std::optional<protocol::Location> ResolveInCurrentDocument(const protocol::DocumentUri& uri,
|
||||
const std::string& identifier,
|
||||
const language::ast::Location& location,
|
||||
ExecutionContext& context);
|
||||
std::optional<protocol::Location> ResolveInIndex(const std::string& identifier, ExecutionContext& context);
|
||||
std::string GetIdentifierAtPosition(const protocol::DocumentUri& uri, const protocol::Position& position, ExecutionContext& context);
|
||||
static protocol::Location ToLocation(const protocol::DocumentUri& uri, const language::ast::Location& loc);
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr const char* kIdentifier = "identifier";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./diagnostic.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string Diagnostic::GetMethod() const
|
||||
{
|
||||
return "textDocument/diagnostic";
|
||||
}
|
||||
|
||||
std::string Diagnostic::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentDiagnostic";
|
||||
}
|
||||
|
||||
std::string Diagnostic::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentDiagnosticProvider: Providing response for method {}", request.method);
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.diagnostic;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Diagnostic : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Diagnostic() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string Diagnostic::GetMethod() const
|
||||
{
|
||||
return "textDocument/diagnostic";
|
||||
}
|
||||
|
||||
std::string Diagnostic::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentDiagnostic";
|
||||
}
|
||||
|
||||
std::string Diagnostic::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentDiagnosticProvider: Providing response for method {}", request.method);
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
#include <unordered_map>
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class Diagnostic : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Diagnostic() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+26
-3
@@ -1,6 +1,29 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./did_change.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.did_change;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DidChange : public INotificationProvider
|
||||
{
|
||||
public:
|
||||
DidChange() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class DidChange : public INotificationProvider
|
||||
{
|
||||
public:
|
||||
DidChange() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+26
-3
@@ -1,6 +1,29 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./did_close.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.did_close;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DidClose : public INotificationProvider
|
||||
{
|
||||
public:
|
||||
DidClose() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class DidClose : public INotificationProvider
|
||||
{
|
||||
public:
|
||||
DidClose() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+26
-3
@@ -1,6 +1,29 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./did_open.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.did_open;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DidOpen : public INotificationProvider
|
||||
{
|
||||
public:
|
||||
DidOpen() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
#include <unordered_map>
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class DidOpen : public INotificationProvider
|
||||
{
|
||||
public:
|
||||
DidOpen() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./document_color.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string DocumentColor::GetMethod() const
|
||||
{
|
||||
return "textDocument/documentColor";
|
||||
}
|
||||
|
||||
std::string DocumentColor::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentDocumentColor";
|
||||
}
|
||||
|
||||
std::string DocumentColor::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentDocumentColorProvider: Providing response for method {}", request.method);
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.document_color;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DocumentColor : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
DocumentColor() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string DocumentColor::GetMethod() const
|
||||
{
|
||||
return "textDocument/documentColor";
|
||||
}
|
||||
|
||||
std::string DocumentColor::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentDocumentColor";
|
||||
}
|
||||
|
||||
std::string DocumentColor::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentDocumentColorProvider: Providing response for method {}", request.method);
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class DocumentColor : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
DocumentColor() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./document_highlight.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string DocumentHighlight::GetMethod() const
|
||||
{
|
||||
return "textDocument/documentHighlight";
|
||||
}
|
||||
|
||||
std::string DocumentHighlight::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentDocumentHighlight";
|
||||
}
|
||||
|
||||
std::string DocumentHighlight::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentDocumentHighlightProvider: Providing response for method {}", request.method);
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.document_highlight;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DocumentHighlight : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
DocumentHighlight() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string DocumentHighlight::GetMethod() const
|
||||
{
|
||||
return "textDocument/documentHighlight";
|
||||
}
|
||||
|
||||
std::string DocumentHighlight::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentDocumentHighlight";
|
||||
}
|
||||
|
||||
std::string DocumentHighlight::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentDocumentHighlightProvider: Providing response for method {}", request.method);
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
#include <unordered_map>
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class DocumentHighlight : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
DocumentHighlight() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+25
-4
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./document_link.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.document_link;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DocumentLink : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
DocumentLink() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,7 +35,7 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentDocumentLink";
|
||||
}
|
||||
|
||||
std::string DocumentLink::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string DocumentLink::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentDocumentLinkProvider: Providing response for method {}", request.method);
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class DocumentLink : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
DocumentLink() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+25
-4
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./document_symbol.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.document_symbol;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DocumentSymbol : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
DocumentSymbol() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,7 +35,7 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentDocumentSymbol";
|
||||
}
|
||||
|
||||
std::string DocumentSymbol::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string DocumentSymbol::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentDocumentSymbolProvider: Providing response for method {}", request.method);
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class DocumentSymbol : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
DocumentSymbol() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./folding_range.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.folding_range;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class FoldingRange : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
FoldingRange() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentFoldingRange";
|
||||
}
|
||||
|
||||
std::string FoldingRange::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string FoldingRange::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentFoldingRangeProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class FoldingRange : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
FoldingRange() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./formatting.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.formatting;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Formatting : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Formatting() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentFormatting";
|
||||
}
|
||||
|
||||
std::string Formatting::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string Formatting::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentFormattingProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class Formatting : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Formatting() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./hover.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.hover;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Hover : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Hover() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentHover";
|
||||
}
|
||||
|
||||
std::string Hover::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string Hover::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentHoverProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class Hover : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Hover() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./implementation.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.implementation;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Implementation : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Implementation() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentImplementation";
|
||||
}
|
||||
|
||||
std::string Implementation::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string Implementation::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentImplementationProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class Implementation : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Implementation() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./inlay_hint.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.inlay_hint;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class InlayHint : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
InlayHint() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentInlayHint";
|
||||
}
|
||||
|
||||
std::string InlayHint::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string InlayHint::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentInlayHintProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class InlayHint : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
InlayHint() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./inline_value.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.inline_value;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class InlineValue : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
InlineValue() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentInlineValue";
|
||||
}
|
||||
|
||||
std::string InlineValue::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string InlineValue::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentInlineValueProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class InlineValue : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
InlineValue() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./linked_editing_range.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.linked_editing_range;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class LinkedEditingRange : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
LinkedEditingRange() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentLinkedEditingRange";
|
||||
}
|
||||
|
||||
std::string LinkedEditingRange::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string LinkedEditingRange::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentLinkedEditingRangeProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class LinkedEditingRange : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
LinkedEditingRange() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./moniker.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.moniker;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Moniker : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Moniker() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentMoniker";
|
||||
}
|
||||
|
||||
std::string Moniker::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string Moniker::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentMonikerProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class Moniker : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Moniker() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./on_type_formatting.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.on_type_formatting;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class OnTypeFormatting : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
OnTypeFormatting() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentOnTypeFormatting";
|
||||
}
|
||||
|
||||
std::string OnTypeFormatting::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string OnTypeFormatting::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentOnTypeFormattingProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class OnTypeFormatting : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
OnTypeFormatting() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./prepare_call_hierarchy.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.prepare_call_hierarchy;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class PrepareCallHierarchy : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
PrepareCallHierarchy() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentPrepareCallHierarchy";
|
||||
}
|
||||
|
||||
std::string PrepareCallHierarchy::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string PrepareCallHierarchy::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentPrepareCallHierarchyProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class PrepareCallHierarchy : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
PrepareCallHierarchy() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./prepare_rename.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.prepare_rename;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class PrepareRename : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
PrepareRename() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "PrepareRename";
|
||||
}
|
||||
|
||||
std::string PrepareRename::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string PrepareRename::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentPrepareRenameProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class PrepareRename : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
PrepareRename() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./prepare_type_hierarchy.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.prepare_type_hierarchy;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class PrepareTypeHierarchy : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
PrepareTypeHierarchy() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentPrepareTypeHierarchy";
|
||||
}
|
||||
|
||||
std::string PrepareTypeHierarchy::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string PrepareTypeHierarchy::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentPrepareTypeHierarchyProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class PrepareTypeHierarchy : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
PrepareTypeHierarchy() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+26
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./publish_diagnostics.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.publish_diagnostics;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class PublishDiagnostics : public INotificationProvider
|
||||
{
|
||||
public:
|
||||
PublishDiagnostics() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,14 +35,13 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentPublishDiagnostics";
|
||||
}
|
||||
|
||||
void PublishDiagnostics::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
|
||||
void PublishDiagnostics::HandleNotification(const protocol::NotificationMessage& notification, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentPublishDiagnosticsProvider: Handling notification for method {}", notification.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual notification handling logic
|
||||
// 1. Parse notification parameters
|
||||
// 2. Update appropriate services/state
|
||||
// 3. Trigger any necessary side effects
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class PublishDiagnostics : public INotificationProvider
|
||||
{
|
||||
public:
|
||||
PublishDiagnostics() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./range_formatting.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.range_formatting;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class RangeFormatting : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
RangeFormatting() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentRangeFormatting";
|
||||
}
|
||||
|
||||
std::string RangeFormatting::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string RangeFormatting::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentRangeFormattingProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class RangeFormatting : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
RangeFormatting() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+86
-31
@@ -1,8 +1,62 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./references.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
#include "../../service/document.hpp"
|
||||
#include "../../service/symbol.hpp"
|
||||
module;
|
||||
|
||||
#include <cstring>
|
||||
|
||||
export module lsp.provider.text_document.references;
|
||||
import tree_sitter;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
import lsp.manager.manager_hub;
|
||||
import lsp.language.symbol;
|
||||
import lsp.manager.document;
|
||||
|
||||
extern "C" {
|
||||
}
|
||||
|
||||
namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class References : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
References() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
|
||||
private:
|
||||
std::vector<protocol::Location> BuildReferencesResponse(const protocol::ReferenceParams& params, ExecutionContext& context);
|
||||
std::vector<protocol::Location> FindReferences(const protocol::DocumentUri& uri, const std::string& identifier, bool include_declaration, ExecutionContext& context);
|
||||
std::string GetIdentifierAtPosition(const protocol::DocumentUri& uri, const protocol::Position& position, ExecutionContext& context);
|
||||
void FindReferencesInNode(TSNode node, const std::string& identifier, const std::string& content, const protocol::DocumentUri& uri, std::vector<protocol::Location>& locations, bool include_declaration);
|
||||
bool IsDefinitionNode(TSNode node, const std::string& identifier, const std::string& content);
|
||||
bool IsReferenceNode(TSNode node, const std::string& identifier, const std::string& content);
|
||||
};
|
||||
|
||||
namespace detail
|
||||
{
|
||||
constexpr const char* kIdentifier = "identifier";
|
||||
constexpr const char* kCall = "call";
|
||||
constexpr const char* kAttribute = "attribute";
|
||||
constexpr const char* kFunctionDefinition = "function_definition_statement";
|
||||
constexpr const char* kFunctionDeclaration = "function_declaration_statement";
|
||||
constexpr const char* kClassDefinition = "class_definition_statement";
|
||||
constexpr const char* kVarStatement = "var_statement";
|
||||
constexpr const char* kConstStatement = "const_statement";
|
||||
constexpr const char* kMethodWithImplementation = "method_with_implementation";
|
||||
constexpr const char* kAssignmentExpression = "assignment_expression";
|
||||
}
|
||||
|
||||
using namespace detail;
|
||||
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -16,28 +70,13 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentReferences";
|
||||
}
|
||||
|
||||
std::string References::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string References::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentReferencesProvider: Providing response for method {}", request.method);
|
||||
|
||||
if (!request.params.has_value())
|
||||
{
|
||||
spdlog::warn("{}: Missing params in request", GetProviderName());
|
||||
return BuildErrorResponseMessage(request, protocol::ErrorCodes::InvalidParams, "Missing params");
|
||||
}
|
||||
|
||||
protocol::ReferenceParams params =
|
||||
transform::As<protocol::ReferenceParams>(request.params.value());
|
||||
|
||||
auto locations = BuildReferencesResponse(params, context);
|
||||
|
||||
protocol::ResponseMessage response;
|
||||
response.id = request.id;
|
||||
|
||||
if (!locations.empty())
|
||||
response.result = transform::LSPAny(locations);
|
||||
else
|
||||
response.result = transform::LSPAny(std::vector<protocol::Location>{});
|
||||
response.result = transform::ToLSPAny(std::vector<protocol::Location>{});
|
||||
|
||||
std::optional<std::string> json = transform::Serialize(response);
|
||||
if (!json.has_value())
|
||||
@@ -74,11 +113,9 @@ namespace lsp::provider::text_document
|
||||
{
|
||||
std::vector<protocol::Location> locations;
|
||||
|
||||
// 从容器获取文档服务
|
||||
auto& document_service = context.GetService<service::Document>();
|
||||
|
||||
auto content = document_service.GetContent(uri);
|
||||
auto tree = document_service.GetSyntaxTree(uri);
|
||||
auto& hub = context.GetManagerHub();
|
||||
auto content = hub.documents().GetContent(uri);
|
||||
auto tree = hub.parser().GetTree(uri);
|
||||
|
||||
if (!content.has_value() || !tree)
|
||||
{
|
||||
@@ -94,10 +131,9 @@ namespace lsp::provider::text_document
|
||||
|
||||
std::string References::GetIdentifierAtPosition(const protocol::DocumentUri& uri, const protocol::Position& position, ExecutionContext& context)
|
||||
{
|
||||
auto& document_service = context.GetService<service::Document>();
|
||||
|
||||
auto content = document_service.GetContent(uri);
|
||||
auto tree = document_service.GetSyntaxTree(uri);
|
||||
auto& hub = context.GetManagerHub();
|
||||
auto content = hub.documents().GetContent(uri);
|
||||
auto tree = hub.parser().GetTree(uri);
|
||||
|
||||
if (!content.has_value() || !tree)
|
||||
return "";
|
||||
@@ -142,4 +178,23 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
void References::FindReferencesInNode(TSNode /*node*/,
|
||||
const std::string& /*identifier*/,
|
||||
const std::string& /*content*/,
|
||||
const protocol::DocumentUri& /*uri*/,
|
||||
std::vector<protocol::Location>& /*locations*/,
|
||||
bool /*include_declaration*/)
|
||||
{
|
||||
}
|
||||
|
||||
bool References::IsDefinitionNode(TSNode /*node*/, const std::string& /*identifier*/, const std::string& /*content*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool References::IsReferenceNode(TSNode /*node*/, const std::string& /*identifier*/, const std::string& /*content*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <tree_sitter/api.h>
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class References : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
References() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
|
||||
private:
|
||||
std::vector<protocol::Location> BuildReferencesResponse(const protocol::ReferenceParams& params, ExecutionContext& context);
|
||||
std::vector<protocol::Location> FindReferences(const protocol::DocumentUri& uri, const std::string& identifier, bool include_declaration, ExecutionContext& context);
|
||||
std::string GetIdentifierAtPosition(const protocol::DocumentUri& uri, const protocol::Position& position, ExecutionContext& context);
|
||||
void FindReferencesInNode(TSNode node, const std::string& identifier, const std::string& content, const protocol::DocumentUri& uri, std::vector<protocol::Location>& locations, bool include_declaration);
|
||||
bool IsDefinitionNode(TSNode node, const std::string& identifier, const std::string& content);
|
||||
bool IsReferenceNode(TSNode node, const std::string& identifier, const std::string& content);
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr const char* kIdentifier = "identifier";
|
||||
constexpr const char* kCall = "call";
|
||||
constexpr const char* kAttribute = "attribute";
|
||||
constexpr const char* kFunctionDefinition = "function_definition_statement";
|
||||
constexpr const char* kFunctionDeclaration = "function_declaration_statement";
|
||||
constexpr const char* kClassDefinition = "class_definition_statement";
|
||||
constexpr const char* kVarStatement = "var_statement";
|
||||
constexpr const char* kConstStatement = "const_statement";
|
||||
constexpr const char* kMethodWithImplementation = "method_with_implementation";
|
||||
constexpr const char* kAssignmentExpression = "assignment_expression";
|
||||
}
|
||||
|
||||
}
|
||||
+169
-22
@@ -1,12 +1,162 @@
|
||||
// rename.cpp
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <regex>
|
||||
module;
|
||||
|
||||
#include <cctype>
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include "./rename.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
#include "../../service/document.hpp"
|
||||
#include "../../service/symbol.hpp"
|
||||
|
||||
export module lsp.provider.text_document.rename;
|
||||
import tree_sitter;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
import lsp.language.symbol;
|
||||
import lsp.manager.manager_hub;
|
||||
|
||||
extern "C" {
|
||||
}
|
||||
|
||||
namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Rename : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Rename() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
|
||||
private:
|
||||
// 构建重命名响应 - 返回 WorkspaceEdit | null
|
||||
std::optional<protocol::WorkspaceEdit> BuildRenameResponse(const protocol::RenameParams& params, ExecutionContext& context);
|
||||
|
||||
// 查找所有需要重命名的位置
|
||||
std::vector<protocol::Location> FindRenameLocations(const protocol::DocumentUri& uri, const std::string& old_name, ExecutionContext& context);
|
||||
|
||||
// 获取位置处的标识符和范围
|
||||
std::string GetIdentifierAtPosition(const protocol::DocumentUri& uri, const protocol::Position& position, ExecutionContext& context);
|
||||
bool IsDefinitionNode(TSNode node, const std::string& identifier, const std::string& content);
|
||||
|
||||
// 验证是否可以重命名
|
||||
bool CanRename(const std::string& identifier);
|
||||
|
||||
// 验证新名称是否有效
|
||||
bool IsValidIdentifier(const std::string& new_name);
|
||||
|
||||
// 在节点中查找所有引用
|
||||
void FindIdentifiersInNode(TSNode node, const std::string& identifier, const std::string& content, std::vector<protocol::Range>& ranges);
|
||||
};
|
||||
|
||||
namespace detail
|
||||
{
|
||||
// 节点类型常量
|
||||
constexpr const char* kIdentifier = "identifier";
|
||||
constexpr const char* kFunctionDefinition = "function_definition_statement";
|
||||
constexpr const char* kFunctionDeclaration = "function_declaration_statement";
|
||||
constexpr const char* kClassDefinition = "class_definition_statement";
|
||||
constexpr const char* kVarStatement = "var_statement";
|
||||
constexpr const char* kStaticStatement = "static_statement";
|
||||
constexpr const char* kGlobalStatement = "global_statement";
|
||||
constexpr const char* kConstStatement = "const_statement";
|
||||
constexpr const char* kMethodDeclaration = "method_declaration";
|
||||
constexpr const char* kMethodDeclarationOnly = "method_declaration_only";
|
||||
constexpr const char* kMethodWithModifier = "method_with_modifier";
|
||||
constexpr const char* kMethodWithImplementation = "method_with_implementation";
|
||||
constexpr const char* kPropertyDeclaration = "property_declaration";
|
||||
constexpr const char* kAssignmentExpression = "assignment_expression";
|
||||
constexpr const char* kVarDeclaration = "var_declaration";
|
||||
constexpr const char* kStaticDeclaration = "static_declaration";
|
||||
constexpr const char* kGlobalDeclaration = "global_declaration";
|
||||
|
||||
// TSF语言关键字(不能用作标识符)
|
||||
const std::set<std::string> kReservedKeywords = {
|
||||
"and",
|
||||
"array",
|
||||
"begin",
|
||||
"case",
|
||||
"class",
|
||||
"const",
|
||||
"constructor",
|
||||
"destructor",
|
||||
"div",
|
||||
"do",
|
||||
"downto",
|
||||
"else",
|
||||
"end",
|
||||
"except",
|
||||
"file",
|
||||
"finally",
|
||||
"for",
|
||||
"function",
|
||||
"global",
|
||||
"goto",
|
||||
"if",
|
||||
"implementation",
|
||||
"in",
|
||||
"inherited",
|
||||
"initialization",
|
||||
"interface",
|
||||
"is",
|
||||
"label",
|
||||
"mod",
|
||||
"nil",
|
||||
"not",
|
||||
"object",
|
||||
"of",
|
||||
"or",
|
||||
"packed",
|
||||
"procedure",
|
||||
"program",
|
||||
"property",
|
||||
"raise",
|
||||
"record",
|
||||
"repeat",
|
||||
"set",
|
||||
"shl",
|
||||
"shr",
|
||||
"static",
|
||||
"string",
|
||||
"then",
|
||||
"to",
|
||||
"try",
|
||||
"type",
|
||||
"unit",
|
||||
"until",
|
||||
"uses",
|
||||
"var",
|
||||
"while",
|
||||
"with",
|
||||
"true",
|
||||
"false",
|
||||
"self",
|
||||
"virtual",
|
||||
"override",
|
||||
"overload",
|
||||
"public",
|
||||
"private",
|
||||
"protected",
|
||||
"published",
|
||||
"finalization",
|
||||
"break",
|
||||
"continue",
|
||||
"exit",
|
||||
"return",
|
||||
"new",
|
||||
"free",
|
||||
"echo"
|
||||
};
|
||||
}
|
||||
|
||||
using namespace detail;
|
||||
|
||||
}
|
||||
|
||||
// rename.cpp
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -31,7 +181,7 @@ namespace lsp::provider::text_document
|
||||
}
|
||||
|
||||
protocol::RenameParams params =
|
||||
transform::As<protocol::RenameParams>(request.params.value());
|
||||
transform::FromLSPAny.template operator()<protocol::RenameParams>(request.params.value());
|
||||
|
||||
// 验证新名称是否有效
|
||||
if (!IsValidIdentifier(params.newName))
|
||||
@@ -47,7 +197,7 @@ namespace lsp::provider::text_document
|
||||
|
||||
if (workspace_edit_opt.has_value())
|
||||
{
|
||||
response.result = transform::LSPAny(*workspace_edit_opt);
|
||||
response.result = transform::ToLSPAny(*workspace_edit_opt);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -141,13 +291,9 @@ namespace lsp::provider::text_document
|
||||
{
|
||||
std::vector<protocol::Location> locations;
|
||||
|
||||
// 从容器获取服务
|
||||
auto& document_service = context.GetService<service::Document>();
|
||||
|
||||
// TODO: 扩展到多文档
|
||||
// 当前只在单个文档中查找
|
||||
auto content = document_service.GetContent(uri);
|
||||
auto tree = document_service.GetSyntaxTree(uri);
|
||||
auto& hub = context.GetManagerHub();
|
||||
auto content = hub.documents().GetContent(uri);
|
||||
auto tree = hub.parser().GetTree(uri);
|
||||
|
||||
if (!content.has_value() || !tree)
|
||||
{
|
||||
@@ -226,10 +372,9 @@ namespace lsp::provider::text_document
|
||||
|
||||
std::string Rename::GetIdentifierAtPosition(const protocol::DocumentUri& uri, const protocol::Position& position, ExecutionContext& context)
|
||||
{
|
||||
auto& document_service = context.GetService<service::Document>();
|
||||
|
||||
auto content = document_service.GetContent(uri);
|
||||
auto tree = document_service.GetSyntaxTree(uri);
|
||||
auto& hub = context.GetManagerHub();
|
||||
auto content = hub.documents().GetContent(uri);
|
||||
auto tree = hub.parser().GetTree(uri);
|
||||
|
||||
if (!content.has_value() || !tree)
|
||||
{
|
||||
@@ -356,7 +501,9 @@ namespace lsp::provider::text_document
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Rename::IsDefinitionNode(TSNode node, const std::string& identifier, const std::string& content)
|
||||
bool Rename::IsDefinitionNode(TSNode node,
|
||||
[[maybe_unused]] const std::string& identifier,
|
||||
[[maybe_unused]] const std::string& content)
|
||||
{
|
||||
TSNode parent = ts_node_parent(node);
|
||||
if (ts_node_is_null(parent))
|
||||
@@ -1,142 +0,0 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
extern "C" {
|
||||
#include <tree_sitter/api.h>
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class Rename : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
Rename() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
|
||||
private:
|
||||
// 构建重命名响应 - 返回 WorkspaceEdit | null
|
||||
std::optional<protocol::WorkspaceEdit> BuildRenameResponse(const protocol::RenameParams& params, ExecutionContext& context);
|
||||
|
||||
// 查找所有需要重命名的位置
|
||||
std::vector<protocol::Location> FindRenameLocations(const protocol::DocumentUri& uri, const std::string& old_name, ExecutionContext& context);
|
||||
|
||||
// 获取位置处的标识符和范围
|
||||
std::string GetIdentifierAtPosition(const protocol::DocumentUri& uri, const protocol::Position& position, ExecutionContext& context);
|
||||
bool IsDefinitionNode(TSNode node, const std::string& identifier, const std::string& content);
|
||||
|
||||
// 验证是否可以重命名
|
||||
bool CanRename(const std::string& identifier);
|
||||
|
||||
// 验证新名称是否有效
|
||||
bool IsValidIdentifier(const std::string& new_name);
|
||||
|
||||
// 在节点中查找所有引用
|
||||
void FindIdentifiersInNode(TSNode node, const std::string& identifier, const std::string& content, std::vector<protocol::Range>& ranges);
|
||||
};
|
||||
|
||||
namespace
|
||||
{
|
||||
// 节点类型常量
|
||||
constexpr const char* kIdentifier = "identifier";
|
||||
constexpr const char* kFunctionDefinition = "function_definition_statement";
|
||||
constexpr const char* kFunctionDeclaration = "function_declaration_statement";
|
||||
constexpr const char* kClassDefinition = "class_definition_statement";
|
||||
constexpr const char* kVarStatement = "var_statement";
|
||||
constexpr const char* kStaticStatement = "static_statement";
|
||||
constexpr const char* kGlobalStatement = "global_statement";
|
||||
constexpr const char* kConstStatement = "const_statement";
|
||||
constexpr const char* kMethodDeclaration = "method_declaration";
|
||||
constexpr const char* kMethodDeclarationOnly = "method_declaration_only";
|
||||
constexpr const char* kMethodWithModifier = "method_with_modifier";
|
||||
constexpr const char* kMethodWithImplementation = "method_with_implementation";
|
||||
constexpr const char* kPropertyDeclaration = "property_declaration";
|
||||
constexpr const char* kAssignmentExpression = "assignment_expression";
|
||||
constexpr const char* kVarDeclaration = "var_declaration";
|
||||
constexpr const char* kStaticDeclaration = "static_declaration";
|
||||
constexpr const char* kGlobalDeclaration = "global_declaration";
|
||||
|
||||
// TSF语言关键字(不能用作标识符)
|
||||
const std::set<std::string> kReservedKeywords = {
|
||||
"and",
|
||||
"array",
|
||||
"begin",
|
||||
"case",
|
||||
"class",
|
||||
"const",
|
||||
"constructor",
|
||||
"destructor",
|
||||
"div",
|
||||
"do",
|
||||
"downto",
|
||||
"else",
|
||||
"end",
|
||||
"except",
|
||||
"file",
|
||||
"finally",
|
||||
"for",
|
||||
"function",
|
||||
"global",
|
||||
"goto",
|
||||
"if",
|
||||
"implementation",
|
||||
"in",
|
||||
"inherited",
|
||||
"initialization",
|
||||
"interface",
|
||||
"is",
|
||||
"label",
|
||||
"mod",
|
||||
"nil",
|
||||
"not",
|
||||
"object",
|
||||
"of",
|
||||
"or",
|
||||
"packed",
|
||||
"procedure",
|
||||
"program",
|
||||
"property",
|
||||
"raise",
|
||||
"record",
|
||||
"repeat",
|
||||
"set",
|
||||
"shl",
|
||||
"shr",
|
||||
"static",
|
||||
"string",
|
||||
"then",
|
||||
"to",
|
||||
"try",
|
||||
"type",
|
||||
"unit",
|
||||
"until",
|
||||
"uses",
|
||||
"var",
|
||||
"while",
|
||||
"with",
|
||||
"true",
|
||||
"false",
|
||||
"self",
|
||||
"virtual",
|
||||
"override",
|
||||
"overload",
|
||||
"public",
|
||||
"private",
|
||||
"protected",
|
||||
"published",
|
||||
"finalization",
|
||||
"break",
|
||||
"continue",
|
||||
"exit",
|
||||
"return",
|
||||
"new",
|
||||
"free",
|
||||
"echo"
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./selection_range.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.selection_range;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class SelectionRange : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
SelectionRange() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentSelectionRange";
|
||||
}
|
||||
|
||||
std::string SelectionRange::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string SelectionRange::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentSelectionRangeProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class SelectionRange : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
SelectionRange() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
#include <ctime>
|
||||
#include "./semantic_tokens.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string SemanticTokensRange::GetMethod() const
|
||||
{
|
||||
return "textDocument/semanticTokens/range";
|
||||
}
|
||||
|
||||
std::string SemanticTokensRange::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentSemanticTokensRange";
|
||||
}
|
||||
|
||||
std::string SemanticTokensRange::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentSemanticTokensRangeProvider: Providing response for method {}", request.method);
|
||||
}
|
||||
|
||||
std::string SemanticTokensFull::GetMethod() const
|
||||
{
|
||||
return "textDocument/semanticTokens/full";
|
||||
}
|
||||
|
||||
std::string SemanticTokensFull::GetProviderName() const
|
||||
{
|
||||
return "SemanticTokensFull";
|
||||
}
|
||||
|
||||
std::string SemanticTokensFull::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("SemanticTokensFullProvider: Providing response for method {}", request.method);
|
||||
}
|
||||
|
||||
std::string SemanticTokensFullDelta::GetMethod() const
|
||||
{
|
||||
return "textDocument/semanticTokens/full/delta";
|
||||
}
|
||||
|
||||
std::string SemanticTokensFullDelta::GetProviderName() const
|
||||
{
|
||||
return "SemanticTokensFullDelta";
|
||||
}
|
||||
|
||||
std::string SemanticTokensFullDelta::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("SemanticTokensFullDeltaProvider: Providing response for method {}", request.method);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.semantic_tokens;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
import lsp.manager.manager_hub;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class SemanticTokensRange : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
|
||||
class SemanticTokensFull : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
|
||||
class SemanticTokensFullDelta : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string SemanticTokensRange::GetMethod() const
|
||||
{
|
||||
return "textDocument/semanticTokens/range";
|
||||
}
|
||||
|
||||
std::string SemanticTokensRange::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentSemanticTokensRange";
|
||||
}
|
||||
|
||||
std::string SemanticTokensRange::ProvideResponse(const protocol::RequestMessage& request,
|
||||
[[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentSemanticTokensRangeProvider: Providing response for method {}", request.method);
|
||||
return BuildErrorResponseMessage(request, protocol::ErrorCodes::MethodNotFound, "Semantic tokens range not implemented");
|
||||
}
|
||||
|
||||
std::string SemanticTokensFull::GetMethod() const
|
||||
{
|
||||
return "textDocument/semanticTokens/full";
|
||||
}
|
||||
|
||||
std::string SemanticTokensFull::GetProviderName() const
|
||||
{
|
||||
return "SemanticTokensFull";
|
||||
}
|
||||
|
||||
std::string SemanticTokensFull::ProvideResponse(const protocol::RequestMessage& request,
|
||||
[[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("SemanticTokensFullProvider: Providing response for method {}", request.method);
|
||||
return BuildErrorResponseMessage(request, protocol::ErrorCodes::MethodNotFound, "Semantic tokens full not implemented");
|
||||
}
|
||||
|
||||
std::string SemanticTokensFullDelta::GetMethod() const
|
||||
{
|
||||
return "textDocument/semanticTokens/full/delta";
|
||||
}
|
||||
|
||||
std::string SemanticTokensFullDelta::GetProviderName() const
|
||||
{
|
||||
return "SemanticTokensFullDelta";
|
||||
}
|
||||
|
||||
std::string SemanticTokensFullDelta::ProvideResponse(const protocol::RequestMessage& request,
|
||||
[[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("SemanticTokensFullDeltaProvider: Providing response for method {}", request.method);
|
||||
return BuildErrorResponseMessage(request, protocol::ErrorCodes::MethodNotFound, "Semantic tokens delta not implemented");
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
#pragma once
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include "../base/interface.hpp"
|
||||
#include "../../protocol/protocol.hpp"
|
||||
#include "../../service/document.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class SemanticTokensRange : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
|
||||
class SemanticTokensFull : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
|
||||
class SemanticTokensFullDelta : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./signature_help.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.signature_help;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class SignatureHelp : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
SignatureHelp() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentSignatureHelp";
|
||||
}
|
||||
|
||||
std::string SignatureHelp::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string SignatureHelp::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentSignatureHelpProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class SignatureHelp : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
SignatureHelp() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
+27
-6
@@ -1,6 +1,27 @@
|
||||
#include <spdlog/spdlog.h>
|
||||
#include "./type_definition.hpp"
|
||||
#include "../../protocol/transform/facade.hpp"
|
||||
module;
|
||||
|
||||
|
||||
export module lsp.provider.text_document.type_definition;
|
||||
import spdlog;
|
||||
|
||||
import std;
|
||||
|
||||
import lsp.protocol;
|
||||
import lsp.codec.facade;
|
||||
import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class TypeDefinition : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
TypeDefinition() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
@@ -14,15 +35,15 @@ namespace lsp::provider::text_document
|
||||
return "TextDocumentTypeDefinition";
|
||||
}
|
||||
|
||||
std::string TypeDefinition::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
std::string TypeDefinition::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
spdlog::debug("TextDocumentTypeDefinitionProvider: Providing response for method {}", request.method);
|
||||
|
||||
|
||||
// TODO: Implement the actual request handling logic
|
||||
// 1. Parse request parameters
|
||||
// 2. Process the request using appropriate services
|
||||
// 3. Return formatted response
|
||||
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
#include "../base/interface.hpp"
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
class TypeDefinition : public IRequestProvider
|
||||
{
|
||||
public:
|
||||
TypeDefinition() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user