代码格式化后数组无法正常折叠
Closed this issue · 7 comments
abgox commented
RaptorX commented
If I remember right, that is a VSCode problem. It creates folding points based on indentation.
I think the extension would have to force create folding points in certain spots.
thqby commented
No, code folding can be set to be provided by the extension. When there are multiple fold points on the same line, vscode should use the first one.
abgox commented
- 可不可以让扩展在格式化代码时,就格式化为以下样式呢?这样 vscode 也能根据缩进创建合理的折叠点
list := [
{
name: 1,
age: 2
},
{
name: 2,
age: 3
}
]
- 现在,扩展会格式化为以下样式
list := [{
name: 1,
age: 2
}, {
name: 2,
age: 3
}
]
- 直接让代码格式化改变一个风格可能会导致喜欢原有风格的人无法接受,所以添加一个扩展配置来控制它可能是一个不错的选择
abgox commented
thqby commented
设置格式化选项中的array_style。
下一种声明,去掉,
。一般用缩进表示声明的层级
abgox commented
thqby commented
如果缩进异常那就是bug
实测在v2中性能提升不大,甚至略慢