LuaLS / LuaLS/vscode-lua

Fix Indent affecting lines incorrectly

Open
#169 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
215
Forks
62
PR merge metrics
No merged PRs in 30d

Description

### 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_

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported behavior in the VSCode Lua extension with Fix Indent enabled: break before an argument in a Lua function call and compare it with a multiline string. Trace the indentation handling entry point and add coverage for both cases; done means arguments remain indented while string continuation is not incorrectly indented.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.