redhat-developer / redhat-developer/vscode-java

Problems with (I think) the language server and maven cross-project dependencies

Aperta
#1,567 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
TypeScript
Stelle
2.3k
Fork
546
Merge medio
20h 1m
PR unite (30g)
11

Descrizione

This is possibly a PEBCAK or user-ignorance issue.

I work with several Maven projects.
I have project A and project B open in separate VSCOde workspaces. Project B has multiple sub-projects

A subproject of Project B builds a JAR that is a maven dependency in project A.

Project B is quite large. Project A is small (but all are spring boot so there's quite a lot of cruft around).

If in project B I make some change (say, add a method to a class) and "mvn install", then the VSCode doesn't pick up the change in project A. The new method isn't visible.

Java: refresh, Java: force compilation, java: update project configuration don't fix this.
Java: clean the language server workspace sometimes fixes it, but not always. And takes an age so I don't want to be doing this.

The dependencies are all correct as far as Maven is concerned, as a command-line "mvn install" (for example) of Project A succeeds, including the code that calls the new method

Existing the VSCode for Project A and restarting does seem to work, so it looks like some sort of refresh/caching issue

How am I supposed to set things up for this case? (one maven project depending on the artefact of another)?

I've tried adding Project B as a folder to the workspace of Project A - but the LSP seems to have issues with that (I previously reported a non-reproducable bug were @Test run/debug no longer appeared, and when I tried it as a work around for this, I lost the semantic highlighting etc, (I think - the import statements weren't green but white, as they are while the LSP workspace is loading when first opening the workspace).

If I can provide more info/logs etc, please let me know what is needed.

Environment
  • Operating System: Windows 10
  • JDK version: VSCode says current version is JDK11
  • Visual Studio Code version: 1.47
  • Java extension version: MS Java 0.9.1, Redhat 0.65.0
Steps To Reproduce

Please see description above, I don't have a small test case. Sorry

[Please attach a sample project reproducing the error]
Proprietary code. I can't.
Please attach logs

Current Result
Expected Result
Additional Informations

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Non vengono forniti alcun file sorgente, test o piccola riproduzione. Inizia seguendo lo scenario Maven con due workspace dell'issue su Windows, usando le versioni di Java e dell'estensione elencate, quindi abilita i language-server logs tramite la guida di troubleshooting collegata. Il lavoro è completato quando le modifiche installate da Project B diventano visibili in Project A senza riavviare VS Code o pulire il workspace del language server.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, vscode
Ambito
build-system, developer-experience, tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.