Skip to content

align_continuous_rect_table_field has no effect during formatting #2877

@4lph4-Ph4un

Description

@4lph4-Ph4un

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

When I try to format my tables to be aligned by the equals sign, nothing happens when the align_continuous_rect_table_field has been set to true:

I expect this...:

local aligned_map = {
  foo = 1,
  foobar = 2,
}

to become this:

local aligned_map = {
  foo    = 1,
  foobar = 2,
}

Actual Behaviour

Nothing happens and the code stays as is.

Reproduction steps

  1. Set align_continuous_rect_table_field´ to true`
  2. Declare a table with non-aligning table-fields.
  3. Try to format.

Additional Notes

I tested this both on VSCode and on Emacs. The behavior seems to be the same.

My .editoconfig is as follows:

root = true

[*]
charset = utf-8
indent_style = space
end_of_line = lf
insert_final_newline = true

[*.json]
indent_size = 2

[{makefile,makefile.*}]
indent_style = tab
indent_size = 2

[*.lua]
indent_size = 2
continuation_indent = 2
quote_style = double
table_separator_style = colon
trailing_table_separator = smart
space_around_table_field_list = false
align_continuous_assign_statement = true
align_continuous_rect_table_field = true
end_statement_with_semicolon = same_line

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUser has a question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions