LuaLS / LuaLS/vscode-lua

Fix Indent affecting lines incorrectly

Offen
#169 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
215
Forks
62
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Which OS are you using?

Windows

### Expected Behaviour

Writing `local ret = Button:new(text, x, y)` and then putting in a new line before text, to change the arguments to a vertical list, un-indents at text. That is, the result is
```
Button:new(
text, x, y)
```

### Actual Behaviour

The result should be
```
Button:new(
text, x, y)
```

### Reproduction steps

- Write a function with an argument
- Break before the argument

### Additional Notes

The behaviour is as expected if Fix Indent is off. However I believe the point is for other cases like strings, to get
```
"I went to a function
the other day"
```

and not

```
"I went to a function
the other day"
```

I'm not exactly sure what the point of the option is. I assume it doesn't apply to every time vscode indents code, but I think the set it's supposed to apply to probably shouldn't apply to the function(arg) case.

### Log

_No response_

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

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, das gemeldete Verhalten in der VSCode Lua extension mit aktiviertem Fix Indent zu reproduzieren: Füge vor einem Argument in einem Lua-Funktionsaufruf einen Zeilenumbruch ein und vergleiche dies mit einem mehrzeiligen String. Verfolge den Einstiegspunkt der Einrückungsbehandlung und füge Abdeckung für beide Fälle hinzu; erledigt ist die Aufgabe, wenn Argumente weiterhin eingerückt bleiben, während die String-Fortsetzung nicht fälschlicherweise eingerückt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
lua, typescript
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 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.