redhat-developer / redhat-developer/vscode-java
"Add throws declaration" formats entire file
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.3k
- Forks
- 546
- Ø Merge
- 20 Std. 1 Min.
- Gemergte PRs (30 T.)
- 11
Beschreibung
When you use the "Add throws declaration" it formats the entire file instead of just adding the throws clause to the current function.
Environment
- Operating System: Windows 10
- JDK version: openjdk 11.0.4 2019-07-16
- Visual Studio Code version: 1.38.1
- Java extension version: 0.50.0
Steps To Reproduce
-
Create a java file start writing some code and have it not match the default formatter. (like indenting case under a switch)
-
write a function that calls a function that throws a checked exception (like CompletableFuture.get)
-
Use the suggestion to add throws declarations to the current function.
Current Result
Throws declarations are added but the entire file gets formatted
Expected Result
only the throws declarations should be added to the current function and the rest of the file is untouched.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Suggestion Add throws declaration in einer Java-Datei mit einer von der Standardformatierung abweichenden Formatierung und einem Aufruf wie CompletableFuture.get zu reproduzieren. Verfolge die Pfade der Suggestion und des Formatierers, um festzustellen, warum die Formatierung ausgelöst wird; als abgeschlossen gilt dies, wenn nur die aktuelle Funktion ihre throws declaration erhält und der Rest der Datei unverändert bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, typescript
- Bereich
- developer-experience, tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 42/100