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
{{ message }}
Repository navigation
New line triggered replace tab indent to spaces #2689
See this also on emacs using lsp-mode. Looking at the trace from the logs emacs is sending the following options in the textdocument/onTypeFormatting message:
These options get ignored and the server always responds by reformatting one or more proceeding lines using an indent level of 4 characters and indenting with spaces despite me having the following settings in my .editorconfig
I'm not 100% sure if this is always the case but this problem manifests most noticably when the lines being reformatted are actually already correctly indented. In other cases I think the server returns the correct formatting adjustment.
Activity
[-]New line trigger replace tab indent to spaces[/-][+]New line triggered replace tab indent to spaces[/+]CppCXY commentedon May 31, 2024
This feature is format on type, which is based on what vscode thinks is the indentation of the current file.
d-enk commentedon May 31, 2024
yeap,
Lua.typeFormat.config.format_line: "false"disables this, thank
d-enk commentedon May 31, 2024
Nevertheless
Select indentationhas no effectd-enk commentedon May 31, 2024
also, looks like need a
Lua.typeFormat.enableoptionCppCXY commentedon May 31, 2024
this is vscode basic config

d-enk commentedon May 31, 2024
But what if I don’t want to disable this for another lua formatter?
CppCXY commentedon May 31, 2024
No other lua plugin supports type format.
CppCXY commentedon May 31, 2024
emmyluacodestyle is lua's only fully functional formatter with vscode support.
d-enk commentedon May 31, 2024
hm, i use stylua
or what you mean by 'fully functional'?
CppCXY commentedon May 31, 2024
It's good to use stylua, so my explanation doesn't matter.
mpumford commentedon Oct 14, 2025
See this also on emacs using lsp-mode. Looking at the trace from the logs emacs is sending the following options in the
textdocument/onTypeFormattingmessage:These options get ignored and the server always responds by reformatting one or more proceeding lines using an indent level of 4 characters and indenting with spaces despite me having the following settings in my
.editorconfigHeres an example full message (with the filename elided)
I'm not 100% sure if this is always the case but this problem manifests most noticably when the lines being reformatted are actually already correctly indented. In other cases I think the server returns the correct formatting adjustment.