vscode-lua-format
vscode-lua-format copied to clipboard
Format doesn't find .lua-format files unless config setting points to one
The program will attempt to automatically use the current directory's .lua-format file if no config file is passed in the command line. If none is found, it will try to locate a .lua-format file in a parent directory recursively.
Using the format extension this does not seem to be the case. I believe the fault lies in either not passing the file path or cwd in spawn options
Correctly passing the cwd should allow it to pick the correct .lua-format file without having to add the setting.
I have same question, any solution?
I ran into this issue as well, and submitted a PR that should fix it: https://github.com/Koihik/vscode-lua-format/pull/31
Unfortunately, it only works if .lua-format
is in the same directory as lua files. It doesn't work when .lua-format
is put in the root of a project, and lua files are spitted into multiple directories.
Maybe it is because that bin\...\lua-format
is just too old.
For me it looks like there was a problem with the config file I supplied. I took it from the README file in github: https://github.com/Koihik/LuaFormatter
But if I use the binary which was installed with the vscode extension and run it using: lua-formater.exe --dump--config, there was a small different between the two:
column_table_limit: column_limit (the one in doc) column_table_limit: 80 (the one I dumped)
basically replacing that column_limit
with your favorite number made it work for me.
Cheers.