Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type format 在键入换行时补全表项的逗号 #1491

Merged
merged 2 commits into from
Aug 24, 2022

Conversation

CppCXY
Copy link
Collaborator

@CppCXY CppCXY commented Aug 23, 2022

该功能是基于format_line,当表跨行表达时,在最后一个表项后键入 enter会自动填补逗号。
功能的灵感来自于webstorm在编辑json文件时的行为。
那么该项特性有这么几个问题。

  1. 其实现依赖格式化本身的功能,不开format_line无法使用,是否应该独立实现
  2. 该特性会不会造成困扰
  3. 该特性是否应该默认开启?

@sumneko
Copy link
Collaborator

sumneko commented Aug 24, 2022

我很好奇json自动填补逗号是怎么分辨你会不会新建一个新的项目的?还是说发现你把光标挪开后重新把逗号删掉?

@CppCXY
Copy link
Collaborator Author

CppCXY commented Aug 24, 2022

是在json的一行的末尾如果键入换行就会在这一行填补缺失的','当然如果不做任何事,就会保留一个json语法错误在那里

@sumneko
Copy link
Collaborator

sumneko commented Aug 24, 2022

可以先开着我试用一下。

@sumneko sumneko merged commit daf1780 into LuaLS:master Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants