// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant

// this file was generated by the generate.ts script

#ifndef QLANGUAGESERVERGEN_P_H
#define QLANGUAGESERVERGEN_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include <QtLanguageServer/qtlanguageserverglobal.h>
#include <QtLanguageServer/private/qlanguageserverspec_p.h>
#include <QtLanguageServer/private/qlanguageserverbase_p.h>

#include <memory>
#include <functional>

QT_BEGIN_NAMESPACE

namespace QLspSpecification {

class ProtocolGenPrivate;

class Q_LANGUAGESERVER_EXPORT ProtocolGen : public ProtocolBase
{
protected:
    ProtocolGen(std::unique_ptr<ProtocolGenPrivate> &&p);
public:
    ~ProtocolGen();

    // Requests

    void requestCallHierarchyIncomingCalls(
            const CallHierarchyIncomingCallsParams &,
            std::function<void(const std::optional<QList<CallHierarchyIncomingCall>> &)>
                    responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerCallHierarchyIncomingCallsRequestHandler(
            const std::function<
                    void(const QByteArray &, const CallHierarchyIncomingCallsParams &,
                         LSPPartialResponse<std::optional<QList<CallHierarchyIncomingCall>>,
                                            QList<CallHierarchyIncomingCall>> &&)> &handler);
    void requestCallHierarchyOutgoingCalls(
            const CallHierarchyOutgoingCallsParams &,
            std::function<void(const std::optional<QList<CallHierarchyOutgoingCall>> &)>
                    responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerCallHierarchyOutgoingCallsRequestHandler(
            const std::function<
                    void(const QByteArray &, const CallHierarchyOutgoingCallsParams &,
                         LSPPartialResponse<std::optional<QList<CallHierarchyOutgoingCall>>,
                                            QList<CallHierarchyOutgoingCall>> &&)> &handler);
    void requestRegistration(
            const RegistrationParams &, std::function<void()> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerRegistrationRequestHandler(
            const std::function<void(const QByteArray &, const RegistrationParams &,
                                     LSPResponse<std::nullptr_t> &&)> &handler);
    void requestUnregistration(
            const UnregistrationParams &, std::function<void()> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerUnregistrationRequestHandler(
            const std::function<void(const QByteArray &, const UnregistrationParams &,
                                     LSPResponse<std::nullptr_t> &&)> &handler);
    void requestCodeActionResolve(
            const CodeAction &, std::function<void(const CodeAction &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerCodeActionResolveRequestHandler(
            const std::function<void(const QByteArray &, const CodeAction &,
                                     LSPResponse<CodeAction> &&)> &handler);
    void requestCodeLensResolve(
            const CodeLens &, std::function<void(const CodeLens &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerCodeLensResolveRequestHandler(
            const std::function<void(const QByteArray &, const CodeLens &,
                                     LSPResponse<CodeLens> &&)> &handler);
    void requestCompletionItemResolve(
            const CompletionItem &, std::function<void(const CompletionItem &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerCompletionItemResolveRequestHandler(
            const std::function<void(const QByteArray &, const CompletionItem &,
                                     LSPResponse<CompletionItem> &&)> &handler);
    void requestDocumentLinkResolve(
            const DocumentLink &, std::function<void(const DocumentLink &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDocumentLinkResolveRequestHandler(
            const std::function<void(const QByteArray &, const DocumentLink &,
                                     LSPResponse<DocumentLink> &&)> &handler);
    void requestInitialize(
            const InitializeParams &, std::function<void(const InitializeResult &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerInitializeRequestHandler(
            const std::function<void(const QByteArray &, const InitializeParams &,
                                     LSPResponse<InitializeResult> &&)> &handler);
    void requestInlayHintResolve(
            const InlayHint &, std::function<void(const InlayHint &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerInlayHintResolveRequestHandler(
            const std::function<void(const QByteArray &, const InlayHint &,
                                     LSPResponse<InlayHint> &&)> &handler);
    void
    requestShutdown(const std::nullptr_t &, std::function<void()> responseHandler,
                    ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerShutdownRequestHandler(
            const std::function<void(const QByteArray &, const std::nullptr_t &,
                                     LSPResponse<std::nullptr_t> &&)> &handler);
    void requestCodeAction(
            const CodeActionParams &,
            std::function<void(const std::optional<QList<std::variant<Command, CodeAction>>> &)>
                    responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerCodeActionRequestHandler(
            const std::function<void(
                    const QByteArray &, const CodeActionParams &,
                    LSPPartialResponse<std::optional<QList<std::variant<Command, CodeAction>>>,
                                       QList<std::variant<Command, CodeAction>>> &&)> &handler);
    void
    requestCodeLens(const CodeLensParams &,
                    std::function<void(const std::optional<QList<CodeLens>> &)> responseHandler,
                    ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerCodeLensRequestHandler(
            const std::function<void(const QByteArray &, const CodeLensParams &,
                                     LSPPartialResponse<std::optional<QList<CodeLens>>,
                                                        QList<CodeLens>> &&)> &handler);
    void requestColorPresentation(
            const ColorPresentationParams &,
            std::function<void(const QList<ColorPresentation> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerColorPresentationRequestHandler(
            const std::function<void(const QByteArray &, const ColorPresentationParams &,
                                     LSPPartialResponse<QList<ColorPresentation>,
                                                        QList<ColorPresentation>> &&)> &handler);
    void requestCompletion(
            const CompletionParams &,
            std::function<void(
                    const std::optional<std::variant<QList<CompletionItem>, CompletionList>> &)>
                    responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerCompletionRequestHandler(
            const std::function<
                    void(const QByteArray &, const CompletionParams &,
                         LSPPartialResponse<
                                 std::optional<std::variant<QList<CompletionItem>, CompletionList>>,
                                 QList<CompletionItem>> &&)> &handler);
    void requestDeclaration(
            const DeclarationParams &,
            std::function<
                    void(const std::optional<std::variant<Declaration, QList<DeclarationLink>>> &)>
                    responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDeclarationRequestHandler(
            const std::function<void(
                    const QByteArray &, const DeclarationParams &,
                    LSPPartialResponse<
                            std::optional<std::variant<Declaration, QList<DeclarationLink>>>,
                            std::variant<QList<Location>, QList<DeclarationLink>>> &&)> &handler);
    void requestDefinition(
            const DefinitionParams &,
            std::function<
                    void(const std::optional<std::variant<Definition, QList<DefinitionLink>>> &)>
                    responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDefinitionRequestHandler(
            const std::function<void(
                    const QByteArray &, const DefinitionParams &,
                    LSPPartialResponse<
                            std::optional<std::variant<Definition, QList<DefinitionLink>>>,
                            std::variant<QList<Location>, QList<DefinitionLink>>> &&)> &handler);
    void requestDocumentDiagnostic(
            const DocumentDiagnosticParams &,
            std::function<void(const DocumentDiagnosticReport &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDocumentDiagnosticRequestHandler(
            const std::function<void(const QByteArray &, const DocumentDiagnosticParams &,
                                     LSPPartialResponse<DocumentDiagnosticReport,
                                                        DocumentDiagnosticReportPartialResult> &&)>
                    &handler);
    void requestDocumentColor(
            const DocumentColorParams &,
            std::function<void(const QList<ColorInformation> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDocumentColorRequestHandler(
            const std::function<void(const QByteArray &, const DocumentColorParams &,
                                     LSPPartialResponse<QList<ColorInformation>,
                                                        QList<ColorInformation>> &&)> &handler);
    void requestDocumentHighlight(
            const DocumentHighlightParams &,
            std::function<void(const std::optional<QList<DocumentHighlight>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDocumentHighlightRequestHandler(
            const std::function<void(const QByteArray &, const DocumentHighlightParams &,
                                     LSPPartialResponse<std::optional<QList<DocumentHighlight>>,
                                                        QList<DocumentHighlight>> &&)> &handler);
    void requestDocumentLink(
            const DocumentLinkParams &,
            std::function<void(const std::optional<QList<DocumentLink>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDocumentLinkRequestHandler(
            const std::function<void(const QByteArray &, const DocumentLinkParams &,
                                     LSPPartialResponse<std::optional<QList<DocumentLink>>,
                                                        QList<DocumentLink>> &&)> &handler);
    void requestDocumentSymbol(
            const DocumentSymbolParams &,
            std::function<void(const std::optional<
                               std::variant<QList<SymbolInformation>, QList<DocumentSymbol>>> &)>
                    responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDocumentSymbolRequestHandler(
            const std::function<void(
                    const QByteArray &, const DocumentSymbolParams &,
                    LSPPartialResponse<
                            std::optional<
                                    std::variant<QList<SymbolInformation>, QList<DocumentSymbol>>>,
                            std::variant<QList<SymbolInformation>, QList<DocumentSymbol>>> &&)>
                    &handler);
    void requestFoldingRange(
            const FoldingRangeParams &,
            std::function<void(const std::optional<QList<FoldingRange>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerFoldingRangeRequestHandler(
            const std::function<void(const QByteArray &, const FoldingRangeParams &,
                                     LSPPartialResponse<std::optional<QList<FoldingRange>>,
                                                        QList<FoldingRange>> &&)> &handler);
    void requestDocumentFormatting(
            const DocumentFormattingParams &,
            std::function<void(const std::optional<QList<TextEdit>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDocumentFormattingRequestHandler(
            const std::function<void(const QByteArray &, const DocumentFormattingParams &,
                                     LSPResponse<std::optional<QList<TextEdit>>> &&)> &handler);
    void
    requestHover(const HoverParams &,
                 std::function<void(const std::optional<Hover> &)> responseHandler,
                 ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerHoverRequestHandler(
            const std::function<void(const QByteArray &, const HoverParams &,
                                     LSPResponse<std::optional<Hover>> &&)> &handler);
    void requestImplementation(
            const ImplementationParams &,
            std::function<
                    void(const std::optional<std::variant<Definition, QList<DefinitionLink>>> &)>
                    responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerImplementationRequestHandler(
            const std::function<void(
                    const QByteArray &, const ImplementationParams &,
                    LSPPartialResponse<
                            std::optional<std::variant<Definition, QList<DefinitionLink>>>,
                            std::variant<QList<Location>, QList<DefinitionLink>>> &&)> &handler);
    void requestInlayHint(
            const InlayHintParams &,
            std::function<void(const std::optional<QList<InlayHint>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerInlayHintRequestHandler(
            const std::function<void(const QByteArray &, const InlayHintParams &,
                                     LSPPartialResponse<std::optional<QList<InlayHint>>,
                                                        QList<InlayHint>> &&)> &handler);
    void requestInlineCompletion(
            const InlineCompletionParams &,
            std::function<void(const std::optional<
                               std::variant<InlineCompletionList, QList<InlineCompletionItem>>> &)>
                    responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerInlineCompletionRequestHandler(
            const std::function<void(
                    const QByteArray &, const InlineCompletionParams &,
                    LSPPartialResponse<std::optional<std::variant<InlineCompletionList,
                                                                  QList<InlineCompletionItem>>>,
                                       QList<InlineCompletionItem>> &&)> &handler);
    void requestInlineValue(
            const InlineValueParams &,
            std::function<void(const std::optional<QList<InlineValue>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerInlineValueRequestHandler(
            const std::function<void(const QByteArray &, const InlineValueParams &,
                                     LSPPartialResponse<std::optional<QList<InlineValue>>,
                                                        QList<InlineValue>> &&)> &handler);
    void requestLinkedEditingRange(
            const LinkedEditingRangeParams &,
            std::function<void(const std::optional<LinkedEditingRanges> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerLinkedEditingRangeRequestHandler(
            const std::function<void(const QByteArray &, const LinkedEditingRangeParams &,
                                     LSPResponse<std::optional<LinkedEditingRanges>> &&)> &handler);
    void
    requestMoniker(const MonikerParams &,
                   std::function<void(const std::optional<QList<Moniker>> &)> responseHandler,
                   ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerMonikerRequestHandler(
            const std::function<void(const QByteArray &, const MonikerParams &,
                                     LSPPartialResponse<std::optional<QList<Moniker>>,
                                                        QList<Moniker>> &&)> &handler);
    void requestDocumentOnTypeFormatting(
            const DocumentOnTypeFormattingParams &,
            std::function<void(const std::optional<QList<TextEdit>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDocumentOnTypeFormattingRequestHandler(
            const std::function<void(const QByteArray &, const DocumentOnTypeFormattingParams &,
                                     LSPResponse<std::optional<QList<TextEdit>>> &&)> &handler);
    void requestCallHierarchyPrepare(
            const CallHierarchyPrepareParams &,
            std::function<void(const std::optional<QList<CallHierarchyItem>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerCallHierarchyPrepareRequestHandler(
            const std::function<void(const QByteArray &, const CallHierarchyPrepareParams &,
                                     LSPResponse<std::optional<QList<CallHierarchyItem>>> &&)>
                    &handler);
    void requestPrepareRename(
            const PrepareRenameParams &,
            std::function<void(const std::optional<PrepareRenameResult> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerPrepareRenameRequestHandler(
            const std::function<void(const QByteArray &, const PrepareRenameParams &,
                                     LSPResponse<std::optional<PrepareRenameResult>> &&)> &handler);
    void requestTypeHierarchyPrepare(
            const TypeHierarchyPrepareParams &,
            std::function<void(const std::optional<QList<TypeHierarchyItem>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerTypeHierarchyPrepareRequestHandler(
            const std::function<void(const QByteArray &, const TypeHierarchyPrepareParams &,
                                     LSPResponse<std::optional<QList<TypeHierarchyItem>>> &&)>
                    &handler);
    void requestDocumentRangeFormatting(
            const DocumentRangeFormattingParams &,
            std::function<void(const std::optional<QList<TextEdit>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDocumentRangeFormattingRequestHandler(
            const std::function<void(const QByteArray &, const DocumentRangeFormattingParams &,
                                     LSPResponse<std::optional<QList<TextEdit>>> &&)> &handler);
    void requestDocumentRangesFormatting(
            const DocumentRangesFormattingParams &,
            std::function<void(const std::optional<QList<TextEdit>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDocumentRangesFormattingRequestHandler(
            const std::function<void(const QByteArray &, const DocumentRangesFormattingParams &,
                                     LSPResponse<std::optional<QList<TextEdit>>> &&)> &handler);
    void requestReference(
            const ReferenceParams &,
            std::function<void(const std::optional<QList<Location>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerReferenceRequestHandler(
            const std::function<void(const QByteArray &, const ReferenceParams &,
                                     LSPPartialResponse<std::optional<QList<Location>>,
                                                        QList<Location>> &&)> &handler);
    void
    requestRename(const RenameParams &,
                  std::function<void(const std::optional<WorkspaceEdit> &)> responseHandler,
                  ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerRenameRequestHandler(
            const std::function<void(const QByteArray &, const RenameParams &,
                                     LSPResponse<std::optional<WorkspaceEdit>> &&)> &handler);
    void requestSelectionRange(
            const SelectionRangeParams &,
            std::function<void(const std::optional<QList<SelectionRange>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerSelectionRangeRequestHandler(
            const std::function<void(const QByteArray &, const SelectionRangeParams &,
                                     LSPPartialResponse<std::optional<QList<SelectionRange>>,
                                                        QList<SelectionRange>> &&)> &handler);
    void requestSemanticTokens(
            const SemanticTokensParams &,
            std::function<void(const std::optional<SemanticTokens> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerSemanticTokensRequestHandler(
            const std::function<void(const QByteArray &, const SemanticTokensParams &,
                                     LSPPartialResponse<std::optional<SemanticTokens>,
                                                        SemanticTokensPartialResult> &&)> &handler);
    void requestSemanticTokensDelta(
            const SemanticTokensDeltaParams &,
            std::function<
                    void(const std::optional<std::variant<SemanticTokens, SemanticTokensDelta>> &)>
                    responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerSemanticTokensDeltaRequestHandler(
            const std::function<
                    void(const QByteArray &, const SemanticTokensDeltaParams &,
                         LSPPartialResponse<
                                 std::optional<std::variant<SemanticTokens, SemanticTokensDelta>>,
                                 std::variant<SemanticTokensPartialResult,
                                              SemanticTokensDeltaPartialResult>> &&)> &handler);
    void requestSemanticTokensRange(
            const SemanticTokensRangeParams &,
            std::function<void(const std::optional<SemanticTokens> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerSemanticTokensRangeRequestHandler(
            const std::function<void(const QByteArray &, const SemanticTokensRangeParams &,
                                     LSPPartialResponse<std::optional<SemanticTokens>,
                                                        SemanticTokensPartialResult> &&)> &handler);
    void requestSignatureHelp(
            const SignatureHelpParams &,
            std::function<void(const std::optional<SignatureHelp> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerSignatureHelpRequestHandler(
            const std::function<void(const QByteArray &, const SignatureHelpParams &,
                                     LSPResponse<std::optional<SignatureHelp>> &&)> &handler);
    void requestTypeDefinition(
            const TypeDefinitionParams &,
            std::function<
                    void(const std::optional<std::variant<Definition, QList<DefinitionLink>>> &)>
                    responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerTypeDefinitionRequestHandler(
            const std::function<void(
                    const QByteArray &, const TypeDefinitionParams &,
                    LSPPartialResponse<
                            std::optional<std::variant<Definition, QList<DefinitionLink>>>,
                            std::variant<QList<Location>, QList<DefinitionLink>>> &&)> &handler);
    void requestWillSaveTextDocument(
            const WillSaveTextDocumentParams &,
            std::function<void(const std::optional<QList<TextEdit>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerWillSaveTextDocumentRequestHandler(
            const std::function<void(const QByteArray &, const WillSaveTextDocumentParams &,
                                     LSPResponse<std::optional<QList<TextEdit>>> &&)> &handler);
    void requestTypeHierarchySubtypes(
            const TypeHierarchySubtypesParams &,
            std::function<void(const std::optional<QList<TypeHierarchyItem>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerTypeHierarchySubtypesRequestHandler(
            const std::function<void(const QByteArray &, const TypeHierarchySubtypesParams &,
                                     LSPPartialResponse<std::optional<QList<TypeHierarchyItem>>,
                                                        QList<TypeHierarchyItem>> &&)> &handler);
    void requestTypeHierarchySupertypes(
            const TypeHierarchySupertypesParams &,
            std::function<void(const std::optional<QList<TypeHierarchyItem>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerTypeHierarchySupertypesRequestHandler(
            const std::function<void(const QByteArray &, const TypeHierarchySupertypesParams &,
                                     LSPPartialResponse<std::optional<QList<TypeHierarchyItem>>,
                                                        QList<TypeHierarchyItem>> &&)> &handler);
    void requestShowDocument(
            const ShowDocumentParams &,
            std::function<void(const ShowDocumentResult &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerShowDocumentRequestHandler(
            const std::function<void(const QByteArray &, const ShowDocumentParams &,
                                     LSPResponse<ShowDocumentResult> &&)> &handler);
    void requestShowMessageRequest(
            const ShowMessageRequestParams &,
            std::function<void(const std::optional<MessageActionItem> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerShowMessageRequestRequestHandler(
            const std::function<void(const QByteArray &, const ShowMessageRequestParams &,
                                     LSPResponse<std::optional<MessageActionItem>> &&)> &handler);
    void requestWorkDoneProgressCreate(
            const WorkDoneProgressCreateParams &, std::function<void()> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerWorkDoneProgressCreateRequestHandler(
            const std::function<void(const QByteArray &, const WorkDoneProgressCreateParams &,
                                     LSPResponse<std::nullptr_t> &&)> &handler);
    void requestApplyWorkspaceEdit(
            const ApplyWorkspaceEditParams &,
            std::function<void(const ApplyWorkspaceEditResult &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerApplyWorkspaceEditRequestHandler(
            const std::function<void(const QByteArray &, const ApplyWorkspaceEditParams &,
                                     LSPResponse<ApplyWorkspaceEditResult> &&)> &handler);
    void requestWorkspaceCodeLensRefresh(
            const std::nullptr_t &, std::function<void()> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerWorkspaceCodeLensRefreshRequestHandler(
            const std::function<void(const QByteArray &, const std::nullptr_t &,
                                     LSPResponse<std::nullptr_t> &&)> &handler);
    void requestConfiguration(
            const ConfigurationParams &,
            std::function<void(const QList<QJsonValue> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerConfigurationRequestHandler(
            const std::function<void(const QByteArray &, const ConfigurationParams &,
                                     LSPResponse<QList<QJsonValue>> &&)> &handler);
    void requestWorkspaceDiagnostic(
            const WorkspaceDiagnosticParams &,
            std::function<void(const WorkspaceDiagnosticReport &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerWorkspaceDiagnosticRequestHandler(
            const std::function<void(const QByteArray &, const WorkspaceDiagnosticParams &,
                                     LSPPartialResponse<WorkspaceDiagnosticReport,
                                                        WorkspaceDiagnosticReportPartialResult> &&)>
                    &handler);
    void requestWorkspaceDiagnosticRefresh(
            const std::nullptr_t &, std::function<void()> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerWorkspaceDiagnosticRefreshRequestHandler(
            const std::function<void(const QByteArray &, const std::nullptr_t &,
                                     LSPResponse<std::nullptr_t> &&)> &handler);
    void requestExecuteCommand(
            const ExecuteCommandParams &,
            std::function<void(const std::optional<QJsonValue> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerExecuteCommandRequestHandler(
            const std::function<void(const QByteArray &, const ExecuteCommandParams &,
                                     LSPResponse<std::optional<QJsonValue>> &&)> &handler);
    void requestWorkspaceFoldingRangeRefresh(
            const std::nullptr_t &, std::function<void()> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerWorkspaceFoldingRangeRefreshRequestHandler(
            const std::function<void(const QByteArray &, const std::nullptr_t &,
                                     LSPResponse<std::nullptr_t> &&)> &handler);
    void requestWorkspaceInlayHintRefresh(
            const std::nullptr_t &, std::function<void()> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerWorkspaceInlayHintRefreshRequestHandler(
            const std::function<void(const QByteArray &, const std::nullptr_t &,
                                     LSPResponse<std::nullptr_t> &&)> &handler);
    void requestWorkspaceInlineValueRefresh(
            const std::nullptr_t &, std::function<void()> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerWorkspaceInlineValueRefreshRequestHandler(
            const std::function<void(const QByteArray &, const std::nullptr_t &,
                                     LSPResponse<std::nullptr_t> &&)> &handler);
    void requestWorkspaceSemanticTokensRefresh(
            const std::nullptr_t &, std::function<void()> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerWorkspaceSemanticTokensRefreshRequestHandler(
            const std::function<void(const QByteArray &, const std::nullptr_t &,
                                     LSPResponse<std::nullptr_t> &&)> &handler);
    void requestWorkspaceSymbol(
            const WorkspaceSymbolParams &,
            std::function<void(const std::optional<
                               std::variant<QList<SymbolInformation>, QList<WorkspaceSymbol>>> &)>
                    responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerWorkspaceSymbolRequestHandler(
            const std::function<void(
                    const QByteArray &, const WorkspaceSymbolParams &,
                    LSPPartialResponse<
                            std::optional<
                                    std::variant<QList<SymbolInformation>, QList<WorkspaceSymbol>>>,
                            std::variant<QList<SymbolInformation>, QList<WorkspaceSymbol>>> &&)>
                    &handler);
    void requestCreateFiles(
            const CreateFilesParams &,
            std::function<void(const std::optional<WorkspaceEdit> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerCreateFilesRequestHandler(
            const std::function<void(const QByteArray &, const CreateFilesParams &,
                                     LSPResponse<std::optional<WorkspaceEdit>> &&)> &handler);
    void requestDeleteFiles(
            const DeleteFilesParams &,
            std::function<void(const std::optional<WorkspaceEdit> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerDeleteFilesRequestHandler(
            const std::function<void(const QByteArray &, const DeleteFilesParams &,
                                     LSPResponse<std::optional<WorkspaceEdit>> &&)> &handler);
    void requestRenameFiles(
            const RenameFilesParams &,
            std::function<void(const std::optional<WorkspaceEdit> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerRenameFilesRequestHandler(
            const std::function<void(const QByteArray &, const RenameFilesParams &,
                                     LSPResponse<std::optional<WorkspaceEdit>> &&)> &handler);
    void requestWorkspaceWorkspaceFolders(
            const std::nullptr_t &,
            std::function<void(const std::optional<QList<WorkspaceFolder>> &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerWorkspaceWorkspaceFoldersRequestHandler(
            const std::function<void(const QByteArray &, const std::nullptr_t &,
                                     LSPResponse<std::optional<QList<WorkspaceFolder>>> &&)>
                    &handler);
    void requestWorkspaceSymbolResolve(
            const WorkspaceSymbol &, std::function<void(const WorkspaceSymbol &)> responseHandler,
            ResponseErrorHandler errorHandler = &ProtocolBase::defaultResponseErrorHandler);
    void registerWorkspaceSymbolResolveRequestHandler(
            const std::function<void(const QByteArray &, const WorkspaceSymbol &,
                                     LSPResponse<WorkspaceSymbol> &&)> &handler);

    // Notifications

    void registerCancelNotificationHandler(
            const std::function<void(const QByteArray &, const CancelParams &)> &handler);
    void notifyCancel(const CancelParams &params);
    void registerLogTraceNotificationHandler(
            const std::function<void(const QByteArray &, const LogTraceParams &)> &handler);
    void notifyLogTrace(const LogTraceParams &params);
    void registerProgressNotificationHandler(
            const std::function<void(const QByteArray &, const ProgressParams &)> &handler);
    void notifyProgress(const ProgressParams &params);
    void registerSetTraceNotificationHandler(
            const std::function<void(const QByteArray &, const SetTraceParams &)> &handler);
    void notifySetTrace(const SetTraceParams &params);
    void registerExitNotificationHandler(
            const std::function<void(const QByteArray &, const std::nullptr_t &)> &handler);
    void notifyExit(const std::nullptr_t &params);
    void registerInitializedNotificationHandler(
            const std::function<void(const QByteArray &, const InitializedParams &)> &handler);
    void notifyInitialized(const InitializedParams &params);
    void registerDidChangeNotebookDocumentNotificationHandler(
            const std::function<void(const QByteArray &, const DidChangeNotebookDocumentParams &)>
                    &handler);
    void notifyDidChangeNotebookDocument(const DidChangeNotebookDocumentParams &params);
    void registerDidCloseNotebookDocumentNotificationHandler(
            const std::function<void(const QByteArray &, const DidCloseNotebookDocumentParams &)>
                    &handler);
    void notifyDidCloseNotebookDocument(const DidCloseNotebookDocumentParams &params);
    void registerDidOpenNotebookDocumentNotificationHandler(
            const std::function<void(const QByteArray &, const DidOpenNotebookDocumentParams &)>
                    &handler);
    void notifyDidOpenNotebookDocument(const DidOpenNotebookDocumentParams &params);
    void registerDidSaveNotebookDocumentNotificationHandler(
            const std::function<void(const QByteArray &, const DidSaveNotebookDocumentParams &)>
                    &handler);
    void notifyDidSaveNotebookDocument(const DidSaveNotebookDocumentParams &params);
    void registerTelemetryEventNotificationHandler(
            const std::function<void(const QByteArray &, const QJsonValue &)> &handler);
    void notifyTelemetryEvent(const QJsonValue &params);
    void registerDidChangeTextDocumentNotificationHandler(
            const std::function<void(const QByteArray &, const DidChangeTextDocumentParams &)>
                    &handler);
    void notifyDidChangeTextDocument(const DidChangeTextDocumentParams &params);
    void registerDidCloseTextDocumentNotificationHandler(
            const std::function<void(const QByteArray &, const DidCloseTextDocumentParams &)>
                    &handler);
    void notifyDidCloseTextDocument(const DidCloseTextDocumentParams &params);
    void registerDidOpenTextDocumentNotificationHandler(
            const std::function<void(const QByteArray &, const DidOpenTextDocumentParams &)>
                    &handler);
    void notifyDidOpenTextDocument(const DidOpenTextDocumentParams &params);
    void registerDidSaveTextDocumentNotificationHandler(
            const std::function<void(const QByteArray &, const DidSaveTextDocumentParams &)>
                    &handler);
    void notifyDidSaveTextDocument(const DidSaveTextDocumentParams &params);
    void registerPublishDiagnosticsNotificationHandler(
            const std::function<void(const QByteArray &, const PublishDiagnosticsParams &)>
                    &handler);
    void notifyPublishDiagnostics(const PublishDiagnosticsParams &params);
    void registerWillSaveTextDocumentNotificationHandler(
            const std::function<void(const QByteArray &, const WillSaveTextDocumentParams &)>
                    &handler);
    void notifyWillSaveTextDocument(const WillSaveTextDocumentParams &params);
    void registerLogMessageNotificationHandler(
            const std::function<void(const QByteArray &, const LogMessageParams &)> &handler);
    void notifyLogMessage(const LogMessageParams &params);
    void registerShowMessageNotificationHandler(
            const std::function<void(const QByteArray &, const ShowMessageParams &)> &handler);
    void notifyShowMessage(const ShowMessageParams &params);
    void registerWorkDoneProgressCancelNotificationHandler(
            const std::function<void(const QByteArray &, const WorkDoneProgressCancelParams &)>
                    &handler);
    void notifyWorkDoneProgressCancel(const WorkDoneProgressCancelParams &params);
    void registerDidChangeConfigurationNotificationHandler(
            const std::function<void(const QByteArray &, const DidChangeConfigurationParams &)>
                    &handler);
    void notifyDidChangeConfiguration(const DidChangeConfigurationParams &params);
    void registerDidChangeWatchedFilesNotificationHandler(
            const std::function<void(const QByteArray &, const DidChangeWatchedFilesParams &)>
                    &handler);
    void notifyDidChangeWatchedFiles(const DidChangeWatchedFilesParams &params);
    void registerDidChangeWorkspaceFoldersNotificationHandler(
            const std::function<void(const QByteArray &, const DidChangeWorkspaceFoldersParams &)>
                    &handler);
    void notifyDidChangeWorkspaceFolders(const DidChangeWorkspaceFoldersParams &params);
    void registerCreateFilesNotificationHandler(
            const std::function<void(const QByteArray &, const CreateFilesParams &)> &handler);
    void notifyCreateFiles(const CreateFilesParams &params);
    void registerDeleteFilesNotificationHandler(
            const std::function<void(const QByteArray &, const DeleteFilesParams &)> &handler);
    void notifyDeleteFiles(const DeleteFilesParams &params);
    void registerRenameFilesNotificationHandler(
            const std::function<void(const QByteArray &, const RenameFilesParams &)> &handler);
    void notifyRenameFiles(const RenameFilesParams &params);

private:
    Q_DISABLE_COPY(ProtocolGen)
    Q_DECLARE_PRIVATE(ProtocolGen)
};

} // namespace QLspSpecification

QT_END_NAMESPACE

#endif // QLANGUAGESERVER_P_H
