Skip to content

Unable to add external jar to work with LSP #3912

Open
@keys-i

Description

I'm using Visual Studio Code for a Java project without build tools (e.g., Maven or Gradle). I've added JAR files using the java.project.referencedLibraries setting. While auto-completion and documentation pop-ups work, there is no proper syntax highlighting (LSP-based) for the referenced classes and methods within the JARs.

Steps to Reproduce:

  1. Open a Java project in VS Code.
  2. Add JAR files directly to the java.project.referencedLibraries setting.
  3. Use a class or method from the JAR in your code.

Expected Behavior:

LSP features should include syntax highlighting for classes and methods from the JARs, in addition to auto-completion and documentation pop-ups.

Actual Behavior:

While auto-completion and documentation pop-ups work, syntax highlighting does not apply for the JAR dependencies.

Screenshot:

  • Referencing the JAR:
    Screenshot1
  • Missing syntax highlighting:
    Screenshot2

Additional Context:

This issue occurs in a setup without Maven or Gradle. Are there additional configurations required to enable full syntax highlighting for JAR dependencies?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions