#pragma once
#include "../base/interface.hpp"

namespace lsp::provider
{
    class Initialize : public IRequestProvider
    {
    public:
        Initialize() = default;

        std::string ProvideResponse(const protocol::RequestMessage& request, ExecutionContext& context) override;
        std::string GetMethod() const override;
        std::string GetProviderName() const override;

    private:
        protocol::InitializeResult BuildInitializeResult();
        protocol::TextDocumentSyncOptions BuildTextDocumentSyncOptions();
        protocol::CompletionOptions BuildCompletionOptions();
        protocol::SemanticTokensOptions BuildSemanticTokenOptions();

        void ProcessWorkspaceFolder(const std::vector<protocol::WorkspaceFolder>& workspace_folders, ExecutionContext& context);
        std::string UriToPath(const protocol::DocumentUri& uri);
    };
}
