coc-lua icon indicating copy to clipboard operation
coc-lua copied to clipboard

How to use `Lua.format.defaultConfig`?

Open FalcoGer opened this issue 2 years ago • 0 comments

I have read the documentation for it here, but it doesn't seem to do anything. On top of that, coc gives me lots of diagnostics about wrong types, wanting anything that isn't a string to be a string.

If I make everything a string it still doesn't work.

Here is my config. When I call coc's format action, the indents don't change to 2 wide, for instance and instead go to the default of 4.

{
    "Lua.format.enable": true,
    "Lua.format.defaultConfig": {
        "indent_style":"space",
        "indent_size":2,
        "quote_style":"double",
        "call_arg_parentheses":"keep",
        "continuation_indent":8,
        "max_line_length":120,
        "end_of_line":"unset",
        "trailing_table_separator":"always",
        "detect_end_of_line":true,
        "insert_final_newline":true,
        "space_around_table_field_list":false,
        "space_before_attribute":true,
        "space_before_function_open_parenthesis":false,
        "space_before_function_call_open_parenthesis":false,
        "space_before_closure_open_parenthesis":false,
        "space_before_function_call_single_arg": true,
        "space_before_open_square_bracket": false,
        "space_inside_function_call_parentheses":false,
        "space_inside_function_param_list_parentheses":false,
        "space_inside_square_brackets":false,
        "space_around_table_append_operator":true,
        "ignore_spaces_inside_function_call":true,
        "space_before_inline_comment": true,
        "space_around_math_operator": true,
        "space_after_comma":true,
        "space_after_comma_in_for_statement": true,
        "space_around_concat_operator":true,
        "align_call_args":true,
        "align_function_params":true,
        "align_continuous_assign_statement":true,
        "align_continuous_rect_table_field":true,
        "align_if_branch":false,
        "align_array_table":true,
        "never_indent_before_if_condition":false,
        "never_indent_comment_on_if_branch":false,
        "line_space_after_if_statement":"fixed(0)",
        "line_space_after_do_statement":"fixed(0)",
        "line_space_after_while_statement":"fixed(0)",
        "line_space_after_repeat_statement":"fixed(0)",
        "line_space_after_for_statement":"fixed(0)",
        "line_space_after_local_or_assign_statement":"max(2)",
        "line_space_after_function_statement":"min(2)",
        "line_space_after_expression_statement":"max(2)",
        "line_space_after_comment":"keep",
        "break_all_list_when_line_exceed":true,
        "auto_collapse_lines":false,
        "ignore_space_after_colon":false,
        "remove_call_expression_list_finish_comma":true,
        "end_statement_with_semicolon": "same_line"
    },
}

FalcoGer avatar Nov 13 '23 16:11 FalcoGer