microsoft / microsoft/TypeScript
Incorrect (potentially) indentation of function arguments spanning multiple lines
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
From @nomaed on October 14, 2016 10:40
- VSCode Version: 1.6.1
- OS Version: macOS Sierra 10.12
Steps to Reproduce:
- Write a function (or a method) with several arguments (I did it with JavaScript and TypeScript files, but I believe any would work).
function myFunc(arg1, arg2, arg3, ...args) {
}
- Split arguments to several lines by hitting Enter before arguments
function myFunc(arg1,
arg2,
arg3,
...args) {
}
Auto-formatting produces this result:
function myFunc(arg1,
arg2,
arg3,
...args) {
}
I would expect to see this result instead though:
function myFunc(arg1,
arg2,
arg3,
...args) {
}
Also, when manually formatting the arguments to appear in the same column (note: this is also the default/recommended setting in tslint and maybe other linters), then further lines will start with wrong indentation:
function myFunc(arg1,
arg2,
arg3,
...args) {
console.log('huh...');
}

Copied from original issue: Microsoft/vscode#13748
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
Reproduziere die JavaScript- oder TypeScript-Formatierungsfälle aus dem Issue und vergleiche die automatische Einrückung mit der erwarteten Ausgabe mit ausgerichteten Argumenten sowie der anschließenden Einrückung des Rumpfs. Da keine Quelldatei, kein Test und kein Einstiegspunkt genannt wird, ermittle zunächst den Formatter-Pfad, bevor du den Abschluss als korrigierte Formatierung für beide Beispiele definierst.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100