// Copyright (C) 2018 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #pragma once #include "jsonrpcmessages.h" namespace LanguageServerProtocol { class PublishDiagnosticsParams : public JsonObject { public: using JsonObject::JsonObject; DocumentUri uri() const { return DocumentUri::fromProtocol(typedValue(uriKey)); } void setUri(const DocumentUri &uri) { insert(uriKey, uri); } QList diagnostics() const { return array(diagnosticsKey); } void setDiagnostics(const QList &diagnostics) { insertArray(diagnosticsKey, diagnostics); } std::optional version() const { return optionalValue(versionKey); } void setVersion(int version) { insert(versionKey, version); } void clearVersion() { remove(versionKey); } bool isValid() const override { return contains(diagnosticsKey); } }; class LANGUAGESERVERPROTOCOL_EXPORT PublishDiagnosticsNotification : public Notification { public: explicit PublishDiagnosticsNotification(const PublishDiagnosticsParams ¶ms); using Notification::Notification; constexpr static const char methodName[] = "textDocument/publishDiagnostics"; }; } // namespace LanguageClient