Skip to content

Commit 1d09f3b

Browse files
committed
更新实现
1 parent f6e103f commit 1d09f3b

File tree

9 files changed

+27
-4
lines changed

9 files changed

+27
-4
lines changed

3rd/EmmyLuaCodeStyle

Submodule EmmyLuaCodeStyle updated 40 files

locale/en-us/setting.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/doc
269269
]]
270270
config.spell.dict =
271271
'Custom words for spell checking.'
272+
config.nameStyle.config =
273+
'Set name style config'
272274
config.telemetry.enable =
273275
[[
274276
Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy).
@@ -401,6 +403,8 @@ config.diagnostics['return-type-mismatch'] =
401403
'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.'
402404
config.diagnostics['spell-check'] =
403405
'Enable diagnostics for typos in strings.'
406+
config.diagnostics['name-style-check'] =
407+
'Enable diagnostics for name style.'
404408
config.diagnostics['unbalanced-assignments']=
405409
'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).'
406410
config.diagnostics['undefined-doc-class'] =

locale/pt-br/setting.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/doc
269269
]]
270270
config.spell.dict = -- TODO: need translate!
271271
'Custom words for spell checking.'
272+
config.nameStyle.config = -- TODO: need translate!
273+
'Set name style config'
272274
config.telemetry.enable = -- TODO: need translate!
273275
[[
274276
Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy).
@@ -401,6 +403,8 @@ config.diagnostics['return-type-mismatch'] = -- TODO: need translate!
401403
'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.'
402404
config.diagnostics['spell-check'] = -- TODO: need translate!
403405
'Enable diagnostics for typos in strings.'
406+
config.diagnostics['name-style-check'] = -- TODO: need translate!
407+
'Enable diagnostics for name style.'
404408
config.diagnostics['unbalanced-assignments']= -- TODO: need translate!
405409
'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).'
406410
config.diagnostics['undefined-doc-class'] = -- TODO: need translate!

locale/zh-cn/setting.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ config.format.defaultConfig =
268268
]]
269269
config.spell.dict =
270270
'拼写检查的自定义单词。'
271+
config.nameStyle.config =
272+
'设定命名风格检查的配置'
271273
config.telemetry.enable =
272274
[[
273275
启用遥测,通过网络发送你的编辑器信息与错误日志。在[此处](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy)阅读我们的隐私声明。
@@ -400,6 +402,8 @@ config.diagnostics['return-type-mismatch'] = -- TODO: need translate!
400402
'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.'
401403
config.diagnostics['spell-check'] = -- TODO: need translate!
402404
'Enable diagnostics for typos in strings.'
405+
config.diagnostics['name-style-check'] = -- TODO: need translate!
406+
'Enable diagnostics for name style.'
403407
config.diagnostics['unbalanced-assignments']= -- TODO: need translate!
404408
'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).'
405409
config.diagnostics['undefined-doc-class'] = -- TODO: need translate!

locale/zh-tw/setting.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ config.format.defaultConfig =
268268
]]
269269
config.spell.dict =
270270
'拼寫檢查的自訂單詞。'
271+
config.nameStyle.config = -- TODO: need translate!
272+
'Set name style config'
271273
config.telemetry.enable =
272274
[[
273275
啟用遙測,透過網路發送你的編輯器資訊與錯誤日誌。在[此處](https://github.com/LuaLS/lua-language-server/wiki/Home#privacy)閱讀我們的隱私聲明。
@@ -400,6 +402,8 @@ config.diagnostics['return-type-mismatch'] = -- TODO: need translate!
400402
'Enable diagnostics for return values whose type does not match the type declared in the corresponding return annotation.'
401403
config.diagnostics['spell-check'] = -- TODO: need translate!
402404
'Enable diagnostics for typos in strings.'
405+
config.diagnostics['name-style-check'] = -- TODO: need translate!
406+
'Enable diagnostics for name style.'
403407
config.diagnostics['unbalanced-assignments']= -- TODO: need translate!
404408
'Enable diagnostics on multiple assignments if not all variables obtain a value (e.g., `local x,y = 1`).'
405409
config.diagnostics['undefined-doc-class'] = -- TODO: need translate!

script/config/template.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ local template = {
385385
auto_complete_table_sep = "true"
386386
},
387387
['Lua.spell.dict'] = Type.Array(Type.String),
388-
['Lua.nameStyle.config'] = Type.Hash(Type.String, Type.Or(Type.String, Type.Hash(Type.String, Type.String)))
388+
['Lua.nameStyle.config'] = Type.Hash(Type.String, Type.Or(Type.String, Type.Array(Type.Hash(Type.String, Type.String))))
389389
>> {},
390390
['Lua.misc.parameters'] = Type.Array(Type.String),
391391
['Lua.misc.executablePath'] = Type.String,
File renamed without changes.

script/proto/diagnostic.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ m.register {
126126
}
127127

128128
m.register {
129-
'namestyle-check'
129+
'name-style-check'
130130
} {
131131
group = 'codestyle',
132132
severity = 'Warning',

script/provider/name-style.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,17 @@ end
55

66
local config = require 'config'
77

8-
98
local m = {}
109

10+
m.loaded = false
11+
1112
function m.nameStyleCheck(uri, text)
13+
if not m.loaded then
14+
local value = config.get(nil, "Lua.nameStyle.config")
15+
codeFormat.update_name_style_config(value)
16+
m.loaded = true
17+
end
18+
1219
return codeFormat.name_style_analysis(uri, text)
1320
end
1421

0 commit comments

Comments
 (0)