diff options
Diffstat (limited to 'src/libs/languageserverprotocol/lsputils.h')
-rw-r--r-- | src/libs/languageserverprotocol/lsputils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libs/languageserverprotocol/lsputils.h b/src/libs/languageserverprotocol/lsputils.h index 5515b51576..0c815bafd8 100644 --- a/src/libs/languageserverprotocol/lsputils.h +++ b/src/libs/languageserverprotocol/lsputils.h @@ -87,6 +87,13 @@ public: return QJsonValue(); } + QList<T> toListOrEmpty() const + { + if (std::holds_alternative<QList<T>>(*this)) + return std::get<QList<T>>(*this); + return {}; + } + QList<T> toList() const { QTC_ASSERT(std::holds_alternative<QList<T>>(*this), return {}); |