Code Monkey home page Code Monkey logo

bazel-vscode-java's Introduction

Bazel extension for Java™️ Language Support for VS Code

Build License

This extension adds support for Bazel to the Java™️ Language Support for VS Code. It plugs into the Eclipse Java Language server and computes project dependencies and classpath information using Bazel BUILD files.

Getting Started

Go and install the extension from the VSCode Marketplace (see listing here) or OpenVSX Registry (see listing here).

Once installed, open VSCode in any Bazel Workspace with Java targets. The extension will look for a WORKSPACE (WORKSPACE.bazel) file to identify a Bazel workspace. Next it will look for a .bazelproject file to look for directories and targets to resolve. If no .bazelproject file can be found a default one will be created. For details of the lookup sequence please have a look at the latest implementation of BazelProjectImporter.java in the language server.

Troubleshoot tips may be useful if it doesn't "just work".

bazel-vscode-java's People

Contributors

alexeishmidman avatar dependabot[bot] avatar guw avatar leonovecsergey avatar lonhutt avatar pmitrafanau avatar siddhant-k-code avatar svc-scm avatar vorburger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bazel-vscode-java's Issues

Fix Linting errors & Code styles

Explicitly silenced these warnings for now. But, IMO, we should remove these lines and focus on fixing the lining errors. Wdyt?

Linting errors
/workspace/bazel-vscode-java/src/bazelLangaugeServerTerminal.ts
  7:8  error  ES2015 module syntax is preferred over namespaces  @typescript-eslint/no-namespace

/workspace/bazel-vscode-java/src/bazelRunStatus.ts
  4:8  error  ES2015 module syntax is preferred over namespaces  @typescript-eslint/no-namespace

/workspace/bazel-vscode-java/src/bazelTaskManager.ts
  7:8  error  ES2015 module syntax is preferred over namespaces  @typescript-eslint/no-namespace

/workspace/bazel-vscode-java/src/bazelTerminal.ts
  18:7   error  'initialDimensions' is defined but never used  @typescript-eslint/no-unused-vars
  34:28  error  'substring' is defined but never used          @typescript-eslint/no-unused-vars
  34:50  error  'args' is defined but never used               @typescript-eslint/no-unused-vars
  34:56  error  Unexpected any. Specify a different type       @typescript-eslint/no-explicit-any

/workspace/bazel-vscode-java/src/bazelprojectparser.ts
  29:10  error  'rawSections' is assigned a value but never used  @typescript-eslint/no-unused-vars

/workspace/bazel-vscode-java/src/commands.ts
   8:8   error  ES2015 module syntax is preferred over namespaces  @typescript-eslint/no-namespace
  50:11  error  Unexpected any. Specify a different type           @typescript-eslint/no-explicit-any
  60:11  error  Unexpected any. Specify a different type           @typescript-eslint/no-explicit-any

/workspace/bazel-vscode-java/src/extension.ts
  138:24  error  '_' is defined but never used             @typescript-eslint/no-unused-vars
  139:22  error  '_' is defined but never used             @typescript-eslint/no-unused-vars
  197:38  error  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
  222:39  error  'doc' is defined but never used           @typescript-eslint/no-unused-vars

/workspace/bazel-vscode-java/src/jdtls.extension.api.ts
   62:14  error  Don't use `Object` as a type. The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.
- If you want a type meaning "any object", you probably want `object` instead.
- If you want a type meaning "any value", you probably want `unknown` instead.
- If you really want a type meaning "any non-nullish value", you probably want `NonNullable<unknown>` instead  @typescript-eslint/ban-types
  128:10  error  Unexpected any. Specify a different type                                                                                                                                                                                                                                                                                                                                                                        @typescript-eslint/no-explicit-any
  136:9   error  Unexpected any. Specify a different type                                                                                                                                                                                                                                                                                                                                                                        @typescript-eslint/no-explicit-any
  216:29  error  Unexpected any. Specify a different type                                                                                                                                                                                                                                                                                                                                                                        @typescript-eslint/no-explicit-any

/workspace/bazel-vscode-java/src/loggingTCPServer.ts
  7:7  error  'SERVER_START_RETRIES' is assigned a value but never used       @typescript-eslint/no-unused-vars
  8:7  error  'PORT_REGISTRATION_RETRIES' is assigned a value but never used  @typescript-eslint/no-unused-vars
  9:7  error  'RETRY_INTERVAL' is assigned a value but never used             @typescript-eslint/no-unused-vars

/workspace/bazel-vscode-java/src/provider/bazelRunTargetProvider.ts
  35:13  error  'args' is defined but never used          @typescript-eslint/no-unused-vars
  35:19  error  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
  43:3   error  'element' is defined but never used       @typescript-eslint/no-unused-vars

/workspace/bazel-vscode-java/src/provider/bazelSyncStatusProvider.ts
  59:13  error  'element' is defined but never used  @typescript-eslint/no-unused-vars
  63:3   error  'item' is defined but never used     @typescript-eslint/no-unused-vars
  64:3   error  'element' is defined but never used  @typescript-eslint/no-unused-vars
  65:3   error  'token' is defined but never used    @typescript-eslint/no-unused-vars

/workspace/bazel-vscode-java/src/provider/bazelTaskProvider.ts
  35:45  error  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any

✖ 30 problems (30 errors, 0 warnings)

Related #71 (comment)

Dependencies with @maven//: no longer work (in my particular project)

When I open https://github.com/enola-dev/enola/ with v1.23.112291230 (released 12/29/2023), and then open e.g. the common/common/src/main/java/dev/enola/common/io/resource/FileResource.java, then imports of java.* (JDK) and other dev.enola... (same workspace) are OK, but any "external" dependencies are not found - in that file that's e.g. all of the Guava related imports. That project uses rules_jvm_external in a MODULE.bazel with a maven.install to grab that Guava JAR. (The project builds fine on the CLI, of course.)

I'm pretty sure I used to have this working, but I cannot get it to work anymore on a new computer, so either it broke, quite possibly by some (Bazel?) or other upgrade I did over the last weeks - or I just cannot remember where all to click to kick it correctly? I usually right-click on common/common and Synchronize Projects with Bazel View and then Refresh Classpath from Bazel BUILD file - but that doesn't seem to do the trick.

If it's not a bug and just a problem between the chair and the screen (i.e. me!), then at the very least I can contribute an initial version of a "troubleshooting" doc somewhere here. Or you could improve the automation so that it "just works out of the box".

@guw how do we best debug this?

Missing Error Markers, possibly due to _Preview features enabled at an invalid source release level 11, preview can be enabled only at source level 21?_

When I use this extension for https://github.com/enola-dev/enola/, "Error Markers" are missing - there are no "red squiggles" for syntax errors. However other Java (JDT) features such as e.g. Cross References and Ctrl-Space Completion do work just fine for me.

Perhaps this is related to https://github.com/salesforce/bazel-vscode-java/blob/main/docs/troubleshoot.md#java-version, and the Preview features enabled at an invalid source release level 11, preview can be enabled only at source level 21 error that I'm seeing? I may have been wrong in #74 that this message is "harmless"...

When I'll have a moment, I'll explore installing another JDK and running VSC with that, to see if that solves this.

@guw FYI

elemental2 cannot be resolved to a typeJava

First of all, thank you for work you do ! Looks like it's exactly what i need

I have a little problem using external maven dependancy with your plugin, i think, i missed something

evn:
VSCode : Version: 1.63.0 (Universal) on Mac M1
bazel-vscode v0.0.4
config:

{
    "java.import.bazel.enabled": true,
    "java.import.maven.enabled": false,
    "files.exclude": {
        "**/.classpath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/.factorypath": true
    },
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "redhat.telemetry.enabled": true,
    "extensions.ignoreRecommendations": true
}

bazel run :AppRunner

Hi! class elemental2.dom.DomGlobal

so bazel import works (i am new to bazel, so i could be wrong in any of the steps)

please help

java-tutorial.zip

Need to prepare for Guava update in JDTLS

@guw it broke for me today (was working yesterday), I'm on v1.24.103200544, and .log has this, which is likely root cause:

!SESSION 2024-03-20 19:11:45.252 -----------------------------------------------
eclipse.buildId=unknown
java.version=17.0.10
java.vendor=Eclipse Adoptium
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  --pipe=/run/user/1000/lsp-7df9ef340a6a93b5a76e149d2c9f9d0d.sock
Command-line arguments:  -data /home/vorburger/.config/Code/User/workspaceStorage/5687ff7dea6a22a979f8c4dab8eb016b/redhat.java/jdt_ws --pipe=/run/user/1000/lsp-7df9ef340a6a93b5a76e149d2c9f9d0d.sock

!ENTRY com.salesforce.bazel.sdk 4 0 2024-03-20 19:11:46.180
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: Could not resolve module: com.salesforce.bazel.sdk [131]
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource; bundle-version="2.0.0"
    -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20240320-0533"
       com.salesforce.bazel.importedsource [130]
         Unresolved requirement: Import-Package: com.google.auto.value; resolution:="optional"
         Unresolved requirement: Import-Package: com.google.errorprone.annotations; resolution:="optional"
         Unresolved requirement: Import-Package: com.github.benmanes.caffeine.guava; version="3.1.8"
           -> Export-Package: com.github.benmanes.caffeine.guava; bundle-symbolic-name="com.github.ben-manes.caffeine.guava"; bundle-version="3.1.8"; version="3.1.8"; uses:="com.github.benmanes.caffeine.cache,com.google.common.cache"
              com.github.ben-manes.caffeine.guava [126]
                Unresolved requirement: Import-Package: com.google.common.cache; version="[32.1.0,33.0.0)"

	at org.eclipse.osgi.container.Module.start(Module.java:493)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:2073)
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:143)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2064)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2004)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1967)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1883)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:341)

This is blocking me from working on my project. I'll check out if there's a way to revert to older extension versions? (I've never tried.)

Build tool conflicts are detected in workspace. Which one would you like to use?

When I use this extension for https://github.com/enola-dev/enola/, there is always / sometimes (?) a pop-up, from RHT Java, asking:

Build tool conflicts are detected in workspace. Which one would you like to use? Maven -or- Gradle

This seems to be reproducible (for me) with:

  • redhat.java v1.27.2024011308
  • sfdc.bazel-vscode-java v1.24.101141409
  • vscjava.vscode-gradle v3.13.5 - BUT I have it disabled in Workspace
  • vscjava.vscode-maven v0.43.0 - BUT I have it disabled in Workspace

Interestingly, just clicking Maven seems to do the trick - and actually correctly initializes the Bazel Java support (for me).

I'm not sure if there would be a way for this extension to hook into VSC in some way to avoid this confusion?

Otherwise, perhaps just adding this to the Troubleshooting Guide is useful - at least until this is "fixed" (if it even can be).

@guw any thoughts?

Plugin does not work with Bazel 5

When trying to open a project with Bazel 5.1.0 installed, the plugin fails to generate a working JDT.LS configuration. The log is attached.

client.log.2022-03-25.txt

I made sure to clean the java language server workspace before trying to open a java source file, and the issue still occurs. Is this a quick fix or something more involved?

Mixing Maven-style and Bazel-style layout in a workspace: Possible, or a really dumb idea?

I'm pondering and exploring switching the directory of my https://github.com/enola-dev/enola from a "Maven-style" (e.g. core/impl/src/main/java/dev/enola/core) to a fully "Bazel-style" (e.g. java/dev/enola/model/xsd/Datatypes.java etc.) layout in this PR, starting small here. This will lead to "nested" BUILD files (e.g. java/dev/enola/BUILD and java/dev/enola/model/BUILD).

I suspect that with my existing .bazelproject as-is, this probably won't quite work?

Wondering if I can I "mix & match" and gradually transition, or need to do one single big refactoring moving lots of stuff around?

@guw any input?

Java Projects contains (empty) Referenced Libraries instead of Bazel Maven JAR dependencies

After a Clean Java Language Server Workspace for #102,

when I open e.g. common/common/src/main/java/dev/enola/common/io/resource/FileResource.java,

which is an example intentionally chosen because that common/common "module" (Bazel target) doesn't depend on others,

then those com.google.common.io Guava imports don't resolve and are red.

In the "Java Projects" view, there is an (empty) Referenced Libraries, instead of Bazel Maven JAR dependencies.

enola-dev/enola#431 couldn't be the root cause of this, could it? There is no error in the .log about it...

Perhaps it would be useful to add some additional catch and log in the part of the code which sets that up?

How to use / activate?

I'm trying to get my head around how to use (activate?) this... 😈

After not seeing #30 anymore, and having discovered the Import Bazel Project command (from here),

I am setting the Project WORKSPACE location in that Import wizard, clicking Load modules, checking a module, and clicking Start import.

The VSC Window reloads, but... the imports still can't be resolved.

The Classpath Configuration (from redhat.java) is still empty.

vsce package Error: ENOENT: no such file or directory, stat '/home/vorburger/git/github.com/salesforce/bazel-vscode/bazel-eclipse'

Following the README as-is, step 5. says to Package the extension running vsce package:

$ vsce package
Executing prepublish script 'npm run vscode:prepublish'...

> [email protected] vscode:prepublish
> gulp build-plugin

[19:21:18] Using gulpfile ~/git/github.com/salesforce/bazel-vscode/gulpfile.js
[19:21:18] Starting 'build-plugin'...
[19:21:18] 'build-plugin' errored after 2.7 ms
[19:21:18] Error: ENOENT: no such file or directory, stat '/home/vorburger/git/github.com/salesforce/bazel-vscode/bazel-eclipse'
    at Object.statSync (node:fs:1596:3)
    at __node_internal_ (node:internal/fs/utils:804:8)
    at Object.rmdirSync (node:fs:1215:15)
    at /home/vorburger/git/github.com/salesforce/bazel-vscode/gulpfile.js:18:6
    at taskWrapper (/home/vorburger/git/github.com/salesforce/bazel-vscode/node_modules/undertaker/lib/set-task.js:13:15)
    at bound (node:domain:433:15)
    at runBound (node:domain:444:12)
    at asyncRunner (/home/vorburger/git/github.com/salesforce/bazel-vscode/node_modules/async-done/index.js:55:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
 ERROR  npm failed with exit code 1

Looking at your gulpfile, I think I see what you are trying to do there, and will try to raise a PR to make this smoother for the next user....

@guw

Run in Java editor fails

When I open code java_one/ of https://github.com/vorburger/LearningBazel, it opens just fine (see #74).

However clicking Run (the gray "hover" thing, of Run | Debug) says Build failed, do you want to continue? (from Source: Debugger for Java)

There are no related errors in the usual Troubleshooting logs (that I could see).

With this extension, is this a "bug" because @guw this works for you in other projects, or is it "totally expected" and so this just a possible future Frequent Request (FR)?

BTW that Bazel Run Targets tab in the Explorer view is also empty... should there be something there, given the java_binary(name = "JavaOne", ... of that small sample project?

"Folder ... contains more Java files then configured in Bazel" when file is used in a java_library package.

I'm getting this error when running the extension on bazel itself:

Folder '/home/yusuke.tsutsumi/workspace/bazel/src/java_tools/buildjar/java/com/google/devtools/build/buildjar/javac' contains more Java files then configured in Bazel. This is a scenario which is challenging to support in IDEs! Consider re-structuring your source code into separate folder hierarchies and Bazel packages.
 - javac/JavacOptions.java
 - javac/WerrorCustomOption.java

I looked at the files, and those are used in a separate target, although indeed they are explicitly excluded from the javac target

Although I think the error is still correct in that the package structure is difficult for parse properly - it is still a technically correct usage of bazel.

At minimum maybe this should be a warning and not an error?

Trivial Bazel 6.4.0 example project (without `rules_jvm_external`) fails to open

When I open code java_one/ in https://github.com/vorburger/LearningBazel it fails like this:

Command failed: bazel --output_base=/tmp/07d06c474e5b9ccb01482f273e2b80b3 query ...:* --output=package
Loading: 0 packages loaded
ERROR: error loading package under directory '': error loading package 'bazel-java-one/external/bazel_tools/tools/android': Label '//tools/python:private/defs.bzl' is invalid because 'tools/python' is not a package; perhaps you meant to put the colon here: '//:tools/python/private/defs.bzl'?
Loading: 1 packages loaded
    currently loading: bazel-java-one/external/remote_java_tools ... (4 packages)

This does not even use rules_jvm_external like #73.

@guw

failure with `Unresolved requirement: Import-Package: com.google.common.cache; version="[32.1.0,33.0.0)"`

Hello! I'm trying to use the extension to develop bazel itself. I:

  1. updated my JDK to 22
  2. cloned the bazel project
  3. opened vscode with the bazel-vscode-java extension enabled (along with the standard java extension owned by Microsoft).

And I have the following error:

Apr 16, 2024 8:22:16 AM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider ch.qos.logback.classic.servlet.LogbackServletContainerInitializer of service jakarta.servlet.ServletContainerInitializer in bundle ch.qos.logback.classic
Apr 16, 2024 8:22:16 AM org.apache.aries.spifly.BaseActivator log
INFO: Registered provider ch.qos.logback.classic.spi.LogbackServiceProvider of service org.slf4j.spi.SLF4JServiceProvider in bundle ch.qos.logback.classic
[Error - 8:22:22 AM] Apr 16, 2024, 8:22:17 AM FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: com.salesforce.bazel.sdk [123]
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.importedsource; bundle-version="2.0.0"
    -> Bundle-SymbolicName: com.salesforce.bazel.importedsource; bundle-version="2.0.0.v20240203-1430"
       com.salesforce.bazel.importedsource [122]
         Unresolved requirement: Import-Package: com.google.auto.value; resolution:="optional"
         Unresolved requirement: Import-Package: com.google.errorprone.annotations; resolution:="optional"
         Unresolved requirement: Import-Package: com.github.benmanes.caffeine.guava; version="3.1.8"
           -> Export-Package: com.github.benmanes.caffeine.guava; bundle-symbolic-name="com.github.ben-manes.caffeine.guava"; bundle-version="3.1.8"; version="3.1.8"; uses:="com.github.benmanes.caffeine.cache,com.google.common.cache"
              com.github.ben-manes.caffeine.guava [117]
                Unresolved requirement: Import-Package: com.google.common.cache; version="[32.1.0,33.0.0)"

	at org.eclipse.osgi.container.Module.start(Module.java:493)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:2073)
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:143)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2064)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2004)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1967)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1883)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:341

Any pointers on where to look?

Problems getting started

I'm facing a few issues getting started with a hello world project and VSCode Java. The main one is the my imports are not recognized:

image

image

This is despite listing the package in BUILD.bazel (java_binary rule):

image

I'm using maven_install to pull in the dependencies, and have tried both in pinned and unpinned modes.

This is a great idea and we have very similar needs to yourselves in our migration to bazel whilst maintaining good IDE support.

Thanks! Chris

Failed to load extension bundles

WARNING: Using incubator modules: jdk.incubator.foreign, jdk.incubator.vector
[Error - 9:51:20 PM] Feb 18, 2023, 9:51:20 PM Failed to load extension bundles 
Load bundle list
org.eclipse.core.runtime.CoreException: Load bundle list
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.loadBundles(BundleUtils.java:169)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler.handleInitializationOptions(InitHandler.java:92)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.initialize(BaseInitHandler.java:64)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.initialize(JDTLanguageServer.java:247)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
	at org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$1(ParentProcessWatcher.java:144)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Contains: Bundle startup failed reference:file:/home/vorburger/.vscode/extensions/salesforce.bazel-vscode-0.0.5/bazel-eclipse/bundles/com.salesforce.b2eclipse.jdt.ls/target/com.salesforce.b2eclipse.jdt.ls.jar
org.osgi.framework.BundleException: Could not resolve module: com.salesforce.b2eclipse.jdt.ls [113]
  Unresolved requirement: Require-Bundle: com.salesforce.bazel.eclipse.common
    -> Bundle-SymbolicName: com.salesforce.bazel.eclipse.common; bundle-version="1.5.4.v20230206-1233"; singleton:="true"
       com.salesforce.bazel.eclipse.common [115]
         Unresolved requirement: Require-Bundle: org.slf4j.api
  Unresolved requirement: Require-Bundle: com.salesforce.bazel-java-sdk
    -> Bundle-SymbolicName: com.salesforce.bazel-java-sdk; bundle-version="1.5.4.v20230206-1931"; singleton:="true"
       com.salesforce.bazel-java-sdk [114]
         No resolution report for the bundle.
	at org.eclipse.osgi.container.Module.start(Module.java:463)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445)
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.startBundles(BundleUtils.java:280)
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.loadBundles(BundleUtils.java:167)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler.handleInitializationOptions(InitHandler.java:92)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.initialize(BaseInitHandler.java:64)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.initialize(JDTLanguageServer.java:247)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
	at org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$1(ParentProcessWatcher.java:144)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
Contains: Bundle startup failed reference:file:/home/vorburger/.vscode/extensions/salesforce.bazel-vscode-0.0.5/bazel-eclipse/bundles/com.salesforce.bazel.eclipse.common/target/com.salesforce.bazel.eclipse.common.jar
org.osgi.framework.BundleException: Could not resolve module: com.salesforce.bazel.eclipse.common [115]
  Unresolved requirement: Require-Bundle: org.slf4j.api

	at org.eclipse.osgi.container.Module.start(Module.java:463)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445)
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.startBundles(BundleUtils.java:280)
	at org.eclipse.jdt.ls.core.internal.handlers.BundleUtils.loadBundles(BundleUtils.java:167)
	at org.eclipse.jdt.ls.core.internal.handlers.InitHandler.handleInitializationOptions(InitHandler.java:92)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseInitHandler.initialize(BaseInitHandler.java:64)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.initialize(JDTLanguageServer.java:247)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190)
	at org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$1(ParentProcessWatcher.java:144)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

@guw are you already looking into this?

Bazel JDT LS extension doesn't support the command 'java.bazel.connectProcessStreamSocket'

@guw long time no speak! Very sorry I went a bit silent earlier this year (too busy).

I noticed that you have done much work here, and thought I would give it another go.

https://github.com/enola-dev/enola is the project I have tried to open with it.

Using the v1.23.109211202 that's currently published as Preview, it's failing for me, with this on Output for Bazel:

2023-09-29 19:06:47.887 [info] Bazel log server listening on port 46083
2023-09-29 19:07:08.100 [error] Failed to register port with BLS: Bazel JDT LS extension doesn't support the command 'java.bazel.connectProcessStreamSocket'.

and various errors on the Language Support for Java, among which the following may be most interesting:

[Error - 7:07:08 PM] Sep 29, 2023, 7:07:08 PM Problems occurred when invoking code from plug-in: "org.eclipse.jdt.ls.core".
Bazel JDT LS extension doesn't support the command 'java.bazel.connectProcessStreamSocket'.
java.lang.UnsupportedOperationException: Bazel JDT LS extension doesn't support the command 'java.bazel.connectProcessStreamSocket'.
	at com.salesforce.bazel.eclipse.jdtls.commands.BazelJdtLsDelegateCommandHandler.executeCommand(BazelJdtLsDelegateCommandHandler.java:76)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:613)
	at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)

(...)

[Error - 7:07:13 PM] Sep 29, 2023, 7:07:12 PM Error occured while building workspace. Details: 
 message: The import picocli cannot be resolved; code: 268435846; resource: /home/vorburger/git/github.com/vorburger/enola/cli/src/main/java/dev/enola/cli/CLI.java; line: 20

(...)

message: CommandLine cannot be resolved to a type; code: 16777218; resource: /home/vorburger/git/github.com/vorburger/enola/cli/src/main/java/dev/enola/cli/CLI.java; line: 29

INFO: -<- Done loading .configSourceProviders extension point -<-
[Error - 7:14:12 PM] Sep 29, 2023, 7:14:12 PM core/lib/src/test/java/dev/enola/core [in _main] does not exist
core/lib/src/test/java/dev/enola/core [in _main] does not exist
Java Model Exception: Error in Java Model (code 969): core/lib/src/test/java/dev/enola/core [in _main] does not exist
	at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:550)
	at org.eclipse.jdt.internal.core.PackageFragmentRoot.getUnderlyingResource(PackageFragmentRoot.java:761)
	at org.eclipse.jdt.internal.core.PackageFragment.getUnderlyingResource(PackageFragment.java:426)
	at org.eclipse.jdt.internal.core.Openable.getUnderlyingResource(Openable.java:349)
	at org.eclipse.jdt.internal.core.CompilationUnit.getUnderlyingResource(CompilationUnit.java:986)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseDiagnosticsHandler.collectNonJavaProblems(BaseDiagnosticsHandler.java:149)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseDiagnosticsHandler.endReporting(BaseDiagnosticsHandler.java:135)
	at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.reportProblems(ReconcileWorkingCopyOperation.java:148)
	at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:112)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:740)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:806)
	at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1325)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseDocumentLifeCycleHandler.publishDiagnostics(BaseDocumentLifeCycleHandler.java:320)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseDocumentLifeCycleHandler.publishDiagnostics(BaseDocumentLifeCycleHandler.java:283)
	at org.eclipse.jdt.ls.core.internal.handlers.BaseDocumentLifeCycleHandler$PublishDiagnosticJob.run(BaseDocumentLifeCycleHandler.java:739)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

`.bazelproject` with `bazel_binary: bazelisk` does not seem to work

In salesforce/bazel-eclipse#477 there was a previous discussion re. the whole bazel and bazelisk and what not "bootstrapping story".

https://github.com/salesforce/bazel-vscode-java/blob/main/docs/troubleshoot.md#bazelisk has documentation I wrote about this.

It's been working OK for me locally, but I'm now for fun exploring GitHub Codespaces, and I have reason to believe that a .bazelproject with bazel_binary: bazelisk somehow actually does not seem to work.

If you grab https://github.com/enola-dev/enola/pull/354/files, as of 5317b786bb26f871a6469a90b00c3bab69a727b0, it's "not working", and the log has the java.io.IOException: Cannot run program "bazel": error=2, No such file or directory thing - it appears it's ignoring the bazel_binary: bazelisk which is in in .bazelproject on that PR at that commit (but not on the main branch of that repo, yet).

This isn't blocking, because I can probably work around and hack something for a bazel instead of a bazelisk to be symlink, in a set-up script, later maybe with a Dev Container.

@guw just wanted to let you know, in case this is something you want to look further into; feel free to close.

How to Debug Java JUnit Tests?

Similar to #80 but filed separately to focus on debugging (not running) of Bazel java_test instead of java_binary, and (to me) a much more important issue than that one:

Using my https://github.com/enola-dev/enola I have never managed to debug code using this VSC extension.

I keep working around it by adding temporary lines in tests to throw exceptions 😭 to inspect values, which is really quite dumb (of me)... 🤣

I'm guessing the JDT in VSC doesn't have any working "launch configurations", but I'm hoping that it can launch Bazel and remote attach?

I'm not quite sure if I'm just stupid and don't dig where / how to click? Or is this a feature gap and known to be not really working as-is right now?

@guw does this actually work for you?

Extension should create internal JDT Java projects for all dependant projects of current project

@guw I've just noticed the following:

After a Clean Java Language Server Workspace for #102 if I FIRST open a *.java of some "module" (Bazel target) which depends on another one (in the same WORKSPACE), then it will have some red - because the "dependant" project isn't created in JDT yet - the Java Projects view initially only shows that single first module.

Of course, AFTER opening any *.java file of a "dependant" project the red in the "depending" project goes away. But, in an ideal world, it would be nice if "it did this by itself" and just immediately initialised all projects?

Or is that what it's already supposed to do? Then that doesn't work, and if there is any problem it gives up too early?

An example of this is in https://github.com/enola-dev/enola, when I openend e.g. common/thing/src/main/java/dev/enola/thing/MessageToThingConverter.java FIRST, then that implements Converter was red - until I opened common/common/src/main/java/dev/enola/common/convert/Converter.java

Note that I'm having another problem with dependencies from external Maven JAR libraries, see #103. I assumed that was an unrelated issue - unless it's the root cause of this?

PS: enola-dev/enola#431 couldn't be the root cause of this, could it? There is no error in the .log about it...

Go To Type Definition opens .class instead of .java

In https://github.com/enola-dev/enola/, when I Go To Type Definition e.g. in some **/src/test/java/**/*.java editor on a "symbol" that is something in the src/main (instead of /test) of the same module/project/whatever, then instead of .java it opens some read-only .class (read-only, but not decompiled; it's the correct source text).

I'm not sure how to describe this more accurately - let me know if some... screenshots (?), or something, would help to clarify.

@guw

Trivial Bazel 6.4.0 example WITH `rules_jvm_external` fails to open (with a another error)

When I open code rules_jvm_external/ in https://github.com/vorburger/LearningBazel it fails like this:

Command failed: bazel --output_base=/tmp/33f1df7beca4082e021dfd08c653c0c8 query ...:* --output=package
Loading: 0 packages loaded
ERROR: error loading package under directory '': error loading package 'bazel-rules_jvm_external/external/rules_jvm_external~5.3/tests/unit/manifest_stamp': Unable to find package for @[unknown repo 'bazel_skylib' requested from @]//rules:diff_test.bzl: The repository '@[unknown repo 'bazel_skylib' requested from @]' could not be resolved: No repository visible as '@bazel_skylib' from main repository.
Loading: 6 packages loaded
    currently loading: bazel-rules_jvm_external/external/rules_jvm_external~5.3~maven~maven ... (6 packages)

This probably should be made to work before #73 is further analysed.

Bazel based projects not present in Java project selection

We have a large monorepo with different languages and using Bazel as our build system. I have installed the plugin, added a WORKSPACE file with (workspace(name="example")) and a .eclipse/.bazelproject with :

directories:
  lib/common_java 

derive_targets_from_directories:

targets:

lib/common_java is just one of our folders with a BUILD.bazel file and asrc/main/java folder.

When I restart vscode with the plugin enabled (the Prerelease version 😄), it does not intercept the project setup workflow when I open a .java inside of lib/common_java. The java extension pack wants to only add .gradle or maven files, and we migrated away from the former.

It also adds a large section of files.exclude to my .vscode/settings.json (even with bazel.projectview.updateFileWatcherExclusion": false) which is unfortunate.

Make it work with `code serve-web` (or VSC Server over the Web with a Remote Tunnel) [it's OK in GitHub Codespaces]

I'm exploring using this extension with VSC Server over the Web with a Remote Tunnel.

I initially naively assumed that this would "just work" (for all and any extensions), but am gathering that this may not be so, and extensions such as this one may need to specifically support this way of using VSC?

I have this extension (and this time even remembered to Switch to Pre-Release Version, LOL), but... it seems like it's not even... "active"?!

The usual context menus are missing, and VSC prompts for Maven or Gradle (despite this) - so the extension isn't even "activated" (?), in the web?

https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds ?

@guw

Allow access to `bazel-bin` symlink

Access to bazel-* symlinks is hidden in most IDEs because they cannot deal with them nicely.

So far we replicate the exclusion in VS Code, too. But since it doesn't do the indexing as Eclipse/IntelliJ it might be possible to open up visibility in the VS Code extension.

This would be in VS Code only. The language server would still ignore them because of the expensive Eclipse resource refresh underneath. However, that's probably ok since the use case should be mostly browsing files in there.

On thing to verify is the interaction of VS Code with the LS in this case. For example, VS Code should not try to send requests for .java files inside the bazel-bin to the LS. If it does the LS needs to ignore those.

This should be limited to bazel-bin only. It should be visible by default unless an exclusion (-bazel-bin) is defined in the directories list in the project view.

Enola does not initialize anymore after Bazel & other upgrades

After many various upgrades in https://github.com/enola-dev/enola, including a Bazel upgrade from 6.4.0 to 7.0.0, and bumping rules_java to the latest, and other upgrades, originally all prompted by #85 to be able to try it out under Java 21 (here), that project even on the main branch which currently is still on Java 11 is "all red".

Following https://github.com/salesforce/bazel-vscode-java/blob/main/docs/troubleshoot.md, notably _ Java: Clean Java Language Server Workspace,_ does not help.

Logs: client.log.2024-01-17.json and log.txt

It says Failed to find a Bazel workspace

@guw thought this may interest you?

Extension does not start due to Caused by: org.eclipse.core.internal.dtree.ObjectNotFoundException: Tree element '/jdt.ls-java-project/.project' not found.

@guw could the log entry below, which I've just seen for the first time (perhaps newly visible since I add -Djava.bazel.staticProcessStreamSocket=22222 here after #97 from @lonhutt and/or after your f593594 for #100?) possibly be that long elusive root cause why for me on a new workstation it "doesn't work"?

The "end-user visible effect" here is like I previously described: The extension's Runtime Status is activated, "Activation Event:onLanguage:java, Activation Time: 13ms", but the Java Projects view/tab is just "spinning" - it failed to start / initialise.

PS: Maybe this is even related to #94 ?

The log is too long to copy/paste, here's just the end, I'm attaching the full .log:

!ENTRY org.eclipse.osgi 4 0 2024-02-19 18:02:39.585
!MESSAGE Application error
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in org.eclipse.jdt.ls.core was unable to load class org.eclipse.jdt.ls.core.internal.LanguageServerApplication.
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:242)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:225)
	at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:987)
	at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:255)
	at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:65)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:143)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:439)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:271)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:651)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:588)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1459)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1432)
Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.jdt.ls.core (55).
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:134)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:620)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:348)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:414)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:520)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:434)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:174)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:643)
	at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:223)
	... 16 more
Caused by: org.osgi.framework.BundleException: Error starting module. osgi.identity; type="osgi.bundle"; version:Version="1.34.0.202402160803"; osgi.identity="org.eclipse.jdt.ls.core"; singleton:="true" [id=55]
	at org.eclipse.osgi.container.Module.doStart(Module.java:648)
	at org.eclipse.osgi.container.Module.start(Module.java:498)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:528)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
	... 25 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jdt/core/WorkingCopyOwner
	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
	at java.base/java.lang.Class.getConstructor0(Unknown Source)
	at java.base/java.lang.Class.getConstructor(Unknown Source)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:815)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:761)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1057)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:387)
	at org.eclipse.osgi.container.Module.doStart(Module.java:639)
	... 28 more
Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.jdt.core (48).
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:134)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:620)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:348)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:414)
	at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:41)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:516)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:434)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:174)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
	at java.base/java.lang.Class.getConstructor0(Unknown Source)
	at java.base/java.lang.Class.getConstructor(Unknown Source)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:815)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:761)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1057)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:387)
	at org.eclipse.osgi.container.Module.doStart(Module.java:639)
	at org.eclipse.osgi.container.Module.start(Module.java:498)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel$2.run(ModuleContainer.java:2069)
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor$1$1.execute(EquinoxContainerAdaptor.java:143)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2060)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:2002)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1963)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1879)
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:341)
Caused by: org.osgi.framework.BundleException: Error starting module. osgi.identity; type="osgi.bundle"; version:Version="3.37.0.v20240206-1609"; osgi.identity="org.eclipse.jdt.core"; singleton:="true" [id=48]
	at org.eclipse.osgi.container.Module.doStart(Module.java:648)
	at org.eclipse.osgi.container.Module.start(Module.java:498)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:528)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
	... 27 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/core/resources/IWorkspaceRunnable
	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
	at java.base/java.lang.Class.getConstructor0(Unknown Source)
	at java.base/java.lang.Class.getConstructor(Unknown Source)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:815)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:761)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1057)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:387)
	at org.eclipse.osgi.container.Module.doStart(Module.java:639)
	... 30 more
Caused by: java.lang.ClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.core.resources (29).
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:134)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:620)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:348)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:414)
	at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:41)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass0(BundleLoader.java:516)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:434)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:174)
	at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
	... 39 more
Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.core.resources.ResourcesPlugin.start() of bundle org.eclipse.core.resources.
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:854)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:775)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1057)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:387)
	at org.eclipse.osgi.container.Module.doStart(Module.java:639)
	at org.eclipse.osgi.container.Module.start(Module.java:498)
	at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:528)
	at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:122)
	... 47 more
Caused by: org.eclipse.core.internal.dtree.ObjectNotFoundException: Tree element '/jdt.ls-java-project/.project' not found.
	at org.eclipse.core.internal.dtree.AbstractDataTree.handleNotFound(AbstractDataTree.java:183)
	at org.eclipse.core.internal.dtree.DeltaDataTree.getData(DeltaDataTree.java:572)
	at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:54)
	at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:51)
	at org.eclipse.core.internal.dtree.DataDeltaNode.asBackwardDelta(DataDeltaNode.java:51)
	at org.eclipse.core.internal.dtree.DeltaDataTree.asBackwardDelta(DeltaDataTree.java:96)
	at org.eclipse.core.internal.dtree.DeltaDataTree.reroot(DeltaDataTree.java:809)
	at org.eclipse.core.internal.dtree.DeltaDataTree.reroot(DeltaDataTree.java:808)
	at org.eclipse.core.internal.dtree.DeltaDataTree.reroot(DeltaDataTree.java:785)
	at org.eclipse.core.internal.watson.ElementTree.immutable(ElementTree.java:540)
	at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:796)
	at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1615)
	at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2615)
	at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2319)
	at org.eclipse.core.resources.ResourcesPlugin$WorkspaceInitCustomizer.addingService(ResourcesPlugin.java:571)
	at org.eclipse.core.resources.ResourcesPlugin$WorkspaceInitCustomizer.addingService(ResourcesPlugin.java:1)
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:947)
	at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
	at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:257)
	at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:324)
	at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:267)
	at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:545)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:833)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$2.run(BundleContextImpl.java:1)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:825)
	... 54 more

Rename project & repo from "bazel-vscode" to (something like) "bazel-vscode-java"

Perhaps what this project & repo really are would be clearer if you considered renaming it from "bazel-vscode" to (something like) "bazel-vscode-java"?

GitHub's automated redirects are pretty good, so I wouldn't worry too much about breaking existing links. (It even works both for HTTP and for git clone with the git protocol as far as I remember.)

@guw

How to disable JDT _"Discouraged access"_ warnings?

I'm adding a new Maven library (https://rdf4j.org) to https://github.com/enola-dev/enola, and VSC is showing warnings like:

Discouraged access: The type 'IRI' is not API (restriction on required library '/home/vorburger/.cache/bazel/_bazel_vorburger/a3cf8df34f0c7a76e9926daaad9ffbf4/execroot/_main/bazel-out/k8-fastbuild/bin/external/maven/org/eclipse/rdf4j/rdf4j-model-api/5.0.0-M2/processed_rdf4j-model-api-5.0.0-M2.jar')

for every type I'm using anywhere for that library... which isn't strictly blocking - but fairly "ugly" (to my eyes, at least).

How do we configure Eclipse JDT settings with this extension, to set this particular warning to ignore everywhere? (Like one used to be able to do in Eclipse, somewhere.)

Researching this a bit, I've stumbled upon e.g. https://stackoverflow.com/a/54504776/421602 - could there be an equivalent in settings.json?

Or is there some way to configure JDT "Workspace Preferences" for vscode-java "globally" from settings.json?

@guw

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.