Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Quick fixes do not provide good support for readonly files

Offen
#4,275 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 4 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
java, typescript, vscode

Rechercherichtung

Beginne damit, das Quick Fix-Menü und die Language-Server-Behandlung für Dateien nachzuverfolgen, die auf die VS Code-Einstellung files.readonlyInclude zutreffen. Reproduziere sowohl den Fall mit einer ungeöffneten Datei als auch den Fall mit einer geöffneten Datei im Editor. Überprüfe anschließend, dass Fixes für schreibgeschützte Dateien ausgeblendet oder deaktiviert werden, erkläre, warum sie nicht ausgeführt werden können, und stelle sicher, dass niemals ausschließlich im Speicher vorhandene Änderungen zurückbleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

enhancement
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

Vorherrschende Sprache
TypeScript
Sterne
2.3k
Forks
547
Ø Merge
5 Std. 36 Min.
Gemergte PRs (30 T.)
10

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus redhat-developer/vscode-java

Alle Issues in redhat-developer/vscode-java

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.