diff options
author | David Schulz <david.schulz@qt.io> | 2022-06-01 07:48:46 +0200 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2022-06-02 13:29:17 +0000 |
commit | b9034e8426ab92bdabb0579464b79cd277f79808 (patch) | |
tree | fbd52f989b51ee02efbb9ef7f7772887ae641f12 /src/plugins/python/pythonlanguageclient.cpp | |
parent | 6bbddf115ca669a1c1e0dda09da2813f730394cf (diff) | |
download | qt-creator-b9034e8426ab92bdabb0579464b79cd277f79808.tar.gz |
Python: support python 3 mime type in language client
Change-Id: I9319442aecc61e854aaeb0778b959086a70d431b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/python/pythonlanguageclient.cpp')
-rw-r--r-- | src/plugins/python/pythonlanguageclient.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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)); |