MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / createJSServ

Function createJSServ

src/tools/languageadapter/main.cpp:140–160  ·  view source on GitHub ↗

setting from pyls trismit

Source from the content-addressed store, hash-verified

138
139// setting from pyls trismit
140QProcess *createJSServ(const newlsp::ProjectKey &key)
141{
142 lspServOut << "create js language server," << qApp->thread() << QThread::currentThread();
143 if (key.language != newlsp::JS)
144 return nullptr;
145
146 QString jsServerInstallPath = CustomPaths::lspRuntimePath(QString::fromStdString(key.language));
147 RemoteChecker::instance().checkJSServer(jsServerInstallPath);
148
149 QString nodePath = jsServerInstallPath + "/node_modules/node/bin/node";
150 QString serverPath = jsServerInstallPath + "/node_modules/.bin/typescript-language-server";
151 if (!QFileInfo::exists(nodePath) || !QFileInfo::exists(serverPath)) {
152 return nullptr;
153 }
154
155 auto proc = new QProcess();
156 proc->setProgram(nodePath);
157 proc->setArguments({ serverPath, "--stdio" });
158
159 return proc;
160}
161
162void selectLspServer(const QJsonObject &params)
163{

Callers

nothing calls this directly

Calls 3

checkJSServerMethod · 0.80
setProgramMethod · 0.45
setArgumentsMethod · 0.45

Tested by

no test coverage detected