forked from qt-creator/qt-creator
LanguageClient: Fix ConfigurationItem scopeUri type
'scopeUri' should contain a DocumentUri and not a QString according to the protocol (https://microsoft.github.io/language-server-protocol/ specifications/lsp/3.17/specification/#configurationItem). Change-Id: Ibdec5f22cdce4dc1b5e3e0ef264cdc0458c124f1 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -72,4 +72,11 @@ LanguageServerProtocol::WorkSpaceFolderResult::operator const QJsonValue() const
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::optional<DocumentUri> ConfigurationParams::ConfigurationItem::scopeUri() const
|
||||||
|
{
|
||||||
|
if (const std::optional<QString> optionalScope = optionalValue<QString>(scopeUriKey))
|
||||||
|
return std::make_optional(DocumentUri::fromProtocol(*optionalScope));
|
||||||
|
return std::nullopt;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace LanguageServerProtocol
|
} // namespace LanguageServerProtocol
|
||||||
|
@@ -92,8 +92,8 @@ public:
|
|||||||
public:
|
public:
|
||||||
using JsonObject::JsonObject;
|
using JsonObject::JsonObject;
|
||||||
|
|
||||||
std::optional<QString> scopeUri() const { return optionalValue<QString>(scopeUriKey); }
|
std::optional<DocumentUri> scopeUri() const;
|
||||||
void setScopeUri(const QString &scopeUri) { insert(scopeUriKey, scopeUri); }
|
void setScopeUri(const DocumentUri &scopeUri) { insert(scopeUriKey, scopeUri); }
|
||||||
void clearScopeUri() { remove(scopeUriKey); }
|
void clearScopeUri() { remove(scopeUriKey); }
|
||||||
|
|
||||||
std::optional<QString> section() const { return optionalValue<QString>(sectionKey); }
|
std::optional<QString> section() const { return optionalValue<QString>(sectionKey); }
|
||||||
|
Reference in New Issue
Block a user