java.project.sourcePaths Setting Fails to Exclude Test Directory from References and Call Hierarchy
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- java, vscode
- Ambito
- developer-experience, tooling
Direzione di ricerca
Inizia riproducendo il problema in un progetto Java in stile Maven con src/main/java e src/test/java, usando java.project.sourcePaths in settings.json. Confronta i risultati di Find All References e Call Hierarchy dopo aver eseguito Java: Clean Language Server Workspace con la vista Java Projects; il lavoro è completato quando le directory non specificate, come src/test/java, vengono escluse in modo coerente. Nell’issue non sono identificati file del repository né test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Describe the bug
When configuring the java.project.sourcePaths setting in settings.json to exclude the test directory (e.g., src/test/java) from being indexed, the "Find All References" and "Call Hierarchy" features still include results from the test directory. This persists even after cleaning the language server workspace and restarting VS Code.
To Reproduce
Steps to reproduce the behavior:
Open a Java project in VS Code (e.g., a Maven project with src/main/java and src/test/java).
Add the following to settings.json (workspace scope):
json
Wrap
Copy
{
"java.project.sourcePaths": ["src/main/java"]
}
Run Java: Clean Language Server Workspace and restart VS Code.
Right-click a class in src/main/java and select "Find All References" or "Call Hierarchy."
Observe that references from src/test/java are still included in the results.
Expected behavior
The java.project.sourcePaths setting should limit the scope of "Find All References" and "Call Hierarchy" to only the specified directories (e.g., src/main/java), excluding src/test/java.
Actual behavior
References and call hierarchy results still include files from src/test/java, despite the java.project.sourcePaths configuration.
Environment
OS: [e.g., Windows 11, macOS 14, Ubuntu 22.04]
VS Code version: [e.g., 1.87.0]
Java extension version: [e.g., redhat.java v1.XX.X]
JDK version: [e.g., OpenJDK 17]
Project type: [e.g., Maven, Gradle, or plain Java project]
Additional context
No .classpath file exists in the project.
Cleaning the language server cache (Java: Clean Language Server Workspace) and manually deleting the cache folder (e.g., ~/.vscode/extensions/redhat.java-/server/data) did not resolve the issue.
The project structure is standard (e.g., src/main/java for source, src/test/java for tests).
Possible workaround
Manually removing src/test/java from the source path via the "Java Projects" view works temporarily, but this is not a persistent solution across sessions.
Suggested fix
Ensure the java.project.sourcePaths setting is respected by the language server when generating references and call hierarchy, excluding unspecified directories like src/test/java.
- Lingua principale
- TypeScript
- Stelle
- 352
- Fork
- 166
- Merge medio
- 17h 47m
- PR unite (30g)
- 32
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/vscode-java-pack
-
Memory Leak in Linux Apertaai-triaged bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
microsoft/vscode-java-pack#1543 · 8 commenti · 4 reazioni ·
-
ai-triaged bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
microsoft/vscode-java-pack#1443 · 1 commento · 2 reazioni ·
-
ai-triaged bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
microsoft/vscode-java-pack#1425 · 1 commento ·
-
ai-triaged enhancement feature-request
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
microsoft/vscode-java-pack#1423 · 2 commenti · 1 reazione ·
-
ai-triaged area/jdtls bug needs-investigation
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
microsoft/vscode-java-pack#1420 · 1 commento ·
Tutte le issue di microsoft/vscode-java-pack
Issue simili
-
comp/desktop P3 type/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
NousResearch/hermes-agent#118866 ·
-
Browser Waiting for: Product Owner
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
getsentry/sentry-javascript#24577 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
agilepathway/label-checker#640 ·
-
Plugin stuck at "loading" on DSH 0.1.6-alpha.2 — turnTail list slot registration missing options.id Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
Add 2021 Cup data to website Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
chrisparsons83/flexspotff#153 ·