redhat-developer / redhat-developer/vscode-java

Provide a way to let Formatter profile settings take precedence over VS Code's

Offen
#672 5 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

enhancement formatter
Vorherrschende Sprache
TypeScript
Sterne
2.3k
Forks
546
Ø Merge
20 Std. 1 Min.
Gemergte PRs (30 T.)
11

Beschreibung

I have a configured formatter profile which has, among others, the following property:

<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>

If I go to a file and change, using the the option on the bottom right of VSCode to use a different attribute (ex.: space: 8) to code automatically formats to that selection, ignoring the formatted profile.

The problem is that after doing that, the formatter option for tabulations stop working. There should be a way to force format according the formatter profile, or to remove these individual file formatter options. Right now, I have some files where I pressed this and I don't know which ones, and can't force them to be formatted properly

Environment
  • Operating System: Windows 10 Pro
  • JDK version: 1.8.0_172
  • Visual Studio Code version: 1.28.0
  • Java extension version: 0.32
Steps To Reproduce
  1. Create and apply a formatter profile with tabulation char TAB and size: 4
  2. Open .java file and format it. It applies this profile format
  3. Using VSCode bottom right menu, change tabulation char and size. Ex.: SPACE and size: 8. The file applies this profile format.
  4. Now you can't change this specific file to apply the profile configured tabulation char and size.
Current Result

The project applies to manually selected configuration. Can't revert to use profile format.

Expected

One of the following:

  • Allow to format all project according to profile formatter
  • Force format a single file to apply profile formatter
  • Ignore profile formatter for a list of files (but this needs to be visible/editable on settings)

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Änderungen an formatter-profile und der Formatierung unten rechts in VS Code in einer .java-Datei in der Java-Erweiterung zu reproduzieren. Verfolge, wie die ausgewählte Formatierungsoption pro Datei das Profil überschreibt; abgeschlossen ist die Aufgabe, wenn Benutzer die Formatierung des Profils für eine Datei oder das Projekt wiederherstellen oder erzwingen können und die aktiven Überschreibungen sichtbar oder bearbeitbar sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, typescript, vscode
Bereich
developer-experience, tooling
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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