redhat-developer / redhat-developer/vscode-java

Unable to add external jar to work with LSP

Open
#3,912 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in VS Code using a Java project without Maven or Gradle and the java.project.referencedLibraries setting, then trace how referenced JAR classes are handled for syntax highlighting. Done means classes and methods from those JARs receive syntax highlighting while completion and documentation continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.