✨ feat(provider): add compile-time registry
This commit is contained in:
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class CodeAction : public IRequestProvider
|
||||
class CodeAction : public AutoRegisterProvider<CodeAction, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/codeAction";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentCodeAction";
|
||||
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)
|
||||
{
|
||||
@@ -45,4 +39,4 @@ namespace lsp::provider::text_document
|
||||
// 3. Return formatted response
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class CodeLens : public IRequestProvider
|
||||
class CodeLens : public AutoRegisterProvider<CodeLens, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/codeLens";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentCodeLens";
|
||||
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
|
||||
{
|
||||
std::string CodeLens::GetMethod() const
|
||||
{
|
||||
return "textDocument/codeLens";
|
||||
}
|
||||
|
||||
|
||||
std::string CodeLens::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentCodeLens";
|
||||
}
|
||||
|
||||
|
||||
std::string CodeLens::ProvideResponse(const protocol::RequestMessage& request,
|
||||
[[maybe_unused]] ExecutionContext& context)
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
// 3. Return formatted response
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class ColorPresentation : public IRequestProvider
|
||||
class ColorPresentation : public AutoRegisterProvider<ColorPresentation, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/colorPresentation";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentColorPresentation";
|
||||
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
|
||||
{
|
||||
std::string ColorPresentation::GetMethod() const
|
||||
{
|
||||
return "textDocument/colorPresentation";
|
||||
}
|
||||
|
||||
|
||||
std::string ColorPresentation::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentColorPresentation";
|
||||
}
|
||||
|
||||
|
||||
std::string ColorPresentation::ProvideResponse(const protocol::RequestMessage& request,
|
||||
[[maybe_unused]] ExecutionContext& context)
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
// 3. Return formatted response
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,11 +21,11 @@ namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Completion : public IRequestProvider
|
||||
class Completion : public AutoRegisterProvider<Completion, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
static constexpr std::string_view kMethod = "textDocument/completion";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentCompletion";
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& execution_context) override;
|
||||
};
|
||||
}
|
||||
@@ -1510,15 +1510,9 @@ namespace lsp::provider::text_document
|
||||
}
|
||||
}
|
||||
|
||||
std::string Completion::GetMethod() const
|
||||
{
|
||||
return "textDocument/completion";
|
||||
}
|
||||
|
||||
|
||||
std::string Completion::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentCompletion";
|
||||
}
|
||||
|
||||
|
||||
std::string Completion::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& execution_context)
|
||||
{
|
||||
@@ -1543,4 +1537,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return *json;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,13 +25,13 @@ namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Definition : public IRequestProvider
|
||||
class Definition : public AutoRegisterProvider<Definition, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/definition";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentDefinition";
|
||||
Definition() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
|
||||
private:
|
||||
@@ -51,15 +51,9 @@ export namespace lsp::provider::text_document
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string Definition::GetMethod() const
|
||||
{
|
||||
return "textDocument/definition";
|
||||
}
|
||||
|
||||
|
||||
std::string Definition::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentDefinition";
|
||||
}
|
||||
|
||||
|
||||
std::string Definition::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
{
|
||||
@@ -79,14 +73,7 @@ namespace lsp::provider::text_document
|
||||
protocol::ResponseMessage response;
|
||||
response.id = request.id;
|
||||
|
||||
if (location.has_value())
|
||||
{
|
||||
response.result = transform::ToLSPAny(*location);
|
||||
}
|
||||
else
|
||||
{
|
||||
response.result = std::nullopt;
|
||||
}
|
||||
response.result = transform::ToLSPAny(location);
|
||||
|
||||
std::optional<std::string> json = transform::Serialize(response);
|
||||
if (!json.has_value())
|
||||
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Diagnostic : public IRequestProvider
|
||||
class Diagnostic : public AutoRegisterProvider<Diagnostic, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/diagnostic";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentDiagnostic";
|
||||
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)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,13 +14,13 @@ namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DidChange : public INotificationProvider
|
||||
class DidChange : public AutoRegisterProvider<DidChange, INotificationProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/didChange";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentDidChange";
|
||||
DidChange() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
@@ -28,15 +28,9 @@ export namespace lsp::provider::text_document
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
|
||||
std::string DidChange::GetMethod() const
|
||||
{
|
||||
return "textDocument/didChange";
|
||||
}
|
||||
|
||||
|
||||
std::string DidChange::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentDidChange";
|
||||
}
|
||||
|
||||
|
||||
void DidChange::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
|
||||
{
|
||||
@@ -50,4 +44,4 @@ namespace lsp::provider::text_document
|
||||
spdlog::info("Document updated: {}", params.textDocument.uri);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,13 +14,13 @@ namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DidClose : public INotificationProvider
|
||||
class DidClose : public AutoRegisterProvider<DidClose, INotificationProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/didClose";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentDidClose";
|
||||
DidClose() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
void HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context) override;
|
||||
};
|
||||
}
|
||||
@@ -28,15 +28,9 @@ export namespace lsp::provider::text_document
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
|
||||
std::string DidClose::GetMethod() const
|
||||
{
|
||||
return "textDocument/didClose";
|
||||
}
|
||||
|
||||
|
||||
std::string DidClose::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentDidClose";
|
||||
}
|
||||
|
||||
|
||||
void DidClose::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
|
||||
{
|
||||
@@ -50,4 +44,4 @@ namespace lsp::provider::text_document
|
||||
spdlog::info("Document closed: {}", params.textDocument.uri);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,28 +14,22 @@ namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DidOpen : public INotificationProvider
|
||||
class DidOpen : public AutoRegisterProvider<DidOpen, INotificationProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/didOpen";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentDidOpen";
|
||||
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
|
||||
{
|
||||
std::string DidOpen::GetMethod() const
|
||||
{
|
||||
return "textDocument/didOpen";
|
||||
}
|
||||
|
||||
|
||||
std::string DidOpen::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentDidOpen";
|
||||
}
|
||||
|
||||
|
||||
void DidOpen::HandleNotification(const protocol::NotificationMessage& notification, ExecutionContext& context)
|
||||
{
|
||||
@@ -59,4 +53,4 @@ namespace lsp::provider::text_document
|
||||
spdlog::info("Document opened: {}", params.textDocument.uri);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DocumentColor : public IRequestProvider
|
||||
class DocumentColor : public AutoRegisterProvider<DocumentColor, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/documentColor";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentDocumentColor";
|
||||
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)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DocumentHighlight : public IRequestProvider
|
||||
class DocumentHighlight : public AutoRegisterProvider<DocumentHighlight, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/documentHighlight";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentDocumentHighlight";
|
||||
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)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DocumentLink : public IRequestProvider
|
||||
class DocumentLink : public AutoRegisterProvider<DocumentLink, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/documentLink";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentDocumentLink";
|
||||
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
|
||||
{
|
||||
std::string DocumentLink::GetMethod() const
|
||||
{
|
||||
return "textDocument/documentLink";
|
||||
}
|
||||
|
||||
|
||||
std::string DocumentLink::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentDocumentLink";
|
||||
}
|
||||
|
||||
|
||||
std::string DocumentLink::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class DocumentSymbol : public IRequestProvider
|
||||
class DocumentSymbol : public AutoRegisterProvider<DocumentSymbol, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/documentSymbol";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentDocumentSymbol";
|
||||
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
|
||||
{
|
||||
std::string DocumentSymbol::GetMethod() const
|
||||
{
|
||||
return "textDocument/documentSymbol";
|
||||
}
|
||||
|
||||
|
||||
std::string DocumentSymbol::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentDocumentSymbol";
|
||||
}
|
||||
|
||||
|
||||
std::string DocumentSymbol::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class FoldingRange : public IRequestProvider
|
||||
class FoldingRange : public AutoRegisterProvider<FoldingRange, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/foldingRange";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentFoldingRange";
|
||||
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
|
||||
{
|
||||
std::string FoldingRange::GetMethod() const
|
||||
{
|
||||
return "textDocument/foldingRange";
|
||||
}
|
||||
|
||||
|
||||
std::string FoldingRange::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentFoldingRange";
|
||||
}
|
||||
|
||||
|
||||
std::string FoldingRange::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Formatting : public IRequestProvider
|
||||
class Formatting : public AutoRegisterProvider<Formatting, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/formatting";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentFormatting";
|
||||
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
|
||||
{
|
||||
std::string Formatting::GetMethod() const
|
||||
{
|
||||
return "textDocument/formatting";
|
||||
}
|
||||
|
||||
|
||||
std::string Formatting::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentFormatting";
|
||||
}
|
||||
|
||||
|
||||
std::string Formatting::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Hover : public IRequestProvider
|
||||
class Hover : public AutoRegisterProvider<Hover, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/hover";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentHover";
|
||||
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
|
||||
{
|
||||
std::string Hover::GetMethod() const
|
||||
{
|
||||
return "textDocument/hover";
|
||||
}
|
||||
|
||||
|
||||
std::string Hover::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentHover";
|
||||
}
|
||||
|
||||
|
||||
std::string Hover::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Implementation : public IRequestProvider
|
||||
class Implementation : public AutoRegisterProvider<Implementation, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/implementation";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentImplementation";
|
||||
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
|
||||
{
|
||||
std::string Implementation::GetMethod() const
|
||||
{
|
||||
return "textDocument/implementation";
|
||||
}
|
||||
|
||||
|
||||
std::string Implementation::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentImplementation";
|
||||
}
|
||||
|
||||
|
||||
std::string Implementation::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class InlayHint : public IRequestProvider
|
||||
class InlayHint : public AutoRegisterProvider<InlayHint, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/inlayHint";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentInlayHint";
|
||||
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
|
||||
{
|
||||
std::string InlayHint::GetMethod() const
|
||||
{
|
||||
return "textDocument/inlayHint";
|
||||
}
|
||||
|
||||
|
||||
std::string InlayHint::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentInlayHint";
|
||||
}
|
||||
|
||||
|
||||
std::string InlayHint::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class InlineValue : public IRequestProvider
|
||||
class InlineValue : public AutoRegisterProvider<InlineValue, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/inlineValue";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentInlineValue";
|
||||
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
|
||||
{
|
||||
std::string InlineValue::GetMethod() const
|
||||
{
|
||||
return "textDocument/inlineValue";
|
||||
}
|
||||
|
||||
|
||||
std::string InlineValue::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentInlineValue";
|
||||
}
|
||||
|
||||
|
||||
std::string InlineValue::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class LinkedEditingRange : public IRequestProvider
|
||||
class LinkedEditingRange : public AutoRegisterProvider<LinkedEditingRange, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/linkedEditingRange";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentLinkedEditingRange";
|
||||
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
|
||||
{
|
||||
std::string LinkedEditingRange::GetMethod() const
|
||||
{
|
||||
return "textDocument/linkedEditingRange";
|
||||
}
|
||||
|
||||
|
||||
std::string LinkedEditingRange::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentLinkedEditingRange";
|
||||
}
|
||||
|
||||
|
||||
std::string LinkedEditingRange::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Moniker : public IRequestProvider
|
||||
class Moniker : public AutoRegisterProvider<Moniker, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/moniker";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentMoniker";
|
||||
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
|
||||
{
|
||||
std::string Moniker::GetMethod() const
|
||||
{
|
||||
return "textDocument/moniker";
|
||||
}
|
||||
|
||||
|
||||
std::string Moniker::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentMoniker";
|
||||
}
|
||||
|
||||
|
||||
std::string Moniker::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class OnTypeFormatting : public IRequestProvider
|
||||
class OnTypeFormatting : public AutoRegisterProvider<OnTypeFormatting, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/onTypeFormatting";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentOnTypeFormatting";
|
||||
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
|
||||
{
|
||||
std::string OnTypeFormatting::GetMethod() const
|
||||
{
|
||||
return "textDocument/onTypeFormatting";
|
||||
}
|
||||
|
||||
|
||||
std::string OnTypeFormatting::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentOnTypeFormatting";
|
||||
}
|
||||
|
||||
|
||||
std::string OnTypeFormatting::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class PrepareCallHierarchy : public IRequestProvider
|
||||
class PrepareCallHierarchy : public AutoRegisterProvider<PrepareCallHierarchy, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/prepareCallHierarchy";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentPrepareCallHierarchy";
|
||||
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
|
||||
{
|
||||
std::string PrepareCallHierarchy::GetMethod() const
|
||||
{
|
||||
return "textDocument/prepareCallHierarchy";
|
||||
}
|
||||
|
||||
|
||||
std::string PrepareCallHierarchy::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentPrepareCallHierarchy";
|
||||
}
|
||||
|
||||
|
||||
std::string PrepareCallHierarchy::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class PrepareRename : public IRequestProvider
|
||||
class PrepareRename : public AutoRegisterProvider<PrepareRename, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/prepareRename";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentPrepareRename";
|
||||
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
|
||||
{
|
||||
std::string PrepareRename::GetMethod() const
|
||||
{
|
||||
return "textDocument/prepareRename";
|
||||
}
|
||||
|
||||
|
||||
std::string PrepareRename::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentPrepareRename";
|
||||
}
|
||||
|
||||
|
||||
std::string PrepareRename::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class PrepareTypeHierarchy : public IRequestProvider
|
||||
class PrepareTypeHierarchy : public AutoRegisterProvider<PrepareTypeHierarchy, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/prepareTypeHierarchy";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentPrepareTypeHierarchy";
|
||||
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
|
||||
{
|
||||
std::string PrepareTypeHierarchy::GetMethod() const
|
||||
{
|
||||
return "textDocument/prepareTypeHierarchy";
|
||||
}
|
||||
|
||||
|
||||
std::string PrepareTypeHierarchy::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentPrepareTypeHierarchy";
|
||||
}
|
||||
|
||||
|
||||
std::string PrepareTypeHierarchy::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class PublishDiagnostics : public INotificationProvider
|
||||
class PublishDiagnostics : public AutoRegisterProvider<PublishDiagnostics, INotificationProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/publishDiagnostics";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentPublishDiagnostics";
|
||||
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
|
||||
{
|
||||
std::string PublishDiagnostics::GetMethod() const
|
||||
{
|
||||
return "textDocument/publishDiagnostics";
|
||||
}
|
||||
|
||||
|
||||
std::string PublishDiagnostics::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentPublishDiagnostics";
|
||||
}
|
||||
|
||||
|
||||
void PublishDiagnostics::HandleNotification(const protocol::NotificationMessage& notification, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -44,4 +38,4 @@ namespace lsp::provider::text_document
|
||||
// 2. Update appropriate services/state
|
||||
// 3. Trigger any necessary side effects
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class RangeFormatting : public IRequestProvider
|
||||
class RangeFormatting : public AutoRegisterProvider<RangeFormatting, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/rangeFormatting";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentRangeFormatting";
|
||||
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
|
||||
{
|
||||
std::string RangeFormatting::GetMethod() const
|
||||
{
|
||||
return "textDocument/rangeFormatting";
|
||||
}
|
||||
|
||||
|
||||
std::string RangeFormatting::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentRangeFormatting";
|
||||
}
|
||||
|
||||
|
||||
std::string RangeFormatting::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,13 +22,13 @@ namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class References : public IRequestProvider
|
||||
class References : public AutoRegisterProvider<References, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/references";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentReferences";
|
||||
References() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
|
||||
private:
|
||||
@@ -60,15 +60,9 @@ export namespace lsp::provider::text_document
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string References::GetMethod() const
|
||||
{
|
||||
return "textDocument/references";
|
||||
}
|
||||
|
||||
|
||||
std::string References::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentReferences";
|
||||
}
|
||||
|
||||
|
||||
std::string References::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -197,4 +191,4 @@ namespace lsp::provider::text_document
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,13 +22,13 @@ namespace transform = lsp::codec;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class Rename : public IRequestProvider
|
||||
class Rename : public AutoRegisterProvider<Rename, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/rename";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentRename";
|
||||
Rename() = default;
|
||||
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
|
||||
private:
|
||||
@@ -160,15 +160,9 @@ export namespace lsp::provider::text_document
|
||||
|
||||
namespace lsp::provider::text_document
|
||||
{
|
||||
std::string Rename::GetMethod() const
|
||||
{
|
||||
return "textDocument/rename";
|
||||
}
|
||||
|
||||
|
||||
std::string Rename::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentRename";
|
||||
}
|
||||
|
||||
|
||||
std::string Rename::ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context)
|
||||
{
|
||||
@@ -195,15 +189,7 @@ namespace lsp::provider::text_document
|
||||
protocol::ResponseMessage response;
|
||||
response.id = request.id;
|
||||
|
||||
if (workspace_edit_opt.has_value())
|
||||
{
|
||||
response.result = transform::ToLSPAny(*workspace_edit_opt);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 返回 null 表示没有需要修改的内容或无法重命名
|
||||
response.result = std::nullopt;
|
||||
}
|
||||
response.result = transform::ToLSPAny(workspace_edit_opt);
|
||||
|
||||
std::optional<std::string> json = transform::Serialize(response);
|
||||
if (!json.has_value())
|
||||
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class SelectionRange : public IRequestProvider
|
||||
class SelectionRange : public AutoRegisterProvider<SelectionRange, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/selectionRange";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentSelectionRange";
|
||||
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
|
||||
{
|
||||
std::string SelectionRange::GetMethod() const
|
||||
{
|
||||
return "textDocument/selectionRange";
|
||||
}
|
||||
|
||||
|
||||
std::string SelectionRange::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentSelectionRange";
|
||||
}
|
||||
|
||||
|
||||
std::string SelectionRange::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,42 +13,36 @@ import lsp.manager.manager_hub;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class SemanticTokensRange : public IRequestProvider
|
||||
class SemanticTokensRange : public AutoRegisterProvider<SemanticTokensRange, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
static constexpr std::string_view kMethod = "textDocument/semanticTokens/range";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentSemanticTokensRange";
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
|
||||
class SemanticTokensFull : public IRequestProvider
|
||||
class SemanticTokensFull : public AutoRegisterProvider<SemanticTokensFull, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
static constexpr std::string_view kMethod = "textDocument/semanticTokens/full";
|
||||
static constexpr std::string_view kProviderName = "SemanticTokensFull";
|
||||
std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
|
||||
};
|
||||
|
||||
class SemanticTokensFullDelta : public IRequestProvider
|
||||
class SemanticTokensFullDelta : public AutoRegisterProvider<SemanticTokensFullDelta, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
std::string GetMethod() const override;
|
||||
std::string GetProviderName() const override;
|
||||
static constexpr std::string_view kMethod = "textDocument/semanticTokens/full/delta";
|
||||
static constexpr std::string_view kProviderName = "SemanticTokensFullDelta";
|
||||
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)
|
||||
@@ -57,15 +51,9 @@ namespace lsp::provider::text_document
|
||||
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)
|
||||
@@ -74,15 +62,9 @@ namespace lsp::provider::text_document
|
||||
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)
|
||||
@@ -90,4 +72,4 @@ namespace lsp::provider::text_document
|
||||
spdlog::debug("SemanticTokensFullDeltaProvider: Providing response for method {}", request.method);
|
||||
return BuildErrorResponseMessage(request, protocol::ErrorCodes::MethodNotFound, "Semantic tokens delta not implemented");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class SignatureHelp : public IRequestProvider
|
||||
class SignatureHelp : public AutoRegisterProvider<SignatureHelp, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/signatureHelp";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentSignatureHelp";
|
||||
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
|
||||
{
|
||||
std::string SignatureHelp::GetMethod() const
|
||||
{
|
||||
return "textDocument/signatureHelp";
|
||||
}
|
||||
|
||||
|
||||
std::string SignatureHelp::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentSignatureHelp";
|
||||
}
|
||||
|
||||
|
||||
std::string SignatureHelp::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,28 +12,22 @@ import lsp.provider.base.interface;
|
||||
|
||||
export namespace lsp::provider::text_document
|
||||
{
|
||||
class TypeDefinition : public IRequestProvider
|
||||
class TypeDefinition : public AutoRegisterProvider<TypeDefinition, IRequestProvider>
|
||||
{
|
||||
public:
|
||||
static constexpr std::string_view kMethod = "textDocument/typeDefinition";
|
||||
static constexpr std::string_view kProviderName = "TextDocumentTypeDefinition";
|
||||
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
|
||||
{
|
||||
std::string TypeDefinition::GetMethod() const
|
||||
{
|
||||
return "textDocument/typeDefinition";
|
||||
}
|
||||
|
||||
|
||||
std::string TypeDefinition::GetProviderName() const
|
||||
{
|
||||
return "TextDocumentTypeDefinition";
|
||||
}
|
||||
|
||||
|
||||
std::string TypeDefinition::ProvideResponse(const protocol::RequestMessage& request, [[maybe_unused]] ExecutionContext& context)
|
||||
{
|
||||
@@ -46,4 +40,4 @@ namespace lsp::provider::text_document
|
||||
|
||||
return "{}"; // Placeholder response
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user