lua-language-server
lua-language-server copied to clipboard
vscode formatOnType doesnt work
Describe the bug vscode has a handy feature which formats the code as we type, it doesnt seem to work with Lua.
To Reproduce Steps to reproduce the behavior:
- Write any unformatted code in a line
i=0
- press "return" key
- Code is still unformatted.
i=0
Expected behavior Code should be formatted on a "return" key like below, just as it formats with the format(I mean format code manully by selecting it editor.action.formatSelection) option.
i = 0
Environment (please complete the following information):
- OS: Fedora 35
- Client: VSCode
- VSCode Settings:
"editor.formatOnType": true,
"[lua]": {
"editor.defaultFormatter": "sumneko.lua"
},
Additional context
- the same option works with C/C++ code.
- can this be enabled with any other setting? I didnt find any.
- Also None of the Lua formatters out there seem to support this, is there any inherent problem with lua in supporting this?
in sumneko_lua, type-on-format uses sumneko's own function. but the formatter of sumneko lua used, supports type format
Should be supported.