redhat-developer / redhat-developer/vscode-java

Intellisense only works when language server is in LightWeight mode.

Ouverte
#1,807 4 commentaires 3 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

bug classpath ls-error/crash
Langage dominant
TypeScript
Étoiles
2.3k
Forks
546
Merge moyen
20 h 1 min
PR mergées (30 j)
11

Description

Java Intellisense only works when the language server is in LightWeight mode. It breaks immediately every time I swap to Standard mode. (For me, this has been through use of Run/Debug.)

Possibly relevant excerpt from the language server's log:

!ENTRY org.eclipse.jdt.ls.core 4 0 2021-02-16 10:21:35.929
!MESSAGE file:///Users/jahorton/AlphaTiles/AlphaTilesEditor/src/main/java/org/alphatilesapps/alphatiles/data/Word.java does not resolve to a ICompilationUnit

It's definitely part of the project and is compiled as such

Environment
  • Operating System: macOS 10.15.7
  • JDK version: OpenJDK 13.0.1
  • Visual Studio Code version: 1.53.2
  • Java extension version: 0.75.0

Screen Shot 2021-02-16 at 10 09 11 AM

Screen Shot 2021-02-16 at 10 10 03 AM

The latter one (Visual Studio IntelliCode) is part of the Java Extension Pack, which also contains this extension, so I would expect compatibility.

Steps To Reproduce

Just to be explicit, this works for me from a clean reset, for which I do the following:

  1. Hit F1
  2. Java: Clean Java Language Server Workspace (then confirm yes to restart & delete)

After a reset, as long as it does reset to LightWeight mode, Intellisense works normally. Now, for the actual repro:

  1. Select Run/Debug - prompts with text below:

Run/Debug feature requires Java language server to run in Standard mode. Do you want to switch it to Standard mode now?

  1. Select Yes.

Intellisense is now completely broken, only capable of making raw-text suggestions based on common code-strings within the file.

Project experiencing the error: https://github.com/AlphaTiles/AlphaTilesEditor

  • Happens whether or not a launch.json file (for run/debug launch configurations) is present.

A zip of the language server's .log file

A second run

  • This one seemed to have more interesting detail, providing the excerpt seen earlier in this issue.
Current Result

Any use of Run/Debug necessitates a restart of the VS Code client in order to re-enable Intellisense.

Just to be clear, it doesn't matter whether or not the underlying type is from the JavaFX library, which would require an extra extension (see: JavaFX support); it even breaks for the basic String type.

Expected Result

Use of Run/Debug should have no impact whatsoever on Intellisense's ability to work.

Additional Informations

After trying a few more things to see if I could narrow down possible issues... I managed to somehow break the reset. The language server's no longer resetting to LightWeight mode for me, which is really disappointing.

Project details:

  • Uses Gradle to build; is still a normal Java app, not an Android one.
  • Uses JavaFX 11.0.1, which admittedly doesn't perfectly match the environment's JDK. Would prefer to support Java versions as old as 11 if possible, given that 11 is the latest LTS version of the OpenJDK.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par reproduire la réinitialisation d’un espace de travail propre, passer de LightWeight au mode Standard via Run/Debug et examiner les journaux joints du serveur de langage à la recherche de l’échec de résolution de ICompilationUnit. Comparez le comportement avec et sans launch.json dans le projet Gradle lié ; c’est terminé lorsque IntelliSense continue de fonctionner après le changement de mode sans redémarrer VS Code.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java, typescript, vscode
Domaine
developer-experience, devtools
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.