redhat-developer / redhat-developer/vscode-java
Annotation processing causes spurious reporting in Problem pane
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 2.3k
- Forks
- 546
- Merge moyen
- 20 h 1 min
- PR mergées (30 j)
- 11
Description
Environment
- Operating System: Ubuntu Focal 20.04.6
- JDK version: 17.0.7
- Visual Studio Code version: 1.82.2
- Extensions:
- vscjava.vscode-java-pack 0.25.14
- vscjava.vscode-java-debug 0.54.0
- redhat.java 1.22.1
- vscjava.vscode-maven 0.42.0
- vscjava.vscode-java-dependency 0.23.1
- vscjava.vscode-java-test 0.39.1
Steps To Reproduce
- Unzip the attached project.zip file into an otherwise empty directory
- Start
code bug.code-workspace - Ensure that a text editor is not open for Foo.java
- Click that you trust the author of this workspace (to enable debugging)
- Observe that no problems are reported in the Problems pane
- Open the file src/test/java/com/example/QuxTest.java from the Explorer pane
- Right-click the triangular play icon next to
public class QuxTest - Choose Debug Test from the context menu
- Notice that a problem appear in the Problems pane for file Foo.java:
"The method b() is undefined for the type Mumble" - Click on the problem to open file src/main/java/com/example/Foo.java
- Notice that the problem disappears by itself as the editor for Foo.java opens
- Close the editor for Foo.java
- Exit VSCode
- Restart VSCode, as in point 1.
- Observe that the problem reappears in the Problem pane, this time without opening the debugger.
Current Result:
A problem is reported for the class used in an annotation.
Expected Result:
No problems should be reported.
Additional Informations:
I reckon that this problem is related to annotation processing inserting stubs for the depended-on classes, and then these stubs aren't resolved properly. It started to appear related to the debugger a couple of minor versions ago, but from 1.82.2 it also happens every time the project is loaded, after it has been triggered by the debugger initially.
@testforstephen In microsoft/vscode-java-debug issue #1247 you asked for a minimal example. This looks a lot like it is related, so maybe this could be used?
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Extrayez project.zip et suivez la reproduction numérotée de VS Code, en comparant les diagnostics de Problems-pane avant et après Debug Test ainsi qu’après le redémarrage. Utilisez Foo.java et QuxTest.java comme cas minimal ; c’est terminé lorsque la classe utilisée par l’annotation ne produit plus le problème « method b() is undefined for the type Mumble » dans aucun des deux flux.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- java, typescript, vscode
- Domaine
- developer-experience, tooling
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100