LuaLS / LuaLS/vscode-lua

Fix Indent affecting lines incorrectly

未关闭
#169 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
215
派生
62
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,在启用 Fix Indent 的 VSCode Lua extension 中重现报告的行为:在 Lua 函数调用中的参数前换行,并将其与多行字符串进行比较。跟踪缩进处理的入口点,并为这两种情况添加覆盖;完成的标准是参数仍保持缩进,而字符串续行不会被错误地缩进。

由索引模型根据 Issue 内容生成。

评估

技术栈
lua, typescript
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。