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
@Umckgil I don't know if you've resolved your issue, but if not: I see you have explicitly set the formatter as being the language server ("formatter": "language_server"), but have you also overridden the language server default formatting configuration (format.defaultConfig.indent_style / indent_size / tab_width / continuation_indent / etc.)?
As I see in your gifs that it seems to autoformat with 4 spaces, which is LuaLS' (actually, EmmyLuaCodeStyle's) default formatting.
Ah understood, it seems there are two different things at play here:
Regarding the wrong indent size when setting "tab_size": 3 and "formatter": "language_server", as per the 2nd gif in your initial post: try putting this in your .luarc.json (or settings file) so that it matches the 3-char space indent defined in Zed
Regarding the initial wrong indent for else/elseif (indented) and for the first line after (not indented): that's weird indeed and I have the same issue, I would say this has to do with the extension tree-sitter queries managing indents.
Activity
yeskunall commentedon Jan 8, 2026
@Umckgil acknowledging your message on Plain. Feel free to ping me here once you have the GIFs ready and I’ll be happy to take a look at this issue.
Fringale commentedon Feb 26, 2026
@Umckgil I don't know if you've resolved your issue, but if not: I see you have explicitly set the formatter as being the language server (
"formatter": "language_server"), but have you also overridden the language server default formatting configuration (format.defaultConfig.indent_style/indent_size/tab_width/continuation_indent/ etc.)?As I see in your gifs that it seems to autoformat with 4 spaces, which is LuaLS' (actually, EmmyLuaCodeStyle's) default formatting.
For reference:
Umckgil commentedon Feb 26, 2026
hi @Fringale, yes most of the issues resolve if 4 spaces is used, thats what I did as a workaround.
however auto indentation in conditional statements is still distracting:

I tried modifying defaultConfig values in .luarc.json, no luck. please note that this behavior wasn't always like this.
Fringale commentedon Feb 26, 2026
Ah understood, it seems there are two different things at play here:
"tab_size": 3and"formatter": "language_server", as per the 2nd gif in your initial post: try putting this in your .luarc.json (or settings file) so that it matches the 3-char space indent defined in ZedUmckgil commentedon Feb 26, 2026
thanks yeah that does solve the 3 sized indent issue.
for the auto indentation issues, I tried to play around with indents.scm but couldnt improve.
Fringale commentedon Mar 1, 2026
I opened PR #42 to fix the
elseif/elseindentation issue.Umckgil commentedon Mar 1, 2026
thanks. tested it. seems resolve it at least for me
Fix elseif / else indentation and support incomplete structures (#42)