CppCXY / EmmyLuaCodeStyle

fast, powerful, and feature-rich Lua formatting and checking tool.
MIT License
138 stars 26 forks source link

@format disable-next 可以实现更小粒度的控制吗? #159

Closed fcying closed 7 months ago

fcying commented 7 months ago

现在只是对下个语句生效, 如果是在一个table里, 想针对部分disable 就不行了.

--- @format disable-next 生效
local center = {
    { action = "ene | startinsert",                     desc = " New file",        icon = " ", key = "n" },
    { action = "Lazy",                                  desc = " Lazy",            icon = "󰒲 ", key = "l" },
    { action = "qa",                                    desc = " Quit",            icon = " ", key = "q" },
}

local opts = {
    t1 = { bb = "cc"},
    --- @format disable-next  不生效
    center = {
        { action = "ene | startinsert",                     desc = " New file",        icon = " ", key = "n" },
        { action = "Lazy",                                  desc = " Lazy",            icon = "󰒲 ", key = "l" },
        { action = "qa",                                    desc = " Quit",            icon = " ", key = "q" },
    },
    t2 = { bb = "cc" },
}
CppCXY commented 7 months ago

可以但是有什么用

fcying commented 7 months ago

就比如第二个opts表, 里面的center部分是不想格式化的, 其他部分还是要照常格式化. 如果放到opts 前面, 就是整个表都不能格式化了

CppCXY commented 7 months ago

已经实现完了