-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Formatter preview #960
Comments
@sumneko in 2.6.5 the formatter worked but now it doesn't anymore. Did something change? Do I need to do anything to make it work again? |
The formatter still has a lot of issues to fix, so I disabled it in 2.6.6. |
I noticed that |
怎么配置格式化,?我建了 "Lua.format.defaultConfig": {
"continuous_assign_statement_align_to_equal_sign": false
}, |
2.6.6 版本只支持从 |
好的 😄 |
Any thoughts on adding support for alternative formatter in the future? I believe a lot of the neovim community has coalesced around stylua so it would be nice to see some support for that eventually. |
AFAIK, StyLua dose not support Lua 5.4. |
Published in 3.0.0 |
Version 2.6.6 integrates formatter.
The formatter is still in development and looking forward to your feedback!
How to enable
The formatter can be enabled by adding the parameter
--preview
to the command line parameters.For VSCode, add this parameter in the
Lua.misc.parameters
setting.how to use
The formatter provides two functions: "format document" and "format selected range".
For VSCode users, you can find thease features in the right-click menu.
In addition, VSCode can also enable
Format On Paste
andFormat On Save
in the settings.Note that the
Format On Type
feature is currently provided by this language server, not by the formatter.The formatter also provides the
Code style check
feature, but it is disabled by default. To enable it, please set:How to configure
Please read the wiki https://github.com/sumneko/lua-language-server/wiki/Code-Reformat
How to give feedback
If you have any suggestions or bug reports about the formatter, please open issues in https://github.com/CppCXY/EmmyLuaCodeStyle/issues
Other
In fact, I didn't plan to add the formatting feature before.
Lua5.1
toLua5.4
(andLuaJIT
) and can run on multiple platforms. These issues also need to be addressed if integrating third-party formatters, especially cross-platform compilation issues.Fortunately, this PR took the initiative to help me solve
1
and4
, so I decided to integrate it in the new version.I've raised dozens of issues after trying out this formatting tool, so if you have any suggestions or report, please feel free to feedback.
The text was updated successfully, but these errors were encountered: