#include <spdlog/spdlog.h>
#include "../initialize/initialize.hpp"
#include "../initialized/initialized.hpp"
#include "../text_document/did_open.hpp"
#include "../text_document/did_change.hpp"
#include "../text_document/did_close.hpp"
#include "../text_document/completion.hpp"
// #include "../text_document/semantic_tokens.hpp"
#include "../trace/set_trace.hpp"
#include "../shutdown/shutdown.hpp"
#include "../cancel_request/cancel_request.hpp"
#include "../exit/exit.hpp"
#include "../completion_item/resolve.hpp"
#include "./registry.hpp"
#include "./bootstrap.hpp"

namespace lsp::provider
{

    void RegisterAllProviders(core::RequestDispatcher& dispatcher)
    {
        spdlog::info("Registering LSP providers...");

        RegisterProvider<Initialize>(dispatcher);
        RegisterProvider<Initialized>(dispatcher);
        RegisterProvider<text_document::DidOpen>(dispatcher);
        RegisterProvider<text_document::DidChange>(dispatcher);
        RegisterProvider<text_document::DidClose>(dispatcher);
        RegisterProvider<text_document::Completion>(dispatcher);
        // RegisterProvider<text_document::SemanticTokensRange>(dispatcher);
        // RegisterProvider<text_document::SemanticTokensFull>(dispatcher);
        // RegisterProvider<text_document::SemanticTokensFullDelta>(dispatcher);
        RegisterProvider<completion_item::Resolve>(dispatcher);
        RegisterProvider<SetTrace>(dispatcher);
        RegisterProvider<Shutdown>(dispatcher);
        RegisterProvider<CancelRequest>(dispatcher);
        RegisterProvider<Exit>(dispatcher);

        spdlog::info("Successfully registered {} LSP providers", dispatcher.GetAllSupportedMethods().size());
    }

}
