LuaLS / LuaLS/lua-language-server

Unable to turn off continuous align

Open
#2,007 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feat/formatter
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

### How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

### Which OS are you using?

Windows

### What is the issue affecting?

Formatting

### Expected Behaviour

```lua
local buildings = {
{button = granaryButton, name = "Granary", description = "\nIncreases food capacity."},
{button = appleFarmButton, name = "Orchard", description = "\nProduces apples."},
{button = wheatFarmButton, name = "WheatFarm", description = "\nProduces wheat which can be processed into flour."},
{button = hopsFarmButton, name = "HopsFarm", description = "\nProduces hops which can be processed into ale."}
}
```

### Actual Behaviour

```lua
local buildings = {
{ button = granaryButton, name = "Granary", description = "\nIncreases food capacity." },
{ button = appleFarmButton, name = "Orchard", description = "\nProduces apples." },
{ button = wheatFarmButton, name = "WheatFarm", description = "\nProduces wheat which can be processed into flour." },
{ button = hopsFarmButton, name = "HopsFarm", description = "\nProduces hops which can be processed into ale." }
}
```

### Reproduction steps

1. Have this .editorconfig in root:
```lua
root = true

[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.lua]
keep_one_space_between_table_and_bracket = false
align_continuous_assign_statement = false
align_continuous_rect_table_field = false
continuation_indent = 0
max_line_length = 200
```
2. Format a file
3. Editorconfig is ignored completely, as well as default options set through vscode UI

### Additional Notes

I have the Editorconfig extension loaded. I tried adding the setting inside VSCode UI for lua sumneko as well. To no avail.

### Log File

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the formatting result in the Visual Studio Code extension using the supplied .editorconfig and the VS Code Lua settings. Start by tracing how formatting options are loaded and compare the configured alignment and continuation settings with the actual output. Done means those options affect formatting as expected and the reported example no longer aligns fields continuously.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.