Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config continuation_indent not accepting 0 #183

Open
Cooldude2606 opened this issue Sep 28, 2024 · 3 comments
Open

Config continuation_indent not accepting 0 #183

Cooldude2606 opened this issue Sep 28, 2024 · 3 comments
Labels
enhancement New feature or request feature request

Comments

@Cooldude2606
Copy link

I am using CodeStyle as part of LuaLS in vscode Lua (v3.10.6) on windows 10 with no other extensions enabled.

I am wanting continuation_indent.in_expr = 0 to disable this rule, however it reverts to the default of 4.
It is not clear why a value of 0 does not work, and there does not appear to be any other way to disable it.
The same applies to continuation_indent and .in_table and .before_block

Here is the .luarc.json being used.
Below is the editor config and lua code being tested:

# see https://github.com/CppCXY/EmmyLuaCodeStyle
[*.lua]

continuation_indent.in_expr = 0
continuation_indent.in_table = 4
continuation_indent.before_block = 4
local function new_something(tbl)
    return tbl
end

local foo =
new_something {
    bar = 1
}

This image shows how the value has reverted back to the default of 4.
image
This image shows how setting it to any other value such as continuation_indent.in_expr = 7 works fine:
image

@CppCXY
Copy link
Owner

CppCXY commented Sep 28, 2024

Because I use std::size_t extensively as a data type, I treat 0 as the usual invalid value. Therefore, indentation usually cannot be set to 0

@Cooldude2606
Copy link
Author

Is there an alternative way of disabling a specific indentation rule?

@CppCXY
Copy link
Owner

CppCXY commented Sep 30, 2024

Currently not available, I might implement it in the future as I am busy with my own language server implementation.

@CppCXY CppCXY added enhancement New feature or request feature request labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature request
Projects
None yet
Development

No branches or pull requests

2 participants