CppCXY / EmmyLuaCodeStyle

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

新特性请求:ignore line/block 格式化时无视一些行、块 #175

Closed qiancy98 closed 3 months ago

qiancy98 commented 3 months ago

Request:希望不格式化一些行/块 (支持其一即可) 例子:

---@noindent
    local t = {"expressions", "here", "will", "not", "be", "indented", "no", "matter", "how", "long", "it", "is"}
---@startindent

或者一行的最后出现指定字符串则该行不格式化,例如(二者择一):

    local t = {"expressions", "here", "will", "not", "be", "indented", "no", "matter", "how", "long", "it", "is"} ---@noindent
    local t = {"expressions", "here", "will", "not", "be", "indented", "no", "matter", "how", "long", "it", "is"} --[[@noindent]]

解释: 我的代码中有一些是程序生成的,我不希望格式化这些代码……TAT 感谢~

CppCXY commented 3 months ago

---@format disable 可以屏蔽该语句以下当前作用域内的代码的格式化, ---@format disable-next 可以屏蔽该语句以下一个元素的格式化

qiancy98 commented 3 months ago

感谢,那我提个PR把它放进文档?

CppCXY commented 3 months ago

https://github.com/CppCXY/EmmyLuaCodeStyle/blob/master/docs/old_version_doc/disable_format.md 以前有, 放在过时文档的

qiancy98 commented 3 months ago

对不起,没看见这里有个“过时文档”文件夹。ISSUE已关,感谢。