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

namespace lsp::protocol
{
    enum class PrepareSupportDefaultBehavior
    {
        Identifier = 1
    };

    // Rename
    struct RenameClientCapabilities
    {
        std::optional<boolean> dynamicRegistration;
        std::optional<boolean> prepareSupport;
        std::optional<PrepareSupportDefaultBehavior> prepareSupportDefaultBehavior;
        std::optional<boolean> honorsChangeAnnotations;
    };

    struct RenameOptions : WorkDoneProgressOptions
    {
        std::optional<boolean> prepareProvider;
    };

    struct RenameRegistrationOptions : TextDocumentRegistrationOptions, RenameOptions
    {
    };

    struct RenameParams : TextDocumentPositionParams, WorkDoneProgressParams
    {
        string newName;
    };

    struct PrepareRenameParams : TextDocumentPositionParams, WorkDoneProgressParams
    {
    };

    // Linked Editing Range
    struct LinkedEditingRangeClientCapabilities
    {
        std::optional<boolean> dynamicRegistration;
    };

    struct LinkedEditingRangeOptions : WorkDoneProgressOptions
    {
    };

    struct LinkedEditingRangeRegistrationOptions : TextDocumentRegistrationOptions, LinkedEditingRangeOptions, StaticRegistrationOptions
    {
    };

    struct LinkedEditingRangeParams : TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams
    {
    };

    struct LinkedEditingRanges
    {
        std::vector<Range> ranges;
        std::optional<string> wordPattern;
    };

}
