From b9034e8426ab92bdabb0579464b79cd277f79808 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 1 Jun 2022 07:48:46 +0200 Subject: Python: support python 3 mime type in language client Change-Id: I9319442aecc61e854aaeb0778b959086a70d431b Reviewed-by: Christian Stenger --- src/plugins/python/pythonlanguageclient.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/plugins/python/pythonlanguageclient.cpp') diff --git a/src/plugins/python/pythonlanguageclient.cpp b/src/plugins/python/pythonlanguageclient.cpp index 9479fc0c1a..ddab091bf6 100644 --- a/src/plugins/python/pythonlanguageclient.cpp +++ b/src/plugins/python/pythonlanguageclient.cpp @@ -389,7 +389,8 @@ PyLSSettings::PyLSSettings() m_settingsTypeId = Constants::PYLS_SETTINGS_ID; m_name = "Python Language Server"; m_startBehavior = RequiresFile; - m_languageFilter.mimeTypes = QStringList(Constants::C_PY_MIMETYPE); + m_languageFilter.mimeTypes = QStringList() + << Constants::C_PY_MIMETYPE << Constants::C_PY3_MIMETYPE; m_arguments = "-m pylsp"; const QJsonDocument config(defaultConfiguration()); m_configuration = QString::fromUtf8(config.toJson()); @@ -416,6 +417,8 @@ void PyLSSettings::fromMap(const QVariantMap &map) const QJsonDocument config(defaultConfiguration()); m_configuration = QString::fromUtf8(config.toJson()); } + m_languageFilter.mimeTypes = QStringList() + << Constants::C_PY_MIMETYPE << Constants::C_PY3_MIMETYPE; setInterpreter(map[interpreterKey].toString()); } @@ -640,7 +643,8 @@ static Client *registerLanguageServer(const FilePath &python) auto *settings = new StdIOSettings(); settings->m_executable = python; settings->m_arguments = "-m pylsp"; - settings->m_languageFilter.mimeTypes = QStringList(Constants::C_PY_MIMETYPE); + settings->m_languageFilter.mimeTypes = QStringList() << Constants::C_PY_MIMETYPE + << Constants::C_PY3_MIMETYPE; } settings->m_name = PyLSConfigureAssistant::tr("Python Language Server (%1)") .arg(pythonName(python)); -- cgit v1.2.1