Closed ltWolfik closed 1 year ago
A little off topic, but there's no discussions and I don't want to make a new issue for this.
How do you set up defaultConfig
? I added this to vscode's User/settings.json
:
"Lua.format.defaultConfig": {
"indent_style": "tab",
"tab_width": "4"
}
And it had no effect.
@tomasklaen, maybe conflict with native vscode settings? Like the following:
"[lua]": {
"editor.insertSpaces": false,
"editor.tabSize": 4
},
This is everything inside my [lua]
property:
"[lua]": {
"editor.defaultFormatter": "CppCXY.emmylua-codestyle"
}
Lua.format.defaultConfig
only valid for sumneko lua plugin.
in sumneko, the language server protocol should be respected, so indentation use the parameters of the LSP
see https://github.com/CppCXY/EmmyLuaCodeStyle/issues/22 You may need to use translater
I am using sumneko's lua plugin, but I'm using EmmyLuaCodeStyle to format the code because sumneko's formatter ignores some editorconfig properties.
Is there no way to make these 2 work together?
I've tried adding this to Lua.format.defaultConfig
:
"insertSpaces": "false",
"tabSize": "4",
And this to [lua]
:
"editor.insertSpaces": false,
"editor.tabSize": 4
And again, no effect. Can someone just give me a snippet or some example/documentation somewhere how to configure the default formatting options? 😢
sumneko formatter is my formatter. but my plugin not support Lua.format.defaultConfig
or editor settings. it only read .editorconfig plugin.
You can set the formatter to sumneko lua because that's what I provide
@CppCXY I'm using this one instead of sumneko's on your own recomendation :) So the linked issue has been resolved, and sumneko now reads indentation style from editorconfig instead of user settings?
no, for sumneko, Indentation comes from editor settings, you can set editor setting for indentation
Sumnkeo has already been updated to the latest version, so the functionality is consistent
I've noticed, that
Lua.format.defaultConfig
setting works fine if.editorconfig
absents, but if.editorconfig
exists in project -Lua.format.defaultConfig
does nothing. It seems be better ifLua.format.defaultConfig
would be merged with.editorconfig
(with priority for.editorconfig
). For example, if.editorconfig
does not havekeep_one_space_between_table_and_bracket
option - then use the same one fromLua.format.defaultConfig
(if present).I use the formatter through sumneko LSP in vscode. Thanks a lot.