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

namespace lsp::protocol
{
    // Declaration
    struct DeclarationClientCapabilities
    {
        std::optional<boolean> dynamicRegistration;
        std::optional<boolean> linkSupport;
    };

    struct DeclarationOptions : WorkDoneProgressOptions
    {
    };

    struct DeclarationRegistrationOptions : DeclarationOptions, TextDocumentRegistrationOptions, StaticRegistrationOptions
    {
    };

    struct DeclarationParams : TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams
    {
    };

    // Definition
    struct DefinitionClientCapabilities
    {
        std::optional<boolean> dynamicRegistration;
        std::optional<boolean> linkSupport;
    };

    struct DefinitionOptions : WorkDoneProgressOptions
    {
    };

    struct DefinitionRegistrationOptions : TextDocumentRegistrationOptions, DefinitionOptions
    {
    };

    struct DefinitionParams : TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams
    {
    };

    // TypeDefinition
    struct TypeDefinitionClientCapabilities
    {
        std::optional<boolean> dynamicRegistration;
        std::optional<boolean> linkSupport;
    };

    struct TypeDefinitionOptions : WorkDoneProgressOptions
    {
    };

    struct TypeDefinitionRegistrationOptions : TextDocumentRegistrationOptions, TypeDefinitionOptions, StaticRegistrationOptions
    {
    };

    struct TypeDefinitionParams : TextDocumentPositionParams, WorkDoneProgressParams
    {
    };

    // Implementation
    struct ImplementationClientCapabilities
    {
        std::optional<boolean> dynamicRegistration;
        std::optional<boolean> linkSupport;
    };

    struct ImplementationOptions : WorkDoneProgressOptions
    {
    };

    struct ImplementationRegistrationOptions : TextDocumentRegistrationOptions, ImplementationOptions, StaticRegistrationOptions
    {
    };

    struct ImplementationParams : WorkDoneProgressParams, PartialResultParams
    {
    };

    // Reference
    struct ReferenceContext
    {
        boolean includeDeclaration;
    };
    struct ReferenceClientCapabilities
    {
        std::optional<boolean> dynamicRegistration;
    };
    struct ReferenceOptions : WorkDoneProgressOptions
    {
    };
    struct ReferenceRegistrationOptions : TextDocumentRegistrationOptions, ReferenceOptions
    {
    };
    struct ReferenceParams : TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams
    {
        ReferenceContext context;
    };

    // CallHierarchy
    struct CallHierarchyClientCapabilities
    {
        std::optional<boolean> dynamicRegistration;
    };

    struct CallHierarchyOptions : WorkDoneProgressOptions
    {
    };

    struct CallHierarchyRegistrationOptions : TextDocumentRegistrationOptions, CallHierarchyOptions, StaticRegistrationOptions
    {
    };

    struct CallHierarchyParams : TextDocumentPositionParams, WorkDoneProgressParams
    {
    };

    struct CallHierarchyItem
    {
        string name;
        SymbolKind kind;
        std::vector<SymbolTag> tags;
        DocumentUri uri;
        Range range;
        Range selectionRange;
        std::optional<LSPAny> data;
    };

    struct CallHierarchyIncomingCallsParams : WorkDoneProgressParams, PartialResultParams
    {
        CallHierarchyItem item;
    };

    struct CallHierarchyIncomingCall
    {
        CallHierarchyItem from;
        std::vector<Range> fromRanges;
    };

    struct CallHierarchyOutgoingCallsParams : WorkDoneProgressParams, PartialResultParams
    {
        CallHierarchyItem item;
    };

    struct CallHierarchyOutgoingCall
    {
        CallHierarchyItem from;
        std::vector<Range> fromRanges;
    };

    // TypeHierarchy
    struct TypeHierarchyClientCapabilities
    {
        std::optional<boolean> dynamicRegistration;
    };

    struct TypeHierarchyOptions : WorkDoneProgressOptions
    {
    };

    struct TypeHierarchyRegistrationOptions : TextDocumentRegistrationOptions, TypeHierarchyOptions, StaticRegistrationOptions
    {
    };

    struct TypeHierarchyParams : TextDocumentPositionParams, WorkDoneProgressParams
    {
    };

    struct TypeHierarchyPrepareParams : TextDocumentPositionParams, WorkDoneProgressParams
    {
    };

    struct TypeHierarchyItem
    {
        string name;
        SymbolKind kind;
        std::vector<SymbolTag> tags;
        DocumentUri uri;
        Range range;
        Range selectionRange;
        std::optional<LSPAny> data;
    };

    struct TypeHierarchySupertypesParams : WorkDoneProgressParams, PartialResultParams
    {
        TypeHierarchyItem item;
    };

    struct TypeHierarchySubtypesParams : WorkDoneProgressParams, PartialResultParams
    {
        TypeHierarchyItem item;
    };

}
