From 4270aba855862ec6966322896159db97fe96f578 Mon Sep 17 00:00:00 2001 From: Gunnar Wagenknecht Date: Wed, 18 Feb 2026 14:10:13 +0100 Subject: [PATCH 1/7] Update IJ Aspects --- bundles/com.salesforce.bazel.sdk/aspects/import/.bazelversion | 2 +- .../com.salesforce.bazel.sdk/aspects/import/import-and-build.sh | 2 +- .../salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bundles/com.salesforce.bazel.sdk/aspects/import/.bazelversion b/bundles/com.salesforce.bazel.sdk/aspects/import/.bazelversion index 56b6be4e..f9c71a52 100644 --- a/bundles/com.salesforce.bazel.sdk/aspects/import/.bazelversion +++ b/bundles/com.salesforce.bazel.sdk/aspects/import/.bazelversion @@ -1 +1 @@ -8.3.1 +8.5.1 diff --git a/bundles/com.salesforce.bazel.sdk/aspects/import/import-and-build.sh b/bundles/com.salesforce.bazel.sdk/aspects/import/import-and-build.sh index bf1daef7..9a28d1ed 100755 --- a/bundles/com.salesforce.bazel.sdk/aspects/import/import-and-build.sh +++ b/bundles/com.salesforce.bazel.sdk/aspects/import/import-and-build.sh @@ -23,7 +23,7 @@ fi # 2. check it builds (dependencies exist) # 3. update com.salesforce.bazel.sdk.aspects.intellij.IntellijAspects.ASPECTS_VERSION # -git_sha="3f0edce7702ced14ed26c026b79ae1cd26467749" +git_sha="87d40e651676a170fcb8dad5bcf2b1e3ffb376da" git_sha_short=${git_sha::6} # abort if file already exists diff --git a/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java b/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java index a66d0465..75cdc3c2 100644 --- a/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java +++ b/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java @@ -74,7 +74,7 @@ public boolean isPrefixOf(String outputGroupName) { public static final String OUTPUT_GROUP_JAVA_RUNTIME_CLASSPATH = "runtime_classpath"; - public static final String ASPECTS_VERSION = "3f0edc"; + public static final String ASPECTS_VERSION = "87d40e"; public static final Predicate ASPECT_OUTPUT_FILE_PREDICATE = str -> str.endsWith(".intellij-info.txt"); private static String getLanguageSuffix(LanguageClass language) { From 0530d0ec1e5ff303a92e24e9faf9a076edf96e66 Mon Sep 17 00:00:00 2001 From: Gunnar Wagenknecht Date: Wed, 18 Feb 2026 16:53:18 +0100 Subject: [PATCH 2/7] Update MODULE.bazel.lock file --- .../aspects/import/MODULE.bazel.lock | 51 +++++++++---------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/bundles/com.salesforce.bazel.sdk/aspects/import/MODULE.bazel.lock b/bundles/com.salesforce.bazel.sdk/aspects/import/MODULE.bazel.lock index fa66e827..25c7c121 100644 --- a/bundles/com.salesforce.bazel.sdk/aspects/import/MODULE.bazel.lock +++ b/bundles/com.salesforce.bazel.sdk/aspects/import/MODULE.bazel.lock @@ -1,5 +1,5 @@ { - "lockFileVersion": 18, + "lockFileVersion": 24, "registryFileHashes": { "https://bcr.bazel.build/bazel_registry.json": "8a28e4aff06ee60aed2a8c281907fb8bcbf3b753c91fb5a5c57da3215d5b3497", "https://bcr.bazel.build/modules/abseil-cpp/20210324.2/MODULE.bazel": "7cd0312e064fde87c8d1cd79ba06c876bd23630c83466e9500321be55c96ace2", @@ -94,8 +94,8 @@ "https://bcr.bazel.build/modules/rules_java/7.2.0/MODULE.bazel": "06c0334c9be61e6cef2c8c84a7800cef502063269a5af25ceb100b192453d4ab", "https://bcr.bazel.build/modules/rules_java/7.3.2/MODULE.bazel": "50dece891cfdf1741ea230d001aa9c14398062f2b7c066470accace78e412bc2", "https://bcr.bazel.build/modules/rules_java/7.6.1/MODULE.bazel": "2f14b7e8a1aa2f67ae92bc69d1ec0fa8d9f827c4e17ff5e5f02e91caa3b2d0fe", - "https://bcr.bazel.build/modules/rules_java/8.12.0/MODULE.bazel": "8e6590b961f2defdfc2811c089c75716cb2f06c8a4edeb9a8d85eaa64ee2a761", - "https://bcr.bazel.build/modules/rules_java/8.12.0/source.json": "cbd5d55d9d38d4008a7d00bee5b5a5a4b6031fcd4a56515c9accbcd42c7be2ba", + "https://bcr.bazel.build/modules/rules_java/8.14.0/MODULE.bazel": "717717ed40cc69994596a45aec6ea78135ea434b8402fb91b009b9151dd65615", + "https://bcr.bazel.build/modules/rules_java/8.14.0/source.json": "8a88c4ca9e8759da53cddc88123880565c520503321e2566b4e33d0287a3d4bc", "https://bcr.bazel.build/modules/rules_java/8.3.2/MODULE.bazel": "7336d5511ad5af0b8615fdc7477535a2e4e723a357b6713af439fe8cf0195017", "https://bcr.bazel.build/modules/rules_java/8.5.1/MODULE.bazel": "d8a9e38cc5228881f7055a6079f6f7821a073df3744d441978e7a43e20226939", "https://bcr.bazel.build/modules/rules_jvm_external/4.4.2/MODULE.bazel": "a56b85e418c83eb1839819f0b515c431010160383306d13ec21959ac412d2fe7", @@ -150,7 +150,7 @@ "moduleExtensions": { "@@pybind11_bazel+//:python_configure.bzl%extension": { "general": { - "bzlTransitiveDigest": "d4N/SZrl3ONcmzE98rcV0Fsro0iUbjNQFTIiLiGuH+k=", + "bzlTransitiveDigest": "c9ZWWeXeu6bctL4/SsY2otFWyeFN0JJ20+ymGyJZtWk=", "usagesDigest": "fycyB39YnXIJkfWCIXLUKJMZzANcuLy9ZE73hRucjFk=", "recordedFileInputs": { "@@pybind11_bazel+//MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e" @@ -184,7 +184,7 @@ }, "@@rules_fuzzing+//fuzzing/private:extensions.bzl%non_module_dependencies": { "general": { - "bzlTransitiveDigest": "mGiTB79hRNjmeDTQdzkpCHyzXhErMbufeAmySBt7s5s=", + "bzlTransitiveDigest": "WHRlQQnxW7e7XMRBhq7SARkDarLDOAbg6iLaJpk5QYM=", "usagesDigest": "wy6ISK6UOcBEjj/mvJ/S3WeXoO67X+1llb9yPyFtPgc=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -267,7 +267,7 @@ }, "@@rules_kotlin+//src/main/starlark/core/repositories:bzlmod_setup.bzl%rules_kotlin_extensions": { "general": { - "bzlTransitiveDigest": "hUTp2w+RUVdL7ma5esCXZJAFnX7vLbVfLd7FwnQI6bU=", + "bzlTransitiveDigest": "rL/34P1aFDq2GqVC2zCFgQ8nTuOC6ziogocpvG50Qz8=", "usagesDigest": "QI2z8ZUR+mqtbwsf2fLqYdJAkPOHdOV+tF2yVAUgRzw=", "recordedFileInputs": {}, "recordedDirentsInputs": {}, @@ -331,14 +331,14 @@ }, "@@rules_python+//python/extensions:pip.bzl%pip": { "general": { - "bzlTransitiveDigest": "mQkUtyPB0p2j6z/9YPlwC9QWcLMSELDlO1Ow/UrXkAw=", - "usagesDigest": "Y2oLrN0oX6+4MdPT2Otg4PQtK42XCxLXaDj/ffRA6dI=", + "bzlTransitiveDigest": "Ow3uwXpFcSZvHlKK1YJSrPYu0HnV+9MA73NlTEA9YWQ=", + "usagesDigest": "/9NP3RV6/DWuNdYAsIU/8UCgCX0TdPUJr0X6O+0lrtk=", "recordedFileInputs": { "@@protobuf+//python/requirements.txt": "983be60d3cec4b319dcab6d48aeb3f5b2f7c3350f26b3a9e97486c37967c73c5", "@@rules_fuzzing+//fuzzing/requirements.txt": "ab04664be026b632a0d2a2446c4f65982b7654f5b6851d2f9d399a19b7242a5b", - "@@rules_python+//tools/publish/requirements_darwin.txt": "095d4a4f3d639dce831cd493367631cd51b53665292ab20194bac2c0c6458fa8", - "@@rules_python+//tools/publish/requirements_linux.txt": "d576e0d8542df61396a9b38deeaa183c24135ed5e8e73bb9622f298f2671811e", - "@@rules_python+//tools/publish/requirements_windows.txt": "d18538a3982beab378fd5687f4db33162ee1ece69801f9a451661b1b64286b76" + "@@rules_python+//tools/publish/requirements_darwin.txt": "2994136eab7e57b083c3de76faf46f70fad130bc8e7360a7fed2b288b69e79dc", + "@@rules_python+//tools/publish/requirements_linux.txt": "8175b4c8df50ae2f22d1706961884beeb54e7da27bd2447018314a175981997d", + "@@rules_python+//tools/publish/requirements_windows.txt": "7673adc71dc1a81d3661b90924d7a7c0fc998cd508b3cb4174337cef3f2de556" }, "recordedDirentsInputs": {}, "envVariables": { @@ -2580,7 +2580,7 @@ ] } }, - "rules_python_publish_deps_311_rich_py3_none_any_6049d5e6": { + "rules_python_publish_deps_311_rich_py3_none_any_9836f509": { "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", "attributes": { "dep_template": "@rules_python_publish_deps//{name}:{target}", @@ -2594,17 +2594,17 @@ "cp311_osx_x86_64", "cp311_windows_x86_64" ], - "filename": "rich-13.9.4-py3-none-any.whl", + "filename": "rich-13.9.3-py3-none-any.whl", "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", "repo": "rules_python_publish_deps_311", - "requirement": "rich==13.9.4", - "sha256": "6049d5e6ec054bf2779ab3358186963bac2ea89175919d699e378b99738c2a90", + "requirement": "rich==13.9.3", + "sha256": "9836f5096eb2172c9e77df411c1b009bace4193d6a481d534fea75ebba758283", "urls": [ - "https://files.pythonhosted.org/packages/19/71/39c7c0d87f8d4e6c020a393182060eaefeeae6c01dab6a84ec346f2567df/rich-13.9.4-py3-none-any.whl" + "https://files.pythonhosted.org/packages/9a/e2/10e9819cf4a20bd8ea2f5dabafc2e6bf4a78d6a0965daeb60a4b34d1c11f/rich-13.9.3-py3-none-any.whl" ] } }, - "rules_python_publish_deps_311_rich_sdist_43959497": { + "rules_python_publish_deps_311_rich_sdist_bc1e01b8": { "repoRuleId": "@@rules_python+//python/private/pypi:whl_library.bzl%whl_library", "attributes": { "dep_template": "@rules_python_publish_deps//{name}:{target}", @@ -2622,13 +2622,13 @@ "--index-url", "https://pypi.org/simple" ], - "filename": "rich-13.9.4.tar.gz", + "filename": "rich-13.9.3.tar.gz", "python_interpreter_target": "@@rules_python++python+python_3_11_host//:python", "repo": "rules_python_publish_deps_311", - "requirement": "rich==13.9.4", - "sha256": "439594978a49a09530cff7ebc4b5c7103ef57baf48d5ea3184f21d9a2befa098", + "requirement": "rich==13.9.3", + "sha256": "bc1e01b899537598cf02579d2b9f4a415104d3fc439313a7a2c165d76557a08e", "urls": [ - "https://files.pythonhosted.org/packages/ab/3a/0316b28d0761c6734d6bc14e770d85506c986c85ffb239e688eeaab2c2bc/rich-13.9.4.tar.gz" + "https://files.pythonhosted.org/packages/d9/e9/cf9ef5245d835065e6673781dbd4b8911d352fb770d56cf0879cf11b7ee1/rich-13.9.3.tar.gz" ] } }, @@ -2897,7 +2897,7 @@ "requests": "{\"rules_python_publish_deps_311_requests_py3_none_any_70761cfe\":[{\"filename\":\"requests-2.32.3-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_requests_sdist_55365417\":[{\"filename\":\"requests-2.32.3.tar.gz\",\"version\":\"3.11\"}]}", "requests_toolbelt": "{\"rules_python_publish_deps_311_requests_toolbelt_py2_none_any_cccfdd66\":[{\"filename\":\"requests_toolbelt-1.0.0-py2.py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_requests_toolbelt_sdist_7681a0a3\":[{\"filename\":\"requests-toolbelt-1.0.0.tar.gz\",\"version\":\"3.11\"}]}", "rfc3986": "{\"rules_python_publish_deps_311_rfc3986_py2_none_any_50b1502b\":[{\"filename\":\"rfc3986-2.0.0-py2.py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_rfc3986_sdist_97aacf9d\":[{\"filename\":\"rfc3986-2.0.0.tar.gz\",\"version\":\"3.11\"}]}", - "rich": "{\"rules_python_publish_deps_311_rich_py3_none_any_6049d5e6\":[{\"filename\":\"rich-13.9.4-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_rich_sdist_43959497\":[{\"filename\":\"rich-13.9.4.tar.gz\",\"version\":\"3.11\"}]}", + "rich": "{\"rules_python_publish_deps_311_rich_py3_none_any_9836f509\":[{\"filename\":\"rich-13.9.3-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_rich_sdist_bc1e01b8\":[{\"filename\":\"rich-13.9.3.tar.gz\",\"version\":\"3.11\"}]}", "secretstorage": "{\"rules_python_publish_deps_311_secretstorage_py3_none_any_f356e662\":[{\"filename\":\"SecretStorage-3.3.3-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_secretstorage_sdist_2403533e\":[{\"filename\":\"SecretStorage-3.3.3.tar.gz\",\"version\":\"3.11\"}]}", "twine": "{\"rules_python_publish_deps_311_twine_py3_none_any_215dbe7b\":[{\"filename\":\"twine-5.1.1-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_twine_sdist_9aa08251\":[{\"filename\":\"twine-5.1.1.tar.gz\",\"version\":\"3.11\"}]}", "urllib3": "{\"rules_python_publish_deps_311_urllib3_py3_none_any_ca899ca0\":[{\"filename\":\"urllib3-2.2.3-py3-none-any.whl\",\"version\":\"3.11\"}],\"rules_python_publish_deps_311_urllib3_sdist_e7d814a8\":[{\"filename\":\"urllib3-2.2.3.tar.gz\",\"version\":\"3.11\"}]}", @@ -2933,10 +2933,6 @@ } } }, - "moduleExtensionMetadata": { - "useAllRepos": "NO", - "reproducible": false - }, "recordedRepoMappingEntries": [ [ "bazel_features+", @@ -3071,5 +3067,6 @@ ] } } - } + }, + "facts": {} } From 610460de1d2350c4a065f322eceacbbf1fb9e9e3 Mon Sep 17 00:00:00 2001 From: Gunnar Wagenknecht Date: Wed, 18 Feb 2026 17:34:43 +0100 Subject: [PATCH 3/7] Clean server --- vscode/package.json | 3 +- vscode/scripts/server.mjs | 224 ++++++++++++++++++++++---------------- 2 files changed, 131 insertions(+), 96 deletions(-) diff --git a/vscode/package.json b/vscode/package.json index 1335447a..baeb7ea3 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -326,7 +326,7 @@ "vscode:prepublish": "run-s clean esbuild:base -- --minify", "build": "run-s clean build:server esbuild:base", "build:server": "node scripts/index.mjs build-or-download", - "clean": "npx rimraf out meta.json stats.html *.vsix test/result", + "clean": "npx rimraf out meta.json stats.html *.vsix test/result server", "esbuild:base": "tsx build.ts", "esbuild:watch": "npm run esbuild:base -- --sourcemap --watch", "analyze": "npm run esbuild:base -- --minify --metafile --analyze && esbuild-visualizer --metadata ./meta.json --open", @@ -336,6 +336,7 @@ "test:compile": "tsc -b ./test/tsconfig.json", "test:lint": "eslint --ext .js,.ts,.tsx src", "test:repo": "node scripts/index.mjs repo-check", + "test:bazel-example-works": "cd test/projects/small && bazel test //...", "test:extension": "vscode-test", "package": "run-s clean build vsce:package", "vsce:package": "npx vsce package --no-dependencies" diff --git a/vscode/scripts/server.mjs b/vscode/scripts/server.mjs index b127c5bd..d3815d52 100644 --- a/vscode/scripts/server.mjs +++ b/vscode/scripts/server.mjs @@ -9,17 +9,23 @@ import fs from 'fs-extra'; import { glob } from 'glob'; import path from 'path'; import unzip from 'unzipper'; -import { downloadFile, getScriptDir, handleError, setupMainExecution } from './utils.mjs'; +import { + downloadFile, + getScriptDir, + handleError, + setupMainExecution, +} from './utils.mjs'; const dirname = getScriptDir(); const serverDir = path.join(dirname, '..', '..'); -const BAZEL_ECLIPSE_LATEST_URL = 'https://eclipseguru.github.io/bazel-eclipse/latest/p2-repository.zip'; +const BAZEL_ECLIPSE_LATEST_URL = + 'https://eclipseguru.github.io/bazel-eclipse/latest/p2-repository.zip'; // a little helper to drop OSGi versions from bundle jar file name const JAR_VERSION_SUFFIX = /_\d+\.\d+\.\d+(\.[^\.]+)?\.jar/; function jarNameWithoutVersion(filePath) { - return filePath.split('/').pop().replace(JAR_VERSION_SUFFIX, '.jar'); + return filePath.split('/').pop().replace(JAR_VERSION_SUFFIX, '.jar'); } // read the package.json once so we can use it in the gulp script @@ -27,119 +33,147 @@ const packageJson = JSON.parse(fs.readFileSync('./package.json').toString()); // we only need the headless jars of the Bazel JDT Language Server extension const declaredServerJars = new Set( - packageJson.contributes.javaExtensions.map( - (path) => path.split('/').reverse()[0] - ) + packageJson.contributes.javaExtensions.map( + (path) => path.split('/').reverse()[0] + ) ); function jarIsIncludedInPackageJson(jarName) { - return declaredServerJars.has(jarName); + return declaredServerJars.has(jarName); } function isWin() { - return /^win/.test(process.platform); + return /^win/.test(process.platform); } function mvnw() { - return isWin() ? "mvnw.cmd" : "./mvnw"; + return isWin() ? 'mvnw.cmd' : './mvnw'; } async function downloadServer() { - console.log('Downloading latest Bazel JDT Language Server extension release...'); - - fs.removeSync('./server'); - fs.ensureDirSync('./server'); - - const tempFile = path.join(dirname, 'temp-server.zip'); - - try { - await downloadFile(BAZEL_ECLIPSE_LATEST_URL, tempFile); - - // extract only the plugin jars that are declared in package.json - const directory = await unzip.Open.file(tempFile); - const filesToExtract = directory.files.filter(file => - file.path.startsWith('plugins/') && - jarIsIncludedInPackageJson(jarNameWithoutVersion(file.path)) - ); - await Promise.all(filesToExtract.map(async file => { - const destPath = path.join('./server', jarNameWithoutVersion(file.path)); - fs.ensureDirSync(path.dirname(destPath)); - return new Promise((resolve, reject) => { - file.stream() - .pipe(fs.createWriteStream(destPath)) - .on('finish', resolve) - .on('error', reject); - }); - })); - - fs.removeSync(tempFile); - - console.log('Successfully downloaded and extracted Bazel JDT Language Server extension'); - } catch (error) { - handleError(error, 'downloading server'); - } + console.log( + 'Downloading latest Bazel JDT Language Server extension release...' + ); + + fs.removeSync('./server'); + fs.ensureDirSync('./server'); + + const tempFile = path.join(dirname, 'temp-server.zip'); + + try { + await downloadFile(BAZEL_ECLIPSE_LATEST_URL, tempFile); + + // extract only the plugin jars that are declared in package.json + const directory = await unzip.Open.file(tempFile); + const filesToExtract = directory.files.filter( + (file) => + file.path.startsWith('plugins/') && + jarIsIncludedInPackageJson(jarNameWithoutVersion(file.path)) + ); + await Promise.all( + filesToExtract.map(async (file) => { + const destPath = path.join( + './server', + jarNameWithoutVersion(file.path) + ); + fs.ensureDirSync(path.dirname(destPath)); + return new Promise((resolve, reject) => { + file + .stream() + .pipe(fs.createWriteStream(destPath)) + .on('finish', resolve) + .on('error', reject); + }); + }) + ); + + fs.removeSync(tempFile); + + console.log( + 'Successfully downloaded and extracted Bazel JDT Language Server extension' + ); + } catch (error) { + handleError(error, 'downloading server'); + } } async function buildServer() { - console.log('Building Bazel JDT Language Server extension...'); - - fs.removeSync('./server'); - fs.ensureDirSync('./server'); - - try { - const jdtlsJars = await glob(`${serverDir}/releng/p2repository/target/repository/plugins/com.salesforce.bazel.eclipse.jdtls_*.jar`); - if(jdtlsJars.length != 1) { - console.log('Building Bazel JDT Language Server extension from source...'); - const command = `${mvnw()} clean package -DskipTests=true`; - console.log(`Executing: ${command}`); - execSync(command, { cwd: serverDir, stdio: [0, 1, 2] }); - } - - const sources = await glob(`${serverDir}/releng/p2repository/target/repository/plugins/*.jar`); - - // filter the jars that are included in the package.json - const jarsToCopy = sources.filter(source => jarIsIncludedInPackageJson(jarNameWithoutVersion(source))); - if (jarsToCopy.length > 0) { - // copy the jars to the server directory - await Promise.all(jarsToCopy.map(async source => { - return await fs.copy(source, path.join('./server', jarNameWithoutVersion(source))); - })); - console.log('Successfully built and copied Bazel JDT Language Server extension'); - } else { - throw new Error('No server jars found after build'); - } - } catch (error) { - handleError(error, 'building server', false); - throw error; - } + console.log('Building Bazel JDT Language Server extension...'); + + fs.removeSync('./server'); + fs.ensureDirSync('./server'); + + try { + const jdtlsJars = await glob( + `${serverDir}/releng/p2repository/target/repository/plugins/com.salesforce.bazel.eclipse.jdtls_*.jar` + ); + if (jdtlsJars.length != 1) { + console.log( + 'Building Bazel JDT Language Server extension from source...' + ); + const command = `${mvnw()} clean package -DskipTests=true`; + console.log(`Executing: ${command}`); + execSync(command, { cwd: serverDir, stdio: [0, 1, 2] }); + } + + const sources = await glob( + `${serverDir}/releng/p2repository/target/repository/plugins/*.jar` + ); + + // filter the jars that are included in the package.json + const jarsToCopy = sources.filter((source) => + jarIsIncludedInPackageJson(jarNameWithoutVersion(source)) + ); + if (jarsToCopy.length > 0) { + // copy the jars to the server directory + await Promise.all( + jarsToCopy.map(async (source) => { + return await fs.copy( + source, + path.join('./server', jarNameWithoutVersion(source)) + ); + }) + ); + console.log( + 'Successfully built and copied Bazel JDT Language Server extension' + ); + } else { + throw new Error('No server jars found after build'); + } + } catch (error) { + handleError(error, 'building server', false); + throw error; + } } async function buildOrDownload() { - if (!fs.existsSync(serverDir)) { - console.log('NOTE: bazel-eclipse is not found as a sibling directory, downloading the latest snapshot of the Bazel JDT Language Server extension...'); - await downloadServer(); - } else { - await buildServer(); - } + if (!fs.existsSync(serverDir)) { + console.log( + 'NOTE: bazel-eclipse is not found as a sibling directory, downloading the latest snapshot of the Bazel JDT Language Server extension...' + ); + await downloadServer(); + } else { + await buildServer(); + } } // Main execution async function main() { - const command = process.argv[2]; - - switch (command) { - case 'download': - await downloadServer(); - break; - case 'build': - await buildServer(); - break; - case 'build-or-download': - await buildOrDownload(); - break; - default: - console.log('Usage: node server.js [download|build|build-or-download|dev|watch]'); - process.exit(1); - } + const command = process.argv[2]; + + switch (command) { + case 'download': + await downloadServer(); + break; + case 'build': + await buildServer(); + break; + case 'build-or-download': + await buildOrDownload(); + break; + default: + console.log('Usage: node server.js [download|build|build-or-download]'); + process.exit(1); + } } setupMainExecution(main); From 524d3f63bbfb874ed24b45b610312fa64487bc59 Mon Sep 17 00:00:00 2001 From: Gunnar Wagenknecht Date: Wed, 18 Feb 2026 18:53:27 +0100 Subject: [PATCH 4/7] Add missing template --- .../sdk/aspects/intellij/IntellijAspects.java | 44 ++++++------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java b/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java index 75cdc3c2..24185dbd 100644 --- a/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java +++ b/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java @@ -139,36 +139,20 @@ public void copyIntoWorkspace(Path workspaceRoot, BazelVersion bazelVersion) thr // copy templates var templateOptions = getTemplateOptions(bazelVersion); - writeTemplateToWorkspace( - targetDirectory, - "java_info.bzl", - ASPECT_TEMPLATE_DIRECTORY, - "java_info.template.bzl", - templateOptions); - writeTemplateToWorkspace( - targetDirectory, - "python_info.bzl", - ASPECT_TEMPLATE_DIRECTORY, - "python_info.template.bzl", - templateOptions); - writeTemplateToWorkspace( - targetDirectory, - "intellij_info_bundled.bzl", - ASPECT_TEMPLATE_DIRECTORY, - "intellij_info.template.bzl", - templateOptions); - writeTemplateToWorkspace( - targetDirectory, - "code_generator_info.bzl", - ASPECT_TEMPLATE_DIRECTORY, - "code_generator_info.template.bzl", - templateOptions); - writeTemplateToWorkspace( - targetDirectory, - "cc_info.bzl", - ASPECT_TEMPLATE_DIRECTORY, - "cc_info.template.bzl", - templateOptions); + for (var name : List.of( + "java_info", + "scala_info", + "python_info", + "intellij_info_bundled", + "code_generator_info", + "cc_info")) { + writeTemplateToWorkspace( + targetDirectory, + name + ".bzl", + ASPECT_TEMPLATE_DIRECTORY, + name + ".template.bzl", + templateOptions); + } } String getAspectsArchiveLocation() { From f3f674b10072b9949cc6d922a8420ee608ab9496 Mon Sep 17 00:00:00 2001 From: Gunnar Wagenknecht Date: Wed, 18 Feb 2026 18:54:40 +0100 Subject: [PATCH 5/7] Fix test --- vscode/.vscode-test.js | 34 +++++----- vscode/package.json | 4 +- vscode/src/loggingTCPServer.ts | 10 +-- vscode/test/runTest.ts | 109 --------------------------------- 4 files changed, 24 insertions(+), 133 deletions(-) delete mode 100644 vscode/test/runTest.ts diff --git a/vscode/.vscode-test.js b/vscode/.vscode-test.js index 037938a2..cc0de985 100644 --- a/vscode/.vscode-test.js +++ b/vscode/.vscode-test.js @@ -2,21 +2,21 @@ const { defineConfig } = require('@vscode/test-cli'); module.exports = defineConfig([ - { - installExtensions: ['redhat.java@prerelease'], - workspaceFolder: 'test/projects/small', - files: 'out/test/**/*.test.js', - mocha: { - ui: 'tdd', - timeout: 60000, - reporter: 'json', - reporterOptions: { - output: './test/result/extension.test.json', - reportDir: './test/result', - reportFilename: "[status]_[datetime]-[name]-report", - reportTitle: 'Bazel Eclipse Extension Tests', - reportPageTitle: 'Bazel Eclipse Extension Tests', - }, - } - } + { + //installExtensions: ['redhat.java@prerelease'], + workspaceFolder: 'test/projects/small', + files: 'out/test/**/*.test.js', + mocha: { + ui: 'tdd', + timeout: 60000, + reporter: 'json', + reporterOptions: { + output: './test/result/extension.test.json', + reportDir: './test/result', + reportFilename: '[status]_[datetime]-[name]-report', + reportTitle: 'Bazel Eclipse Extension Tests', + reportPageTitle: 'Bazel Eclipse Extension Tests', + }, + }, + }, ]); diff --git a/vscode/package.json b/vscode/package.json index baeb7ea3..376c0516 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -9,8 +9,8 @@ "bugs": "https://github.com/eclipseguru/bazel-eclipse/issues", "preview": true, "engines": { - "node": "^22.20.0", - "vscode": "^1.106.0" + "node": "^22.21.1", + "vscode": "^1.109.0" }, "repository": { "type": "git", diff --git a/vscode/src/loggingTCPServer.ts b/vscode/src/loggingTCPServer.ts index ba97a464..07381a7d 100644 --- a/vscode/src/loggingTCPServer.ts +++ b/vscode/src/loggingTCPServer.ts @@ -79,7 +79,6 @@ export function registerLSClient(): Promise { async function registerPortWithLanguageServer( port: number, - attempts = 0, maxRetries = 50 ): Promise { let error = null; @@ -91,12 +90,13 @@ async function registerPortWithLanguageServer( Commands.REGISTER_BAZEL_TCP_SERVER_PORT, port ) - .then(() => - BazelLanguageServerTerminal.trace(`port ${port} registered with BLS`) - ); + .then(() => { + console.info(`register port ${port} with BLS (attempt ${i})`); + BazelLanguageServerTerminal.trace(`port ${port} registered with BLS`); + }); } catch (err) { error = err; - console.error(`register port failed ${attempts} : ${err}`); + console.warn(`register port failed ${i} : ${err}`); await setTimeout(i * 1000); } } diff --git a/vscode/test/runTest.ts b/vscode/test/runTest.ts deleted file mode 100644 index e755a092..00000000 --- a/vscode/test/runTest.ts +++ /dev/null @@ -1,109 +0,0 @@ -import * as cp from 'child_process'; -import * as fs from 'fs'; -import { glob } from 'glob'; -import * as os from 'os'; -import * as path from 'path'; -import { env } from 'process'; - -import { - downloadAndUnzipVSCode, - resolveCliArgsFromVSCodeExecutablePath, - runTests, -} from '@vscode/test-electron'; - -async function main() { - // folder containing the Extension Manifest package.json - const extensionDevelopmentPath = path.resolve(__dirname, '../../'); - - // path to the extension test runner script - const extensionTestsPath = path.resolve(__dirname, './suite/index'); - - // path to the sampel project for testing - const testProjectPath: string = path.resolve( - extensionDevelopmentPath, - './test/projects/small/' - ); - - // temp area for test user data - const testUserDataPath: string = path.resolve( - os.tmpdir(), - './suite-projects-small/' - ); - - try { - // prepare VS Code (use latest stable) - const vscodeExecutablePath = await downloadAndUnzipVSCode('stable'); - const [cliPath, ...args] = - resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath); - - // span vs code process for custom setup - cp.spawnSync(cliPath, [...args, '--install-extension', 'redhat.java'], { - encoding: 'utf-8', - stdio: 'inherit', - }); - - // ensrue the user data area is empty - if (fs.existsSync(testUserDataPath)) { - fs.rmdirSync(testUserDataPath, { recursive: true }); - } - - // run the integration test with spawned VS Code - console.log( - `Running test suite with\n\tproject: ${testProjectPath}\n\tuser-data-dir: ${testUserDataPath}\n...` - ); - await runTests({ - vscodeExecutablePath, - extensionDevelopmentPath, - extensionTestsPath, - launchArgs: [ - '--disable-workspace-trust', - '--user-data-dir', - testUserDataPath, - testProjectPath, - ], - }); - } catch (err) { - console.log('\n\n\n'); - console.log( - '********************************************************************************************' - ); - console.error(`Failed to run tests: ${err}`); - console.log( - '********************************************************************************************' - ); - console.log('\n\n\n'); - - // try to locate Java LS log - const lsLogs = await glob( - ['**/*Java.log', '**/redhat.java/jdt_ws/.metadata/.log'], - { cwd: testUserDataPath, withFileTypes: true, dot: true } - ); - if (lsLogs.length > 0) { - if (env['PRINT_JDTLS_LOGS'] === 'true') { - lsLogs.forEach((log) => { - console.log(`> cat ${log.fullpath()}`); - try { - const data = fs.readFileSync(log.fullpath(), 'utf8'); - console.log(data); - } catch (err) { - console.error(err); - } - console.log('\n\n\n'); - }); - } else { - console.log( - 'Set PRINT_JDTLS_LOGS=true to show the following JDTLS log automatically:' - ); - lsLogs.forEach((log) => { - console.log(`\tcat ${log.fullpath()}`); - }); - } - } else { - console.warn('No logs from JDTLS found!'); - } - - process.exit(1); - } -} - -main(); From 9f5aac31dc2449f42c9de51c0ecbf1059d4c67bc Mon Sep 17 00:00:00 2001 From: Gunnar Wagenknecht Date: Wed, 18 Feb 2026 19:02:42 +0100 Subject: [PATCH 6/7] Of course one needed to be special --- .../sdk/aspects/intellij/IntellijAspects.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java b/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java index 24185dbd..04e3addc 100644 --- a/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java +++ b/bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java @@ -139,13 +139,7 @@ public void copyIntoWorkspace(Path workspaceRoot, BazelVersion bazelVersion) thr // copy templates var templateOptions = getTemplateOptions(bazelVersion); - for (var name : List.of( - "java_info", - "scala_info", - "python_info", - "intellij_info_bundled", - "code_generator_info", - "cc_info")) { + for (var name : List.of("java_info", "scala_info", "python_info", "code_generator_info", "cc_info")) { writeTemplateToWorkspace( targetDirectory, name + ".bzl", @@ -153,6 +147,12 @@ public void copyIntoWorkspace(Path workspaceRoot, BazelVersion bazelVersion) thr name + ".template.bzl", templateOptions); } + writeTemplateToWorkspace( + targetDirectory, + "intellij_info_bundled.bzl", + ASPECT_TEMPLATE_DIRECTORY, + "intellij_info.template.bzl", + templateOptions); } String getAspectsArchiveLocation() { From 6e792b0f7e3ca0b03a1bcfc2f3c8c0b2aebba8fc Mon Sep 17 00:00:00 2001 From: Gunnar Wagenknecht Date: Wed, 18 Feb 2026 19:35:04 +0100 Subject: [PATCH 7/7] Re-install extension --- vscode/.vscode-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vscode/.vscode-test.js b/vscode/.vscode-test.js index cc0de985..30db5ee7 100644 --- a/vscode/.vscode-test.js +++ b/vscode/.vscode-test.js @@ -3,7 +3,7 @@ const { defineConfig } = require('@vscode/test-cli'); module.exports = defineConfig([ { - //installExtensions: ['redhat.java@prerelease'], + installExtensions: ['redhat.java@prerelease'], workspaceFolder: 'test/projects/small', files: 'out/test/**/*.test.js', mocha: {