You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It can be invoked via vim.lsp.buf.format() and has a command line tool CodeFormat.
Why
The stylua nvim plugin is finicky and outdated. It is a barrier to entry for devs who usually end up using style and style-fix, often not seeing style issues until CI, which is not run for first time contributors.
Differences
List, table and comment formatting is more readable:
localWATCHED_FILES= {
"FETCH_HEAD", -- remote ref"HEAD", -- local ref"HEAD.lock", -- HEAD will not always be updated e.g. revert"config", -- user config"index", -- staging area
}
call_parentheses = "None" cannot be implemented, as per stylua single table/string argument with no following call. Always using parenthesis (needs 1.5.4) results in more readable code. This only really affects require calls.
Formatting may only be disabled via comment, not re-enabled.
space_before_closure_open_parenthesis = true (default) looks a little more readable, however it's not really the lua standard.
How
Do this when there are no outstanding large PRs.
.editorconfig is used with extensions. It's automatically picked up by nvim, and must be specified on the CLI.
Add to .editorconfig, changes to defaults only
Move default_on_attach to the end, prepending ---@format disable
CodeFormat format -w lua -c .editorconfig
Remove stylua
Update Makefile
Commit and merge
Update Doc
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
What
EmmyLuaCodeStyle is the built in formatter for lua-language-server: https://luals.github.io/wiki/settings/#format
It can be invoked via
vim.lsp.buf.format()
and has a command line toolCodeFormat
.Why
The stylua nvim plugin is finicky and outdated. It is a barrier to entry for devs who usually end up using
style
andstyle-fix
, often not seeing style issues until CI, which is not run for first time contributors.Differences
List, table and comment formatting is more readable:
call_parentheses = "None"
cannot be implemented, as per stylua single table/string argument with no following call. Always using parenthesis (needs 1.5.4) results in more readable code. This only really affectsrequire
calls.Formatting may only be disabled via comment, not re-enabled.
space_before_closure_open_parenthesis = true
(default) looks a little more readable, however it's not really the lua standard.How
Do this when there are no outstanding large PRs.
.editorconfig
is used with extensions. It's automatically picked up by nvim, and must be specified on the CLI..editorconfig
, changes to defaults onlydefault_on_attach
to the end, prepending---@format disable
CodeFormat format -w lua -c .editorconfig
The text was updated successfully, but these errors were encountered: