redhat-developer / redhat-developer/vscode-java

Quick fixes do not provide good support for readonly files

Abierto
#4,275 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

enhancement
Lenguaje dominante
TypeScript
Estrellas
2.3k
Forks
546
Merge medio
20 h 1 min
PR fusionados (30 d)
11

Descripción

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.
Image

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.
Image

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:

  1. 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
  2. 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.
Image Image
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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza rastreando el menú Quick Fix y el manejo del language server para los archivos que coincidan con la configuración files.readonlyInclude de VS Code. Reproduce tanto el caso en el que el archivo no está abierto como el caso en el que está abierto en el editor; después, verifica que las correcciones para archivos de solo lectura estén ocultas o deshabilitadas, explica por qué no pueden ejecutarse y asegúrate de que nunca queden cambios únicamente en memoria.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java, typescript, vscode
Área
developer-experience, tooling
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.