-
-
Notifications
You must be signed in to change notification settings - Fork 391
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
MacOS
What is the issue affecting?
Formatting
Expected Behaviour
The next line should be indented with the following code
- example 1
for i = 1, 10 do<enter>- example 2
do
for i = 1, 10 do<enter>Actual Behaviour
The next line indented correctly initially (according to the indentationRules.increaseIndentPattern), but then it get removed by luals's "auto-fix-indent"...
Reproduction steps
- create a new file
- write the code snippet provided above
- then press
enterand observe the behaviour
Additional Notes
I disabled the fix-indent by modifying luals code locally, and this bug stopped. So it's related to the fix-indent function added recently.
I add a do return end here to disable it:
lua-language-server/script/core/fix-indent.lua
Lines 194 to 195 in 01c6b61
| return function (uri, changes) | |
| if not client.getOption('fixIndents') then |
As discussed in here #2786, these new indentation behaviours are somewhat annoying and may not be applicable for all of us. Can this be made as optional please 🥲 ? Say an option which can be turned on/off.
Log File
No response