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

Function createJavaServ

src/tools/languageadapter/main.cpp:78–120  ·  view source on GitHub ↗

setting from jdtls trismit

Source from the content-addressed store, hash-verified

76
77// setting from jdtls trismit
78QProcess *createJavaServ(const newlsp::ProjectKey &key)
79{
80 lspServOut << __FUNCTION__ << qApp->thread() << QThread::currentThread();
81 if (key.language != newlsp::Java)
82 return nullptr;
83
84 QString dataDir = CustomPaths::projectCachePath(QString::fromStdString(key.workspace));
85 QString runtimePath = CustomPaths::lspRuntimePath(QString::fromStdString(key.language));
86 bool noRuntimeChilds = QDir(runtimePath).entryList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot).isEmpty();
87 if (noRuntimeChilds) {
88 if (!env::pkg::native::installed()) {
89 RemoteChecker::instance().checkLanguageBackend(QString::fromStdString(key.language));
90 } else {
91 lspServOut << "unzip install native package..." << noRuntimeChilds;
92 QString jdtlsNativePkgPath = env::pkg::native::path(env::package::Category::get()->jdtls);
93 ProcessUtil::execute("tar", { "zxvf", jdtlsNativePkgPath, "-C", "." }, runtimePath,
94 [=](const QByteArray &data) {
95 lspServOut << QString(data);
96 });
97 }
98 }
99
100 auto proc = new QProcess();
101 QString lanuchLine = "/usr/bin/java "
102 "-Declipse.application=org.eclipse.jdt.ls.core.id1 "
103 "-Dosgi.bundles.defaultStartLevel=4 "
104 "-Declipse.product=org.eclipse.jdt.ls.core.product "
105 "-Dlog.level=ALL "
106 "-noverify "
107 "-Xmx1G "
108 "--add-modules=ALL-SYSTEM "
109 "--add-opens java.base/java.util=ALL-UNNAMED "
110 "--add-opens java.base/java.lang=ALL-UNNAMED "
111 "-jar "
112 + runtimePath + "/plugins/org.eclipse.equinox.launcher_1.6.400.v20210924-0641.jar "
113 "-configuration "
114 + runtimePath + "/config_linux "
115 + QString("-data %0").arg(dataDir);
116 proc->setProgram("/usr/bin/bash");
117 proc->setArguments({ "-c", lanuchLine });
118
119 return proc;
120}
121
122// setting from pyls trismit
123QProcess *createPythonServ(const newlsp::ProjectKey &key)

Callers

nothing calls this directly

Calls 6

checkLanguageBackendMethod · 0.80
getFunction · 0.50
QStringClass · 0.50
isEmptyMethod · 0.45
setProgramMethod · 0.45
setArgumentsMethod · 0.45

Tested by

no test coverage detected