microsoft / microsoft/TypeScript
Incorrect (potentially) indentation of function arguments spanning multiple lines
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riproduci i casi di formattazione JavaScript o TypeScript riportati nell'issue, confrontando l'indentazione automatica con l'output previsto con argomenti allineati e con la successiva indentazione del corpo. Poiché non sono indicati né un file sorgente, né un test, né un entry point, individua il percorso del formatter prima di definire il completamento come formattazione corretta per entrambi gli esempi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, typescript
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100