LSP: Avoid running strlen() on json keys

This feels better when stepping through the code but doesn't
really make a difference in the profile.

Change-Id: I2c30578bf1e990b039caadb8b8ce532f009b775d
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2023-12-12 12:58:45 +01:00
parent d8561ccb2d
commit 570344b066
18 changed files with 318 additions and 308 deletions

View File

@@ -636,7 +636,7 @@ public:
void clearWorkDoneProgress() { remove(workDoneProgressKey); } void clearWorkDoneProgress() { remove(workDoneProgressKey); }
private: private:
constexpr static const char workDoneProgressKey[] = "workDoneProgress"; constexpr static const Key workDoneProgressKey{"workDoneProgress"};
}; };
class LANGUAGESERVERPROTOCOL_EXPORT ClientCapabilities : public JsonObject class LANGUAGESERVERPROTOCOL_EXPORT ClientCapabilities : public JsonObject

View File

@@ -3,229 +3,233 @@
#pragma once #pragma once
#include <QLatin1StringView>
namespace LanguageServerProtocol { namespace LanguageServerProtocol {
constexpr char actionsKey[] = "actions"; using Key = QLatin1StringView;
constexpr char activeParameterKey[] = "activeParameter";
constexpr char activeParameterSupportKey[] = "activeParameterSupport"; constexpr Key actionsKey{"actions"};
constexpr char activeSignatureKey[] = "activeSignature"; constexpr Key activeParameterKey{"activeParameter"};
constexpr char addedKey[] = "added"; constexpr Key activeParameterSupportKey{"activeParameterSupport"};
constexpr char additionalTextEditsKey[] = "additionalTextEdits"; constexpr Key activeSignatureKey{"activeSignature"};
constexpr char alphaKey[] = "alpha"; constexpr Key addedKey{"added"};
constexpr char appliedKey[] = "applied"; constexpr Key additionalTextEditsKey{"additionalTextEdits"};
constexpr char applyEditKey[] = "applyEdit"; constexpr Key alphaKey{"alpha"};
constexpr char argumentsKey[] = "arguments"; constexpr Key appliedKey{"applied"};
constexpr char blueKey[] = "blue"; constexpr Key applyEditKey{"applyEdit"};
constexpr char callHierarchyKey[] = "callHierarchy"; constexpr Key argumentsKey{"arguments"};
constexpr char callHierarchyProviderKey[] = "callHierarchyProvider"; constexpr Key blueKey{"blue"};
constexpr char cancellableKey[] = "cancellable"; constexpr Key callHierarchyKey{"callHierarchy"};
constexpr char capabilitiesKey[] = "capabilities"; constexpr Key callHierarchyProviderKey{"callHierarchyProvider"};
constexpr char chKey[] = "ch"; constexpr Key cancellableKey{"cancellable"};
constexpr char changeKey[] = "change"; constexpr Key capabilitiesKey{"capabilities"};
constexpr char changeNotificationsKey[] = "changeNotifications"; constexpr Key chKey{"ch"};
constexpr char changesKey[] = "changes"; constexpr Key changeKey{"change"};
constexpr char characterKey[] = "character"; constexpr Key changeNotificationsKey{"changeNotifications"};
constexpr char childrenKey[] = "children"; constexpr Key changesKey{"changes"};
constexpr char clientInfoKey[] = "clientInfo"; constexpr Key characterKey{"character"};
constexpr char codeActionKey[] = "codeAction"; constexpr Key childrenKey{"children"};
constexpr char codeActionKindKey[] = "codeActionKind"; constexpr Key clientInfoKey{"clientInfo"};
constexpr char codeActionKindsKey[] = "codeActionKinds"; constexpr Key codeActionKey{"codeAction"};
constexpr char codeActionLiteralSupportKey[] = "codeActionLiteralSupport"; constexpr Key codeActionKindKey{"codeActionKind"};
constexpr char codeActionProviderKey[] = "codeActionProvider"; constexpr Key codeActionKindsKey{"codeActionKinds"};
constexpr char codeKey[] = "code"; constexpr Key codeActionLiteralSupportKey{"codeActionLiteralSupport"};
constexpr char codeLensKey[] = "codeLens"; constexpr Key codeActionProviderKey{"codeActionProvider"};
constexpr char codeLensProviderKey[] = "codeLensProvider"; constexpr Key codeKey{"code"};
constexpr char colorInfoKey[] = "colorInfo"; constexpr Key codeLensKey{"codeLens"};
constexpr char colorKey[] = "color"; constexpr Key codeLensProviderKey{"codeLensProvider"};
constexpr char colorProviderKey[] = "colorProvider"; constexpr Key colorInfoKey{"colorInfo"};
constexpr char commandKey[] = "command"; constexpr Key colorKey{"color"};
constexpr char commandsKey[] = "commands"; constexpr Key colorProviderKey{"colorProvider"};
constexpr char commitCharacterSupportKey[] = "commitCharacterSupport"; constexpr Key commandKey{"command"};
constexpr char commitCharactersKey[] = "commitCharacters"; constexpr Key commandsKey{"commands"};
constexpr char completionItemKey[] = "completionItem"; constexpr Key commitCharacterSupportKey{"commitCharacterSupport"};
constexpr char completionItemKindKey[] = "completionItemKind"; constexpr Key commitCharactersKey{"commitCharacters"};
constexpr char completionKey[] = "completion"; constexpr Key completionItemKey{"completionItem"};
constexpr char completionProviderKey[] = "completionProvider"; constexpr Key completionItemKindKey{"completionItemKind"};
constexpr char configurationKey[] = "configuration"; constexpr Key completionKey{"completion"};
constexpr char containerNameKey[] = "containerName"; constexpr Key completionProviderKey{"completionProvider"};
constexpr char contentChangesKey[] = "contentChanges"; constexpr Key configurationKey{"configuration"};
constexpr char contentFormatKey[] = "contentFormat"; constexpr Key containerNameKey{"containerName"};
constexpr char contentKey[] = "value"; constexpr Key contentChangesKey{"contentChanges"};
constexpr char contentsKey[] = "contents"; constexpr Key contentFormatKey{"contentFormat"};
constexpr char contextKey[] = "context"; constexpr Key contentKey{"value"};
constexpr char contextSupportKey[] = "contextSupport"; constexpr Key contentsKey{"contents"};
constexpr char dataKey[] = "data"; constexpr Key contextKey{"context"};
constexpr char definitionKey[] = "definition"; constexpr Key contextSupportKey{"contextSupport"};
constexpr char definitionProviderKey[] = "definitionProvider"; constexpr Key dataKey{"data"};
constexpr char deleteCountKey[] = "deleteCount"; constexpr Key definitionKey{"definition"};
constexpr char deltaKey[] = "delta"; constexpr Key definitionProviderKey{"definitionProvider"};
constexpr char deprecatedKey[] = "deprecated"; constexpr Key deleteCountKey{"deleteCount"};
constexpr char detailKey[] = "detail"; constexpr Key deltaKey{"delta"};
constexpr char diagnosticsKey[] = "diagnostics"; constexpr Key deprecatedKey{"deprecated"};
constexpr char didChangeConfigurationKey[] = "didChangeConfiguration"; constexpr Key detailKey{"detail"};
constexpr char didChangeWatchedFilesKey[] = "didChangeWatchedFiles"; constexpr Key diagnosticsKey{"diagnostics"};
constexpr char didSaveKey[] = "didSave"; constexpr Key didChangeConfigurationKey{"didChangeConfiguration"};
constexpr char documentChangesKey[] = "documentChanges"; constexpr Key didChangeWatchedFilesKey{"didChangeWatchedFiles"};
constexpr char documentFormattingProviderKey[] = "documentFormattingProvider"; constexpr Key didSaveKey{"didSave"};
constexpr char documentHighlightKey[] = "documentHighlight"; constexpr Key documentChangesKey{"documentChanges"};
constexpr char documentHighlightProviderKey[] = "documentHighlightProvider"; constexpr Key documentFormattingProviderKey{"documentFormattingProvider"};
constexpr char documentLinkKey[] = "documentLink"; constexpr Key documentHighlightKey{"documentHighlight"};
constexpr char documentLinkProviderKey[] = "documentLinkProvider"; constexpr Key documentHighlightProviderKey{"documentHighlightProvider"};
constexpr char documentRangeFormattingProviderKey[] = "documentRangeFormattingProvider"; constexpr Key documentLinkKey{"documentLink"};
constexpr char documentSelectorKey[] = "documentSelector"; constexpr Key documentLinkProviderKey{"documentLinkProvider"};
constexpr char documentSymbolKey[] = "documentSymbol"; constexpr Key documentRangeFormattingProviderKey{"documentRangeFormattingProvider"};
constexpr char documentSymbolProviderKey[] = "documentSymbolProvider"; constexpr Key documentSelectorKey{"documentSelector"};
constexpr char documentationFormatKey[] = "documentationFormat"; constexpr Key documentSymbolKey{"documentSymbol"};
constexpr char documentationKey[] = "documentation"; constexpr Key documentSymbolProviderKey{"documentSymbolProvider"};
constexpr char dynamicRegistrationKey[] = "dynamicRegistration"; constexpr Key documentationFormatKey{"documentationFormat"};
constexpr char editKey[] = "edit"; constexpr Key documentationKey{"documentation"};
constexpr char editsKey[] = "edits"; constexpr Key dynamicRegistrationKey{"dynamicRegistration"};
constexpr char endKey[] = "end"; constexpr Key editKey{"edit"};
constexpr char errorKey[] = "error"; constexpr Key editsKey{"edits"};
constexpr char eventKey[] = "event"; constexpr Key endKey{"end"};
constexpr char executeCommandKey[] = "executeCommand"; constexpr Key errorKey{"error"};
constexpr char executeCommandProviderKey[] = "executeCommandProvider"; constexpr Key eventKey{"event"};
constexpr char experimentalKey[] = "experimental"; constexpr Key executeCommandKey{"executeCommand"};
constexpr char filterTextKey[] = "filterText"; constexpr Key executeCommandProviderKey{"executeCommandProvider"};
constexpr char firstTriggerCharacterKey[] = "firstTriggerCharacter"; constexpr Key experimentalKey{"experimental"};
constexpr char formatsKey[] = "formats"; constexpr Key filterTextKey{"filterText"};
constexpr char formattingKey[] = "formatting"; constexpr Key firstTriggerCharacterKey{"firstTriggerCharacter"};
constexpr char fromKey[] = "from"; constexpr Key formatsKey{"formats"};
constexpr char fromRangesKey[] = "fromRanges"; constexpr Key formattingKey{"formatting"};
constexpr char fullKey[] = "full"; constexpr Key fromKey{"from"};
constexpr char greenKey[] = "green"; constexpr Key fromRangesKey{"fromRanges"};
constexpr char hierarchicalDocumentSymbolSupportKey[] = "hierarchicalDocumentSymbolSupport"; constexpr Key fullKey{"full"};
constexpr char hoverKey[] = "hover"; constexpr Key greenKey{"green"};
constexpr char hoverProviderKey[] = "hoverProvider"; constexpr Key hierarchicalDocumentSymbolSupportKey{"hierarchicalDocumentSymbolSupport"};
constexpr char idKey[] = "id"; constexpr Key hoverKey{"hover"};
constexpr char ignoreIfExistsKey[] = "ignoreIfExists"; constexpr Key hoverProviderKey{"hoverProvider"};
constexpr char ignoreIfNotExistsKey[] = "ignoreIfNotExists"; constexpr Key idKey{"id"};
constexpr char implementationKey[] = "implementation"; constexpr Key ignoreIfExistsKey{"ignoreIfExists"};
constexpr char implementationProviderKey[] = "implementationProvider"; constexpr Key ignoreIfNotExistsKey{"ignoreIfNotExists"};
constexpr char includeDeclarationKey[] = "includeDeclaration"; constexpr Key implementationKey{"implementation"};
constexpr char includeTextKey[] = "includeText"; constexpr Key implementationProviderKey{"implementationProvider"};
constexpr char initializationOptionsKey[] = "initializationOptions"; constexpr Key includeDeclarationKey{"includeDeclaration"};
constexpr char insertFinalNewlineKey[] = "insertFinalNewline"; constexpr Key includeTextKey{"includeText"};
constexpr char insertSpaceKey[] = "insertSpace"; constexpr Key initializationOptionsKey{"initializationOptions"};
constexpr char insertTextFormatKey[] = "insertTextFormat"; constexpr Key insertFinalNewlineKey{"insertFinalNewline"};
constexpr char insertTextKey[] = "insertText"; constexpr Key insertSpaceKey{"insertSpace"};
constexpr char isIncompleteKey[] = "isIncomplete"; constexpr Key insertTextFormatKey{"insertTextFormat"};
constexpr char itemKey[] = "item"; constexpr Key insertTextKey{"insertText"};
constexpr char itemsKey[] = "items"; constexpr Key isIncompleteKey{"isIncomplete"};
constexpr char jsonRpcVersionKey[] = "jsonrpc"; constexpr Key itemKey{"item"};
constexpr char kindKey[] = "kind"; constexpr Key itemsKey{"items"};
constexpr char labelKey[] = "label"; constexpr Key jsonRpcVersionKey{"jsonrpc"};
constexpr char languageIdKey[] = "languageId"; constexpr Key kindKey{"kind"};
constexpr char languageKey[] = "language"; constexpr Key labelKey{"label"};
constexpr char legendKey[] = "legend"; constexpr Key languageIdKey{"languageId"};
constexpr char limitKey[] = "limit"; constexpr Key languageKey{"language"};
constexpr char lineKey[] = "line"; constexpr Key legendKey{"legend"};
constexpr char linesKey[] = "lines"; constexpr Key limitKey{"limit"};
constexpr char locationKey[] = "location"; constexpr Key lineKey{"line"};
constexpr char messageKey[] = "message"; constexpr Key linesKey{"lines"};
constexpr char methodKey[] = "method"; constexpr Key locationKey{"location"};
constexpr char moreTriggerCharacterKey[] = "moreTriggerCharacter"; constexpr Key messageKey{"message"};
constexpr char multiLineTokenSupportKey[] = "multiLineTokenSupport"; constexpr Key methodKey{"method"};
constexpr char nameKey[] = "name"; constexpr Key moreTriggerCharacterKey{"moreTriggerCharacter"};
constexpr char newNameKey[] = "newName"; constexpr Key multiLineTokenSupportKey{"multiLineTokenSupport"};
constexpr char newTextKey[] = "newText"; constexpr Key nameKey{"name"};
constexpr char newUriKey[] = "newUri"; constexpr Key newNameKey{"newName"};
constexpr char oldUriKey[] = "oldUri"; constexpr Key newTextKey{"newText"};
constexpr char onTypeFormattingKey[] = "onTypeFormatting"; constexpr Key newUriKey{"newUri"};
constexpr char onlyKey[] = "only"; constexpr Key oldUriKey{"oldUri"};
constexpr char openCloseKey[] = "openClose"; constexpr Key onTypeFormattingKey{"onTypeFormatting"};
constexpr char optionsKey[] = "options"; constexpr Key onlyKey{"only"};
constexpr char overlappingTokenSupportKey[] = "overlappingTokenSupport"; constexpr Key openCloseKey{"openClose"};
constexpr char overwriteKey[] = "overwrite"; constexpr Key optionsKey{"options"};
constexpr char parametersKey[] = "parameters"; constexpr Key overlappingTokenSupportKey{"overlappingTokenSupport"};
constexpr char paramsKey[] = "params"; constexpr Key overwriteKey{"overwrite"};
constexpr char patternKey[] = "pattern"; constexpr Key parametersKey{"parameters"};
constexpr char percentageKey[] = "percentage"; constexpr Key paramsKey{"params"};
constexpr char placeHolderKey[] = "placeHolder"; constexpr Key patternKey{"pattern"};
constexpr char positionKey[] = "position"; constexpr Key percentageKey{"percentage"};
constexpr char prepareProviderKey[] = "prepareProvider"; constexpr Key placeHolderKey{"placeHolder"};
constexpr char prepareSupportKey[] = "prepareSupport"; constexpr Key positionKey{"position"};
constexpr char previousResultIdKey[] = "previousResultId"; constexpr Key prepareProviderKey{"prepareProvider"};
constexpr char processIdKey[] = "processId"; constexpr Key prepareSupportKey{"prepareSupport"};
constexpr char queryKey[] = "query"; constexpr Key previousResultIdKey{"previousResultId"};
constexpr char rangeFormattingKey[] = "rangeFormatting"; constexpr Key processIdKey{"processId"};
constexpr char rangeKey[] = "range"; constexpr Key queryKey{"query"};
constexpr char rangeLengthKey[] = "rangeLength"; constexpr Key rangeFormattingKey{"rangeFormatting"};
constexpr char reasonKey[] = "reason"; constexpr Key rangeKey{"range"};
constexpr char recursiveKey[] = "recursive"; constexpr Key rangeLengthKey{"rangeLength"};
constexpr char redKey[] = "red"; constexpr Key reasonKey{"reason"};
constexpr char referencesKey[] = "references"; constexpr Key recursiveKey{"recursive"};
constexpr char referencesProviderKey[] = "referencesProvider"; constexpr Key redKey{"red"};
constexpr char refreshSupportKey[] = "refreshSupport"; constexpr Key referencesKey{"references"};
constexpr char registerOptionsKey[] = "registerOptions"; constexpr Key referencesProviderKey{"referencesProvider"};
constexpr char registrationsKey[] = "registrations"; constexpr Key refreshSupportKey{"refreshSupport"};
constexpr char removedKey[] = "removed"; constexpr Key registerOptionsKey{"registerOptions"};
constexpr char renameKey[] = "rename"; constexpr Key registrationsKey{"registrations"};
constexpr char renameProviderKey[] = "renameProvider"; constexpr Key removedKey{"removed"};
constexpr char requestsKey[] = "requests"; constexpr Key renameKey{"rename"};
constexpr char resolveProviderKey[] = "resolveProvider"; constexpr Key renameProviderKey{"renameProvider"};
constexpr char resourceOperationsKey[] = "resourceOperations"; constexpr Key requestsKey{"requests"};
constexpr char resultIdKey[] = "resultId"; constexpr Key resolveProviderKey{"resolveProvider"};
constexpr char resultKey[] = "result"; constexpr Key resourceOperationsKey{"resourceOperations"};
constexpr char retryKey[] = "retry"; constexpr Key resultIdKey{"resultId"};
constexpr char rootPathKey[] = "rootPath"; constexpr Key resultKey{"result"};
constexpr char rootUriKey[] = "rootUri"; constexpr Key retryKey{"retry"};
constexpr char saveKey[] = "save"; constexpr Key rootPathKey{"rootPath"};
constexpr char schemeKey[] = "scheme"; constexpr Key rootUriKey{"rootUri"};
constexpr char scopeUriKey[] = "scopeUri"; constexpr Key saveKey{"save"};
constexpr char sectionKey[] = "section"; constexpr Key schemeKey{"scheme"};
constexpr char selectionRangeKey[] = "selectionRange"; constexpr Key scopeUriKey{"scopeUri"};
constexpr char semanticTokensKey[] = "semanticTokens"; constexpr Key sectionKey{"section"};
constexpr char semanticTokensProviderKey[] = "semanticTokensProvider"; constexpr Key selectionRangeKey{"selectionRange"};
constexpr char serverInfoKey[] = "serverInfo"; constexpr Key semanticTokensKey{"semanticTokens"};
constexpr char settingsKey[] = "settings"; constexpr Key semanticTokensProviderKey{"semanticTokensProvider"};
constexpr char severityKey[] = "severity"; constexpr Key serverInfoKey{"serverInfo"};
constexpr char signatureHelpKey[] = "signatureHelp"; constexpr Key settingsKey{"settings"};
constexpr char signatureHelpProviderKey[] = "signatureHelpProvider"; constexpr Key severityKey{"severity"};
constexpr char signatureInformationKey[] = "signatureInformation"; constexpr Key signatureHelpKey{"signatureHelp"};
constexpr char signaturesKey[] = "signatures"; constexpr Key signatureHelpProviderKey{"signatureHelpProvider"};
constexpr char snippetSupportKey[] = "snippetSupport"; constexpr Key signatureInformationKey{"signatureInformation"};
constexpr char sortTextKey[] = "sortText"; constexpr Key signaturesKey{"signatures"};
constexpr char sourceKey[] = "source"; constexpr Key snippetSupportKey{"snippetSupport"};
constexpr char startKey[] = "start"; constexpr Key sortTextKey{"sortText"};
constexpr char supportedKey[] = "supported"; constexpr Key sourceKey{"source"};
constexpr char symbolKey[] = "symbol"; constexpr Key startKey{"start"};
constexpr char symbolKindKey[] = "symbolKind"; constexpr Key supportedKey{"supported"};
constexpr char syncKindKey[] = "syncKind"; constexpr Key symbolKey{"symbol"};
constexpr char synchronizationKey[] = "synchronization"; constexpr Key symbolKindKey{"symbolKind"};
constexpr char tabSizeKey[] = "tabSize"; constexpr Key syncKindKey{"syncKind"};
constexpr char tagsKey[] = "tags"; constexpr Key synchronizationKey{"synchronization"};
constexpr char targetKey[] = "target"; constexpr Key tabSizeKey{"tabSize"};
constexpr char textDocumentKey[] = "textDocument"; constexpr Key tagsKey{"tags"};
constexpr char textDocumentSyncKey[] = "textDocumentSync"; constexpr Key targetKey{"target"};
constexpr char textEditKey[] = "textEdit"; constexpr Key textDocumentKey{"textDocument"};
constexpr char textKey[] = "text"; constexpr Key textDocumentSyncKey{"textDocumentSync"};
constexpr char titleKey[] = "title"; constexpr Key textEditKey{"textEdit"};
constexpr char toKey[] = "to"; constexpr Key textKey{"text"};
constexpr char tokenKey[] = "token"; constexpr Key titleKey{"title"};
constexpr char tokenModifiersKey[] = "tokenModifiers"; constexpr Key toKey{"to"};
constexpr char tokenTypesKey[] = "tokenTypes"; constexpr Key tokenKey{"token"};
constexpr char traceKey[] = "trace"; constexpr Key tokenModifiersKey{"tokenModifiers"};
constexpr char triggerCharacterKey[] = "triggerCharacter"; constexpr Key tokenTypesKey{"tokenTypes"};
constexpr char triggerCharactersKey[] = "triggerCharacters"; constexpr Key traceKey{"trace"};
constexpr char triggerKindKey[] = "triggerKind"; constexpr Key triggerCharacterKey{"triggerCharacter"};
constexpr char trimFinalNewlinesKey[] = "trimFinalNewlines"; constexpr Key triggerCharactersKey{"triggerCharacters"};
constexpr char trimTrailingWhitespaceKey[] = "trimTrailingWhitespace"; constexpr Key triggerKindKey{"triggerKind"};
constexpr char typeDefinitionKey[] = "typeDefinition"; constexpr Key trimFinalNewlinesKey{"trimFinalNewlines"};
constexpr char typeDefinitionProviderKey[] = "typeDefinitionProvider"; constexpr Key trimTrailingWhitespaceKey{"trimTrailingWhitespace"};
constexpr char typeKey[] = "type"; constexpr Key typeDefinitionKey{"typeDefinition"};
constexpr char unregistrationsKey[] = "unregistrations"; constexpr Key typeDefinitionProviderKey{"typeDefinitionProvider"};
constexpr char uriKey[] = "uri"; constexpr Key typeKey{"type"};
constexpr char valueKey[] = "value"; constexpr Key unregistrationsKey{"unregistrations"};
constexpr char valueSetKey[] = "valueSet"; constexpr Key uriKey{"uri"};
constexpr char versionKey[] = "version"; constexpr Key valueKey{"value"};
constexpr char willSaveKey[] = "willSave"; constexpr Key valueSetKey{"valueSet"};
constexpr char willSaveWaitUntilKey[] = "willSaveWaitUntil"; constexpr Key versionKey{"version"};
constexpr char windowKey[] = "window"; constexpr Key willSaveKey{"willSave"};
constexpr char workDoneProgressKey[] = "workDoneProgress"; constexpr Key willSaveWaitUntilKey{"willSaveWaitUntil"};
constexpr char workspaceEditKey[] = "workspaceEdit"; constexpr Key windowKey{"window"};
constexpr char workspaceFoldersKey[] = "workspaceFolders"; constexpr Key workDoneProgressKey{"workDoneProgress"};
constexpr char workspaceKey[] = "workspace"; constexpr Key workspaceEditKey{"workspaceEdit"};
constexpr char workspaceSymbolProviderKey[] = "workspaceSymbolProvider"; constexpr Key workspaceFoldersKey{"workspaceFolders"};
constexpr Key workspaceKey{"workspace"};
constexpr Key workspaceSymbolProviderKey{"workspaceSymbolProvider"};
} // namespace LanguageServerProtocol } // namespace LanguageServerProtocol

View File

@@ -15,14 +15,14 @@ JsonObject &JsonObject::operator=(JsonObject &&other)
return *this; return *this;
} }
QJsonObject::iterator JsonObject::insert(const std::string_view key, const JsonObject &object) QJsonObject::iterator JsonObject::insert(const Key key, const JsonObject &object)
{ {
return m_jsonObject.insert(QLatin1String(key.data()), object.m_jsonObject); return m_jsonObject.insert(key, object.m_jsonObject);
} }
QJsonObject::iterator JsonObject::insert(const std::string_view key, const QJsonValue &value) QJsonObject::iterator JsonObject::insert(const Key key, const QJsonValue &value)
{ {
return m_jsonObject.insert(QLatin1String(key.data()), value); return m_jsonObject.insert(key, value);
} }
} // namespace LanguageServerProtocol } // namespace LanguageServerProtocol

View File

@@ -43,98 +43,99 @@ public:
const_iterator end() const { return m_jsonObject.end(); } const_iterator end() const { return m_jsonObject.end(); }
protected: protected:
iterator insert(const std::string_view key, const JsonObject &value); using Key = QLatin1StringView;
iterator insert(const std::string_view key, const QJsonValue &value); iterator insert(const Key key, const JsonObject &value);
iterator insert(const Key key, const QJsonValue &value);
template <typename T, typename V> template <typename T, typename V>
iterator insertVariant(const std::string_view key, const V &variant); iterator insertVariant(const Key key, const V &variant);
template <typename T1, typename T2, typename... Args, typename V> template <typename T1, typename T2, typename... Args, typename V>
iterator insertVariant(const std::string_view key, const V &variant); iterator insertVariant(const Key key, const V &variant);
// QJSonObject redirections // QJSonObject redirections
QJsonValue value(const std::string_view key) const { return m_jsonObject.value(QLatin1String(key.data())); } QJsonValue value(const QString &key) const { return m_jsonObject.value(key); }
bool contains(const std::string_view key) const { return m_jsonObject.contains(QLatin1String(key.data())); } QJsonValue value(const Key key) const { return m_jsonObject.value(key); }
iterator find(const std::string_view key) { return m_jsonObject.find(QLatin1String(key.data())); } bool contains(const Key key) const { return m_jsonObject.contains(key); }
const_iterator find(const std::string_view key) const { return m_jsonObject.find(QLatin1String(key.data())); } iterator find(const Key key) { return m_jsonObject.find(key); }
void remove(const std::string_view key) { m_jsonObject.remove(QLatin1String(key.data())); } const_iterator find(const Key key) const { return m_jsonObject.find(key); }
void remove(const Key key) { m_jsonObject.remove(key); }
QStringList keys() const { return m_jsonObject.keys(); } QStringList keys() const { return m_jsonObject.keys(); }
// convenience value access // convenience value access
template<typename T> template<typename T>
T typedValue(const std::string_view key) const; T typedValue(const Key key) const;
template<typename T> template<typename T>
std::optional<T> optionalValue(const std::string_view key) const; std::optional<T> optionalValue(const Key key) const;
template<typename T> template<typename T>
LanguageClientValue<T> clientValue(const std::string_view key) const; LanguageClientValue<T> clientValue(const Key key) const;
template<typename T> template<typename T>
std::optional<LanguageClientValue<T>> optionalClientValue(const std::string_view key) const; std::optional<LanguageClientValue<T>> optionalClientValue(const Key key) const;
template<typename T> template<typename T>
QList<T> array(const std::string_view key) const; QList<T> array(const Key key) const;
template<typename T> template<typename T>
std::optional<QList<T>> optionalArray(const std::string_view key) const; std::optional<QList<T>> optionalArray(const Key key) const;
template<typename T> template<typename T>
LanguageClientArray<T> clientArray(const std::string_view key) const; LanguageClientArray<T> clientArray(const Key key) const;
template<typename T> template<typename T>
std::optional<LanguageClientArray<T>> optionalClientArray(const std::string_view key) const; std::optional<LanguageClientArray<T>> optionalClientArray(const Key key) const;
template<typename T> template<typename T>
void insertArray(const std::string_view key, const QList<T> &array); void insertArray(const Key key, const QList<T> &array);
template<typename> template<typename>
void insertArray(const std::string_view key, const QList<JsonObject> &array); void insertArray(const Key key, const QList<JsonObject> &array);
private: private:
QJsonObject m_jsonObject; QJsonObject m_jsonObject;
}; };
template<typename T, typename V> template<typename T, typename V>
JsonObject::iterator JsonObject::insertVariant(const std::string_view key, const V &variant) JsonObject::iterator JsonObject::insertVariant(const Key key, const V &variant)
{ {
return std::holds_alternative<T>(variant) ? insert(key, std::get<T>(variant)) : end(); return std::holds_alternative<T>(variant) ? insert(key, std::get<T>(variant)) : end();
} }
template<typename T1, typename T2, typename... Args, typename V> template<typename T1, typename T2, typename... Args, typename V>
JsonObject::iterator JsonObject::insertVariant(const std::string_view key, const V &variant) JsonObject::iterator JsonObject::insertVariant(const Key key, const V &variant)
{ {
auto result = insertVariant<T1>(key, variant); auto result = insertVariant<T1>(key, variant);
return result != end() ? result : insertVariant<T2, Args...>(key, variant); return result != end() ? result : insertVariant<T2, Args...>(key, variant);
} }
template<typename T> template<typename T>
T JsonObject::typedValue(const std::string_view key) const T JsonObject::typedValue(const Key key) const
{ {
return fromJsonValue<T>(value(key)); return fromJsonValue<T>(value(key));
} }
template<typename T> template<typename T>
std::optional<T> JsonObject::optionalValue(const std::string_view key) const std::optional<T> JsonObject::optionalValue(const Key key) const
{ {
const QJsonValue &val = value(key); const QJsonValue &val = value(key);
return val.isUndefined() ? std::nullopt : std::make_optional(fromJsonValue<T>(val)); return val.isUndefined() ? std::nullopt : std::make_optional(fromJsonValue<T>(val));
} }
template<typename T> template<typename T>
LanguageClientValue<T> JsonObject::clientValue(const std::string_view key) const LanguageClientValue<T> JsonObject::clientValue(const Key key) const
{ {
return LanguageClientValue<T>(value(key)); return LanguageClientValue<T>(value(key));
} }
template<typename T> template<typename T>
std::optional<LanguageClientValue<T>> JsonObject::optionalClientValue(const std::string_view key) const std::optional<LanguageClientValue<T>> JsonObject::optionalClientValue(const Key key) const
{ {
return contains(key) ? std::make_optional(clientValue<T>(key)) : std::nullopt; return contains(key) ? std::make_optional(clientValue<T>(key)) : std::nullopt;
} }
template<typename T> template<typename T>
QList<T> JsonObject::array(const std::string_view key) const QList<T> JsonObject::array(const Key key) const
{ {
if (const std::optional<QList<T>> &array = optionalArray<T>(key)) if (const std::optional<QList<T>> &array = optionalArray<T>(key))
return *array; return *array;
qCDebug(conversionLog) << QString("Expected array under %1 in:") qCDebug(conversionLog) << QString("Expected array under %1 in:").arg(key) << *this;
.arg(QLatin1String(key.data())) << *this;
return {}; return {};
} }
template<typename T> template<typename T>
std::optional<QList<T>> JsonObject::optionalArray(const std::string_view key) const std::optional<QList<T>> JsonObject::optionalArray(const Key key) const
{ {
const QJsonValue &jsonValue = value(key); const QJsonValue &jsonValue = value(key);
if (jsonValue.isUndefined()) if (jsonValue.isUndefined())
@@ -143,13 +144,13 @@ std::optional<QList<T>> JsonObject::optionalArray(const std::string_view key) co
} }
template<typename T> template<typename T>
LanguageClientArray<T> JsonObject::clientArray(const std::string_view key) const LanguageClientArray<T> JsonObject::clientArray(const Key key) const
{ {
return LanguageClientArray<T>(value(key)); return LanguageClientArray<T>(value(key));
} }
template<typename T> template<typename T>
std::optional<LanguageClientArray<T>> JsonObject::optionalClientArray(const std::string_view key) const std::optional<LanguageClientArray<T>> JsonObject::optionalClientArray(const Key key) const
{ {
const QJsonValue &val = value(key); const QJsonValue &val = value(key);
return !val.isUndefined() ? std::make_optional(LanguageClientArray<T>(value(key))) return !val.isUndefined() ? std::make_optional(LanguageClientArray<T>(value(key)))
@@ -157,7 +158,7 @@ std::optional<LanguageClientArray<T>> JsonObject::optionalClientArray(const std:
} }
template<typename T> template<typename T>
void JsonObject::insertArray(const std::string_view key, const QList<T> &array) void JsonObject::insertArray(const Key key, const QList<T> &array)
{ {
QJsonArray jsonArray; QJsonArray jsonArray;
for (const T &item : array) for (const T &item : array)
@@ -166,7 +167,7 @@ void JsonObject::insertArray(const std::string_view key, const QList<T> &array)
} }
template<typename > template<typename >
void JsonObject::insertArray(const std::string_view key, const QList<JsonObject> &array) void JsonObject::insertArray(const Key key, const QList<JsonObject> &array)
{ {
QJsonArray jsonArray; QJsonArray jsonArray;
for (const JsonObject &item : array) for (const JsonObject &item : array)

View File

@@ -125,7 +125,7 @@ QHash<QString, DocumentFormattingProperty> FormattingOptions::properties() const
for (const QString &key : keys()) { for (const QString &key : keys()) {
if (key == tabSizeKey || key == insertSpaceKey) if (key == tabSizeKey || key == insertSpaceKey)
continue; continue;
QJsonValue property = value(key.toStdString()); QJsonValue property = value(key);
if (property.isBool()) if (property.isBool())
ret[key] = property.toBool(); ret[key] = property.toBool();
if (property.isDouble()) if (property.isDouble())
@@ -136,7 +136,7 @@ QHash<QString, DocumentFormattingProperty> FormattingOptions::properties() const
return ret; return ret;
} }
void FormattingOptions::setProperty(const std::string_view key, const DocumentFormattingProperty &property) void FormattingOptions::setProperty(const Key key, const DocumentFormattingProperty &property)
{ {
using namespace std; using namespace std;
if (auto val = get_if<double>(&property)) if (auto val = get_if<double>(&property))

View File

@@ -678,8 +678,8 @@ public:
void clearTrimFinalNewlines() { remove(trimFinalNewlinesKey); } void clearTrimFinalNewlines() { remove(trimFinalNewlinesKey); }
QHash<QString, DocumentFormattingProperty> properties() const; QHash<QString, DocumentFormattingProperty> properties() const;
void setProperty(const std::string_view key, const DocumentFormattingProperty &property); void setProperty(const Key key, const DocumentFormattingProperty &property);
void removeProperty(const std::string_view &key) { remove(key); } void removeProperty(const Key &key) { remove(key); }
bool isValid() const override { return contains(insertSpaceKey) && contains(tabSizeKey); } bool isValid() const override { return contains(insertSpaceKey) && contains(tabSizeKey); }
}; };

View File

@@ -166,7 +166,7 @@ public:
QString query() const { return typedValue<QString>(queryKey); } QString query() const { return typedValue<QString>(queryKey); }
void setQuery(const QString &query) { insert(queryKey, query); } void setQuery(const QString &query) { insert(queryKey, query); }
void setLimit(int limit) { insert("limit", limit); } // clangd extension void setLimit(int limit) { insert(Key("limit"), limit); } // clangd extension
bool isValid() const override { return contains(queryKey); } bool isValid() const override { return contains(queryKey); }
}; };

View File

@@ -18,8 +18,8 @@ using namespace Utils;
namespace ClangCodeModel::Internal { namespace ClangCodeModel::Internal {
static constexpr char roleKey[] = "role"; static constexpr LanguageServerProtocol::Key roleKey{"role"};
static constexpr char arcanaKey[] = "arcana"; static constexpr LanguageServerProtocol::Key arcanaKey{"arcana"};
QString ClangdAstNode::role() const { return typedValue<QString>(roleKey); } QString ClangdAstNode::role() const { return typedValue<QString>(roleKey); }
QString ClangdAstNode::kind() const { return typedValue<QString>(kindKey); } QString ClangdAstNode::kind() const { return typedValue<QString>(kindKey); }

View File

@@ -98,7 +98,7 @@ class SymbolDetails : public JsonObject
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
static constexpr char usrKey[] = "usr"; static constexpr Key usrKey{"usr"};
// the unqualified name of the symbol // the unqualified name of the symbol
QString name() const { return typedValue<QString>(nameKey); } QString name() const { return typedValue<QString>(nameKey); }
@@ -229,15 +229,15 @@ class DiagnosticsCapabilities : public JsonObject
{ {
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
void enableCategorySupport() { insert("categorySupport", true); } void enableCategorySupport() { insert(Key{"categorySupport"}, true); }
void enableCodeActionsInline() {insert("codeActionsInline", true);} void enableCodeActionsInline() {insert(Key{"codeActionsInline"}, true);}
}; };
class InactiveRegionsCapabilities : public JsonObject class InactiveRegionsCapabilities : public JsonObject
{ {
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
void enableInactiveRegionsSupport() { insert("inactiveRegions", true); } void enableInactiveRegionsSupport() { insert(Key{"inactiveRegions"}, true); }
}; };
class ClangdTextDocumentClientCapabilities : public TextDocumentClientCapabilities class ClangdTextDocumentClientCapabilities : public TextDocumentClientCapabilities
@@ -246,9 +246,9 @@ public:
using TextDocumentClientCapabilities::TextDocumentClientCapabilities; using TextDocumentClientCapabilities::TextDocumentClientCapabilities;
void setPublishDiagnostics(const DiagnosticsCapabilities &caps) void setPublishDiagnostics(const DiagnosticsCapabilities &caps)
{ insert("publishDiagnostics", caps); } { insert(Key{"publishDiagnostics"}, caps); }
void setInactiveRegionsCapabilities(const InactiveRegionsCapabilities &caps) void setInactiveRegionsCapabilities(const InactiveRegionsCapabilities &caps)
{ insert("inactiveRegionsCapabilities", caps); } { insert(Key{"inactiveRegionsCapabilities"}, caps); }
}; };
static qint64 getRevision(const TextDocument *doc) static qint64 getRevision(const TextDocument *doc)
@@ -1594,7 +1594,7 @@ void ClangdClient::Private::handleSemanticTokens(TextDocument *doc,
std::optional<QList<CodeAction> > ClangdDiagnostic::codeActions() const std::optional<QList<CodeAction> > ClangdDiagnostic::codeActions() const
{ {
auto actions = optionalArray<LanguageServerProtocol::CodeAction>("codeActions"); auto actions = optionalArray<LanguageServerProtocol::CodeAction>(Key{"codeActions"});
if (!actions) if (!actions)
return actions; return actions;
static const QStringList badCodeActions{ static const QStringList badCodeActions{
@@ -1611,7 +1611,7 @@ std::optional<QList<CodeAction> > ClangdDiagnostic::codeActions() const
QString ClangdDiagnostic::category() const QString ClangdDiagnostic::category() const
{ {
return typedValue<QString>("category"); return typedValue<QString>(Key{"category"});
} }
MessageId ClangdClient::Private::getAndHandleAst(const TextDocOrFile &doc, MessageId ClangdClient::Private::getAndHandleAst(const TextDocOrFile &doc,

View File

@@ -623,7 +623,7 @@ IAssistProposal *ClangdFunctionHintProcessor::perform()
ClangdCompletionCapabilities::ClangdCompletionCapabilities(const JsonObject &object) ClangdCompletionCapabilities::ClangdCompletionCapabilities(const JsonObject &object)
: TextDocumentClientCapabilities::CompletionCapabilities(object) : TextDocumentClientCapabilities::CompletionCapabilities(object)
{ {
insert("editsNearCursor", true); // For dot-to-arrow correction. insert(Key{"editsNearCursor"}, true); // For dot-to-arrow correction.
if (std::optional<CompletionItemCapbilities> completionItemCaps = completionItem()) { if (std::optional<CompletionItemCapbilities> completionItemCaps = completionItem()) {
completionItemCaps->setSnippetSupport(false); completionItemCaps->setSnippetSupport(false);
setCompletionItem(*completionItemCaps); setCompletionItem(*completionItemCaps);

View File

@@ -46,8 +46,8 @@ public:
return components; return components;
} }
static constexpr char totalKey[] = "_total"; static constexpr Key totalKey{"_total"};
static constexpr char selfKey[] = "_self"; static constexpr Key selfKey{"_self"};
}; };

View File

@@ -968,7 +968,9 @@ public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
DocumentUri uri() const { return TextDocumentIdentifier(value("textDocument")).uri(); } DocumentUri uri() const { return TextDocumentIdentifier(value("textDocument")).uri(); }
QList<Range> inactiveRegions() const { return array<Range>("regions"); } QList<Range> inactiveRegions() const {
return array<Range>(LanguageServerProtocol::Key{"regions"});
}
}; };
class InactiveRegionsNotification : public Notification<InactiveRegionsParams> class InactiveRegionsNotification : public Notification<InactiveRegionsParams>

View File

@@ -239,7 +239,7 @@ public:
void enableCodecoverageSupport() void enableCodecoverageSupport()
{ {
JsonObject coverageSupport(QJsonObject{{"codeCoverageSupport", true}}); JsonObject coverageSupport(QJsonObject{{"codeCoverageSupport", true}});
insert("publishDiagnostics", coverageSupport); insert(Key("publishDiagnostics"), coverageSupport);
} }
}; };

View File

@@ -10,8 +10,8 @@ namespace Copilot {
class CheckStatusParams : public LanguageServerProtocol::JsonObject class CheckStatusParams : public LanguageServerProtocol::JsonObject
{ {
static constexpr char optionsKey[] = "options"; static constexpr Key optionsKey{"options"};
static constexpr char localChecksOnlyKey[] = "options"; static constexpr Key localChecksOnlyKey{"options"};
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
@@ -30,8 +30,8 @@ public:
class CheckStatusResponse : public LanguageServerProtocol::JsonObject class CheckStatusResponse : public LanguageServerProtocol::JsonObject
{ {
static constexpr char userKey[] = "user"; static constexpr Key userKey{"user"};
static constexpr char statusKey[] = "status"; static constexpr Key statusKey{"status"};
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;

View File

@@ -11,8 +11,8 @@ namespace Copilot {
class Completion : public LanguageServerProtocol::JsonObject class Completion : public LanguageServerProtocol::JsonObject
{ {
static constexpr char displayTextKey[] = "displayText"; static constexpr Key displayTextKey{"displayText"};
static constexpr char uuidKey[] = "uuid"; static constexpr Key uuidKey{"uuid"};
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
@@ -41,7 +41,7 @@ public:
class GetCompletionParams : public LanguageServerProtocol::JsonObject class GetCompletionParams : public LanguageServerProtocol::JsonObject
{ {
public: public:
static constexpr char docKey[] = "doc"; static constexpr Key docKey{"doc"};
GetCompletionParams(const LanguageServerProtocol::TextDocumentIdentifier &document, GetCompletionParams(const LanguageServerProtocol::TextDocumentIdentifier &document,
int version, int version,
@@ -95,7 +95,7 @@ public:
class GetCompletionResponse : public LanguageServerProtocol::JsonObject class GetCompletionResponse : public LanguageServerProtocol::JsonObject
{ {
static constexpr char completionKey[] = "completions"; static constexpr Key completionKey{"completions"};
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
@@ -114,7 +114,7 @@ public:
: Request(methodName, params) : Request(methodName, params)
{} {}
using Request::Request; using Request::Request;
constexpr static const char methodName[] = "getCompletionsCycling"; constexpr static const LanguageServerProtocol::Key methodName{"getCompletionsCycling"};
}; };
} // namespace Copilot } // namespace Copilot

View File

@@ -10,10 +10,12 @@
namespace Copilot { namespace Copilot {
using Key = LanguageServerProtocol::Key;
class EditorPluginInfo : public LanguageServerProtocol::JsonObject class EditorPluginInfo : public LanguageServerProtocol::JsonObject
{ {
static constexpr char version[] = "version"; static constexpr Key version{"version"};
static constexpr char name[] = "name"; static constexpr Key name{"name"};
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
@@ -30,8 +32,8 @@ public:
class EditorInfo : public LanguageServerProtocol::JsonObject class EditorInfo : public LanguageServerProtocol::JsonObject
{ {
static constexpr char version[] = "version"; static constexpr Key version{"version"};
static constexpr char name[] = "name"; static constexpr Key name{"name"};
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
@@ -48,11 +50,11 @@ public:
class NetworkProxy : public LanguageServerProtocol::JsonObject class NetworkProxy : public LanguageServerProtocol::JsonObject
{ {
static constexpr char host[] = "host"; static constexpr Key host{"host"};
static constexpr char port[] = "port"; static constexpr Key port{"port"};
static constexpr char user[] = "username"; static constexpr Key user{"username"};
static constexpr char password[] = "password"; static constexpr Key password{"password"};
static constexpr char rejectUnauthorized[] = "rejectUnauthorized"; static constexpr Key rejectUnauthorized{"rejectUnauthorized"};
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
@@ -70,7 +72,7 @@ public:
setRejectUnauthorized(rejectUnauthorized); setRejectUnauthorized(rejectUnauthorized);
} }
void insertIfNotEmpty(const std::string_view key, const QString &value) void insertIfNotEmpty(const Key key, const QString &value)
{ {
if (!value.isEmpty()) if (!value.isEmpty())
insert(key, value); insert(key, value);
@@ -85,9 +87,9 @@ public:
class SetEditorInfoParams : public LanguageServerProtocol::JsonObject class SetEditorInfoParams : public LanguageServerProtocol::JsonObject
{ {
static constexpr char editorInfo[] = "editorInfo"; static constexpr Key editorInfo{"editorInfo"};
static constexpr char editorPluginInfo[] = "editorPluginInfo"; static constexpr Key editorPluginInfo{"editorPluginInfo"};
static constexpr char networkProxy[] = "networkProxy"; static constexpr Key networkProxy{"networkProxy"};
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
@@ -120,7 +122,7 @@ public:
: Request(methodName, params) : Request(methodName, params)
{} {}
using Request::Request; using Request::Request;
constexpr static const char methodName[] = "setEditorInfo"; constexpr static const Key methodName{"setEditorInfo"};
}; };
} // namespace Copilot } // namespace Copilot

View File

@@ -12,7 +12,7 @@ namespace Copilot {
class SignInConfirmParams : public LanguageServerProtocol::JsonObject class SignInConfirmParams : public LanguageServerProtocol::JsonObject
{ {
static constexpr char userCodeKey[] = "userCode"; static constexpr LanguageServerProtocol::Key userCodeKey{"userCode"};
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
@@ -30,7 +30,7 @@ public:
: Request(methodName, {userCode}) : Request(methodName, {userCode})
{} {}
using Request::Request; using Request::Request;
constexpr static const char methodName[] = "signInConfirm"; constexpr static const LanguageServerProtocol::Key methodName{"signInConfirm"};
}; };
} // namespace Copilot } // namespace Copilot

View File

@@ -14,11 +14,12 @@
namespace Copilot { namespace Copilot {
using SignInInitiateParams = LanguageServerProtocol::JsonObject; using SignInInitiateParams = LanguageServerProtocol::JsonObject;
using Key = LanguageServerProtocol::Key;
class SignInInitiateResponse : public LanguageServerProtocol::JsonObject class SignInInitiateResponse : public LanguageServerProtocol::JsonObject
{ {
static constexpr char verificationUriKey[] = "verificationUri"; static constexpr Key verificationUriKey{"verificationUri"};
static constexpr char userCodeKey[] = "userCode"; static constexpr Key userCodeKey{"userCode"};
public: public:
using JsonObject::JsonObject; using JsonObject::JsonObject;
@@ -37,7 +38,7 @@ public:
: Request(methodName, {}) : Request(methodName, {})
{} {}
using Request::Request; using Request::Request;
constexpr static const char methodName[] = "signInInitiate"; constexpr static const Key methodName{"signInInitiate"};
}; };
} // namespace Copilot } // namespace Copilot