setting from jdtls trismit
| 76 | |
| 77 | // setting from jdtls trismit |
| 78 | QProcess *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 |
| 123 | QProcess *createPythonServ(const newlsp::ProjectKey &key) |
nothing calls this directly
no test coverage detected