#include <spdlog/spdlog.h>
#include "./provider_registry.hpp"
#include "../initialize/initialize_provider.hpp"
#include "../initialized/initialized_provider.hpp"
#include "../text_document/did_open_provider.hpp"
#include "../text_document/did_change_provider.hpp"
#include "../text_document/completion_provider.hpp"
#include "../trace/set_trace_provider.hpp"
#include "../shutdown/shutdown_provider.hpp"
#include "../cancel_request/cancel_request_provider.hpp"
#include "../exit/exit_provider.hpp"

namespace lsp::providers
{

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

        RegisterProvider<initialize::InitializeProvider>(dispatcher);
        RegisterProvider<initialized::InitializedProvider>(dispatcher);
        RegisterProvider<text_document::DidOpenProvider>(dispatcher);
        RegisterProvider<text_document::DidChangeProvider>(dispatcher);
        RegisterProvider<text_document::CompletionProvider>(dispatcher);
        RegisterProvider<set_trace::SetTraceProvider>(dispatcher);
        RegisterProvider<shutdown::ShutdownProvider>(dispatcher);
        RegisterProvider<cancel_request::CancelRequestProvider>(dispatcher);
        RegisterProvider<exit::ExitProvider>(dispatcher);

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

}
