diff options
author | David Schulz <david.schulz@qt.io> | 2021-12-10 10:46:34 +0100 |
---|---|---|
committer | David Schulz <david.schulz@qt.io> | 2021-12-10 13:02:40 +0000 |
commit | 922cce16345caa0e5323197d185cabe97b49f632 (patch) | |
tree | 16c40424d363915e197de190d3160146a4e9805a | |
parent | 1eda803e29c16c033ccd6b5c134ffd79bb03b029 (diff) |
Python: prefer python-lsp-server
python-language-server is dead... long live python-lsp-server.
Task-number: QTCREATORBUG-26230
Change-Id: I9343f231c732b135bc4f8a704a29541c48cc36ba
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r-- | src/plugins/python/pythonutils.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp index b570b26a1a..4174702c1f 100644 --- a/src/plugins/python/pythonutils.cpp +++ b/src/plugins/python/pythonutils.cpp @@ -116,7 +116,7 @@ FilePath getPylsModulePath(CommandLine pylsCommand) static const QString pylsInitPattern = "(.*)" + QRegularExpression::escape( - QDir::toNativeSeparators("/pyls/__init__.py")) + QDir::toNativeSeparators("/pylsp/__init__.py")) + '$'; static const QRegularExpression regexCached(" matches " + pylsInitPattern, QRegularExpression::MultilineOption); @@ -149,7 +149,7 @@ QList<const StdIOSettings *> configuredPythonLanguageServer() static PythonLanguageServerState checkPythonLanguageServer(const FilePath &python) { using namespace LanguageClient; - const CommandLine pythonLShelpCommand(python, {"-m", "pyls", "-h"}); + const CommandLine pythonLShelpCommand(python, {"-m", "pylsp", "-h"}); const FilePath &modulePath = getPylsModulePath(pythonLShelpCommand); for (const StdIOSettings *serverSetting : configuredPythonLanguageServer()) { if (modulePath == getPylsModulePath(serverSetting->command())) { @@ -217,7 +217,7 @@ const StdIOSettings *PyLSConfigureAssistant::languageServerForPython(const FileP { return findOrDefault(configuredPythonLanguageServer(), [pythonModulePath = getPylsModulePath( - CommandLine(python, {"-m", "pyls"}))](const StdIOSettings *setting) { + CommandLine(python, {"-m", "pylsp"}))](const StdIOSettings *setting) { return getPylsModulePath(setting->command()) == pythonModulePath; }); } @@ -226,7 +226,7 @@ static Client *registerLanguageServer(const FilePath &python) { auto *settings = new StdIOSettings(); settings->m_executable = python; - settings->m_arguments = "-m pyls"; + settings->m_arguments = "-m pylsp"; settings->m_name = PyLSConfigureAssistant::tr("Python Language Server (%1)") .arg(pythonName(python)); settings->m_languageFilter.mimeTypes = QStringList(Constants::C_PY_MIMETYPE); @@ -266,7 +266,7 @@ public: connect(&m_killTimer, &QTimer::timeout, this, &PythonLSInstallHelper::cancel); connect(&m_watcher, &QFutureWatcher<void>::canceled, this, &PythonLSInstallHelper::cancel); - QStringList arguments = {"-m", "pip", "install", "python-language-server[all]"}; + QStringList arguments = {"-m", "pip", "install", "python-lsp-server[all]"}; // add --user to global pythons, but skip it for venv pythons if (!QDir(m_python.parentDir().toString()).exists("activate")) |