Skip to content

Commit

Permalink
fix: [python] The python files syntax highlighting failed
Browse files Browse the repository at this point in the history
Replace the lsp with `python-lsp-server`

Log: fix bug
Bug: https://pms.uniontech.com/bug-view-282531.html
  • Loading branch information
Kakueeen authored and deepin-mozart committed Nov 1, 2024
1 parent bc33a8c commit 25082e6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/plugins/python/pythonplugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"InstallerName" : "pip",
"Packages" : [
"debugpy",
"python-language-server[all]"
"python-lsp-server[all]"
]
}
]
Expand Down
4 changes: 2 additions & 2 deletions src/tools/languageadapter/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ QProcess *createPythonServ(const newlsp::ProjectKey &key)

auto proc = new QProcess();
proc->setProgram("/usr/bin/bash");
proc->setArguments({"-c","pyls -v"});
proc->setArguments({"-c","pylsp -v"});
env::lang::Version pyVer;
pyVer.major = 3;
if (!ProcessUtil::exists("pyls")) {
if (!ProcessUtil::exists("pylsp")) {
auto python3Env = env::lang::get(env::lang::Category::User, env::lang::Python, pyVer);
proc->setProcessEnvironment(python3Env);
}
Expand Down
6 changes: 3 additions & 3 deletions src/tools/languageadapter/remotechecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ void RemoteChecker::doCheckPyls(const QString &language)
checkPylsFlag = true;

// virtualenv not support, use user env
QString pip3PackageName {"python-language-server[all]"};
QString executeProgram {"pyls"};
QString pip3PackageName {"python-lsp-server[all]"};
QString executeProgram {"pylsp"};

QString userLocalBinPath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation)
+ QDir::separator() + ".local" + QDir::separator() + "bin";
if (!QFileInfo(userLocalBinPath + QDir::separator() + executeProgram).exists()) {
Pip3Dialog pip3Dialog;
pip3Dialog.install("python-language-server[all]");
pip3Dialog.install("python-lsp-server[all]");
pip3Dialog.exec();
}
}
Expand Down

0 comments on commit 25082e6

Please sign in to comment.