#pragma once
#include "./basic_types.hpp"
#include "./progress.hpp"

namespace lsp::protocol
{
    // Configuration
    struct ConfigurationItem
    {
        std::optional<URI> scopeUri;
        std::optional<string> section;
    };

    struct ConfigurationParams
    {
        std::vector<ConfigurationParams> items;
    };

    struct DidChangeConfigurationClientCapabilities
    {
        std::optional<boolean> dynamicRegistration;
    };

    struct DidChangeConfigurationParams
    {
        LSPAny settings;
    };

    // Command Execution
    struct ExecuteCommandClientCapabilities
    {
        std::optional<boolean> dynamicRegistration;
    };

    struct ExecuteCommandOptions : WorkDoneProgressOptions
    {
        std::vector<Command> commands;
    };

    struct ExecuteCommandRegistrationOptions : ExecuteCommandOptions
    {
    };

    struct ExecuteCommandParams : WorkDoneProgressParams
    {
        string command;
        std::optional<std::vector<LSPAny>> arguments;
    };

    // Message
    enum class MessageType
    {
        Error = 1,
        Warning = 2,
        Info = 3,
        Log = 4,
        Debug = 5
    };

    struct ShowMessageParams
    {
        MessageType type;
        string message;
    };

    struct ShowMessageRequestClientCapabilities
    {
        struct MessageActionItem
        {
            std::optional<boolean> additionalPropertiesSupport;
        };
        std::optional<MessageActionItem> messageActionItem;
    };

    struct MessageActionItem
    {
        std::string title;
    };

    struct ShowMessageRequestParams
    {
        MessageType type;
        string message;
        std::optional<std::vector<MessageActionItem>> actions;
    };

    struct ShowDocumentClientCapabilities
    {
        boolean support;
    };

    struct ShowDocumentParams
    {
        URI uri;
        std::optional<boolean> external;
        std::optional<boolean> takeFocus;
        std::optional<boolean> selection;
    };

    struct ShowDocumentResult
    {
        boolean success;
    };

    struct LogMessageParams
    {
        MessageType type;
        string message;
    };

}
