LuaLS / lua-language-server

A language server that offers Lua language support - programmed in Lua
https://luals.github.io
MIT License
3.12k stars 289 forks source link

New line triggered replace tab indent to spaces #2689

Open d-enk opened 1 month ago

d-enk commented 1 month ago

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Linux

What is the issue affecting?

Formatting

Expected Behaviour

do nothing

Actual Behaviour

tab indent replaced to spaces

Reproduction steps

add new line

Peek 2024-05-31 15-21

Additional Notes

configuration has no effect

"Lua.format.enable": false,
"Lua.format.defaultConfig": {
  "indent_style": "tab"
},

Log File

No response

CppCXY commented 1 month ago

This feature is format on type, which is based on what vscode thinks is the indentation of the current file.

d-enk commented 1 month ago

yeap, Lua.typeFormat.config.format_line: "false" disables this, thank

d-enk commented 1 month ago

Nevertheless Select indentation has no effect

d-enk commented 1 month ago

also, looks like need a Lua.typeFormat.enable option

CppCXY commented 1 month ago

this is vscode basic config image

d-enk commented 1 month ago

But what if I don’t want to disable this for another lua formatter?

CppCXY commented 1 month ago

No other lua plugin supports type format.

CppCXY commented 1 month ago

emmyluacodestyle is lua's only fully functional formatter with vscode support.

d-enk commented 1 month ago

hm, i use stylua or what you mean by 'fully functional'?

CppCXY commented 1 month ago

hm, i use stylua or what you mean by 'fully functional'?

It's good to use stylua, so my explanation doesn't matter.