redhat-developer / redhat-developer/vscode-java
Quick fixes do not provide good support for readonly files
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
Description of issue
The Quick Fix menu in VS Code provides several options to fix common compiler errors, such as creating a missing method in a class.
However, this menu can be misleading for users when the affected files are marked as readonly in VS Code using the files.readonlyInclude workspace setting.
When a file is marked readonly, a Quick Fix option may still be presented to add a method or other class member to it. Selecting that option seems to have a couple of different possible behaviors:
- If the file is not open in an editor tab, the Quick Fix operation has no effect but presents no message to the user explaining why
- If the file is open in an editor tab, the Quick Fix operation will seem to apply the requested change, and the language server receives updated content for the file (meaning the red squiggle goes away). However, the updated content is not actually written to disk. Builds will fail with compilation errors. If the editor tab is closed, then the language server will refresh from the file on-disk and the red squiggle will return. Even though the changes are in-memory-only, the file does not show the white circle on the tab header indicating unsaved changes.
Requested change
Change to a more intuitive behavior for the Quick Fix options:
- Hide (or gray out) any Quick Fix options that would require changes to readonly files
- Present a popup message to the user after the Quick Fix is selected explaining that it can't be used on readonly files
At the least, the Quick Fix should not make in-memory-only changes.
Software versions
VS Code: Tested on both 1.96.2 and 1.106.3
Java Extension: 1.50.0
OS: MacOS 15.6.1
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
Commencez par suivre le menu Quick Fix et la gestion par le language server des fichiers correspondant au paramètre files.readonlyInclude de VS Code. Reproduisez les cas où le fichier n’est pas ouvert et où il est ouvert dans l’éditeur, puis vérifiez que les corrections pour les fichiers en lecture seule sont masquées ou désactivées, expliquez pourquoi elles ne peuvent pas être exécutées et veillez à ne jamais laisser de modifications uniquement en mémoire.
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
- 42/100