#pragma once

#include "../../protocol/protocol.hpp"

extern "C" {
#include <tree_sitter/api.h>
}

namespace lsp::service::events
{
    using DocumentOpend = protocol::DidOpenTextDocumentParams;
    using DocumentClosed = protocol::DidCloseTextDocumentParams;

    struct DocumentChanged
    {
        protocol::DocumentUri uri;
        protocol::integer version;
        std::vector<protocol::TextDocumentContentChangeEvent> changes;
        protocol::string content;
    };

    struct DocumentParsed
    {
        protocol::TextDocumentItem item;
        TSTree* tree;
    };

    struct DocumentReparsed
    {
        protocol::TextDocumentItem item;
        TSTree* tree;
    };
}
