LanguageClient: fix compile with Qt 6.2

Change-Id: Iac02d004286641b95a6729c367c339bf94e70bed
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Mathias Hasselmann <mathias@taschenorakel.de>
This commit is contained in:
David Schulz
2024-01-12 13:03:16 +01:00
parent 83d2b82eb9
commit 22989d4d82

View File

@@ -470,8 +470,8 @@ private:
QTimer m_killTimer; QTimer m_killTimer;
}; };
constexpr QLatin1StringView YAML_MIME_TYPE{"application/x-yaml"}; constexpr char YAML_MIME_TYPE[]{"application/x-yaml"};
constexpr QLatin1StringView JSON_MIME_TYPE{"application/json"}; constexpr char JSON_MIME_TYPE[]{"application/json"};
void autoSetupLanguageServer(TextDocument *document) void autoSetupLanguageServer(TextDocument *document)
{ {
@@ -534,7 +534,8 @@ void autoSetupLanguageServer(TextDocument *document)
settings->m_executable = executable; settings->m_executable = executable;
settings->m_arguments = "--stdio"; settings->m_arguments = "--stdio";
settings->m_name = Tr::tr("%1 Language Server").arg(language); settings->m_name = Tr::tr("%1 Language Server").arg(language);
settings->m_languageFilter.mimeTypes = {isYaml ? YAML_MIME_TYPE : JSON_MIME_TYPE}; settings->m_languageFilter.mimeTypes = {isYaml ? QString(YAML_MIME_TYPE)
: QString(JSON_MIME_TYPE)};
LanguageClientSettings::addSettings(settings); LanguageClientSettings::addSettings(settings);
LanguageClientManager::applySettings(); LanguageClientManager::applySettings();