Skip to content

Commit df4bfbe

Browse files
authored
Merge branch 'master' into feat/addons
2 parents 13686ec + 22625e8 commit df4bfbe

File tree

9 files changed

+114
-14
lines changed

9 files changed

+114
-14
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<!-- Add all new changes here. They will be moved under a version at release -->
55
* `FIX` cannot debug in Linux due to lua-debug expecting host process to have lua54 symbols available
66
* `NEW` support custom addons path for enhanced editor flexibility
7+
* `FIX` support hex color codes with `#` in `textDocument/documentColor`
8+
* `ADD` missing locale
9+
* `FIX` updates the EmmyLuaCodeStyle submodule reference to a newer commit, ensuring compatibility with GCC 15
710

811
## 3.14.0
912
`2025-4-7`

locale/en-us/setting.lua

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,10 @@ Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/doc
281281
config.spell.dict =
282282
'Custom words for spell checking.'
283283
config.nameStyle.config =
284-
'Set name style config'
284+
[[
285+
Set name style config.
286+
Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to learn usage.
287+
]]
285288
config.telemetry.enable =
286289
[[
287290
Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://luals.github.io/privacy/#language-server).
@@ -291,7 +294,7 @@ config.misc.parameters =
291294
config.misc.executablePath =
292295
'Specify the executable path in VSCode.'
293296
config.language.fixIndent =
294-
'(VSCode only) Fix incorrect auto-indentation, such as incorrect indentation when line breaks occur within a string containing the word "function."'
297+
'(VSCode only) Fix incorrect auto-indentation, such as incorrect indentation when line breaks occur within a string containing the word "function".'
295298
config.language.completeAnnotation =
296299
'(VSCode only) Automatically insert "---@ " after a line break following a annotation.'
297300
config.type.castNumberToInteger =
@@ -318,12 +321,22 @@ config.type.checkTableShape =
318321
[[
319322
Strictly check the shape of the table.
320323
]]
324+
config.type.inferTableSize =
325+
'Maximum number of table fields analyzed during type inference.'
321326
config.doc.privateName =
322327
'Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are private, witch can only be accessed in the class where the definition is located.'
323328
config.doc.protectedName =
324329
'Treat specific field names as protected, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are protected, witch can only be accessed in the class where the definition is located and its subclasses.'
325330
config.doc.packageName =
326331
'Treat specific field names as package, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are package, witch can only be accessed in the file where the definition is located.'
332+
config.doc.regengine =
333+
'The regular expression engine used for matching documentation scope names.'
334+
config.doc.regengine.glob =
335+
'The default lightweight pattern syntax.'
336+
config.doc.regengine.lua =
337+
'Full Lua-style regular expressions.'
338+
config.docScriptPath =
339+
'The regular expression engine used for matching documentation scope names.'
327340
config.diagnostics['unused-local'] =
328341
'Enable unused local variable diagnostics.'
329342
config.diagnostics['unused-function'] =
@@ -341,7 +354,7 @@ config.diagnostics['trailing-space'] =
341354
config.diagnostics['redefined-local'] =
342355
'Enable redefined local variable diagnostics.'
343356
config.diagnostics['newline-call'] =
344-
'Enable newline call diagnostics. Is\'s raised when a line starting with `(` is encountered, which is syntactically parsed as a function call on the previous line.'
357+
'Enable newline call diagnostics. It\'s raised when a line starting with `(` is encountered, which is syntactically parsed as a function call on the previous line.'
345358
config.diagnostics['newfield-call'] =
346359
'Enable newfield call diagnostics. It is raised when the parenthesis of a function call appear on the following line when defining a field in a table.'
347360
config.diagnostics['redundant-parameter'] =

locale/es-419/setting.lua

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,11 @@ para aprender más sobre su uso.
282282
config.spell.dict =
283283
'Palabras extra para el corrector ortográfico.'
284284
config.nameStyle.config =
285-
'Configuración de estilo para nombres.'
285+
[[
286+
Configuración de estilo para nombres.
287+
Revise [la documentación del formateador](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs)
288+
para aprender más sobre su uso.
289+
]]
286290
config.telemetry.enable =
287291
[[
288292
Habilita la telemetría para enviar información del editor y registros de errores por la red. Lea nuestra política de privacidad [aquí (en inglés)](https://luals.github.io/privacy#language-server).
@@ -319,12 +323,22 @@ config.type.checkTableShape =
319323
[[
320324
Chequea estrictamente la forma de la tabla.
321325
]]
326+
config.type.inferTableSize = -- TODO: need translate!
327+
'Maximum number of table fields analyzed during type inference.'
322328
config.doc.privateName =
323329
'Trata los nombres específicos de campo como privados. Por ejemplo `m_*` significa `XXX.m_id` y `XXX.m_tipo` son privados, por lo que solo pueden ser accedidos donde se define la clase.'
324330
config.doc.protectedName =
325331
'Trata los nombres específicos de campo como protegidos. Por ejemplo `m_*` significa `XXX.m_id` y `XXX.m_tipo` son privados, por lo que solo pueden ser accedidos donde se define la clase y sus subclases.'
326332
config.doc.packageName =
327333
'Trata los nombres específicos de campo como del paquete. Por ejemplo `m_*` significa `XXX.m_id` y `XXX.m_tipo` son de paquete, por lo que solo pueden ser accedidos en el archivo donde son definidos.'
334+
config.doc.regengine = -- TODO: need translate!
335+
'The regular expression engine used for matching documentation scope names.'
336+
config.doc.regengine.glob = -- TODO: need translate!
337+
'The default lightweight pattern syntax.'
338+
config.doc.regengine.lua = -- TODO: need translate!
339+
'Full Lua-style regular expressions.'
340+
config.docScriptPath = -- TODO: need translate!
341+
'The regular expression engine used for matching documentation scope names.'
328342
config.diagnostics['unused-local'] =
329343
'Habilita el diagnóstico de variables local sin uso.'
330344
config.diagnostics['unused-function'] =

locale/ja-jp/setting.lua

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,10 @@ Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/doc
281281
config.spell.dict = -- TODO: need translate!
282282
'Custom words for spell checking.'
283283
config.nameStyle.config = -- TODO: need translate!
284-
'Set name style config'
284+
[[
285+
Set name style config.
286+
Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to learn usage.
287+
]]
285288
config.telemetry.enable = -- TODO: need translate!
286289
[[
287290
Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://luals.github.io/privacy/#language-server).
@@ -318,12 +321,22 @@ config.type.checkTableShape = -- TODO: need translate!
318321
[[
319322
Strictly check the shape of the table.
320323
]]
324+
config.type.inferTableSize = -- TODO: need translate!
325+
'Maximum number of table fields analyzed during type inference.'
321326
config.doc.privateName = -- TODO: need translate!
322327
'Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are private, witch can only be accessed in the class where the definition is located.'
323328
config.doc.protectedName = -- TODO: need translate!
324329
'Treat specific field names as protected, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are protected, witch can only be accessed in the class where the definition is located and its subclasses.'
325330
config.doc.packageName = -- TODO: need translate!
326331
'Treat specific field names as package, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are package, witch can only be accessed in the file where the definition is located.'
332+
config.doc.regengine = -- TODO: need translate!
333+
'The regular expression engine used for matching documentation scope names.'
334+
config.doc.regengine.glob = -- TODO: need translate!
335+
'The default lightweight pattern syntax.'
336+
config.doc.regengine.lua = -- TODO: need translate!
337+
'Full Lua-style regular expressions.'
338+
config.docScriptPath = -- TODO: need translate!
339+
'The regular expression engine used for matching documentation scope names.'
327340
config.diagnostics['unused-local'] = -- TODO: need translate!
328341
'Enable unused local variable diagnostics.'
329342
config.diagnostics['unused-function'] = -- TODO: need translate!

locale/pt-br/setting.lua

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,10 @@ Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/doc
281281
config.spell.dict = -- TODO: need translate!
282282
'Custom words for spell checking.'
283283
config.nameStyle.config = -- TODO: need translate!
284-
'Set name style config'
284+
[[
285+
Set name style config.
286+
Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to learn usage.
287+
]]
285288
config.telemetry.enable = -- TODO: need translate!
286289
[[
287290
Enable telemetry to send your editor information and error logs over the network. Read our privacy policy [here](https://luals.github.io/privacy/#language-server).
@@ -318,12 +321,22 @@ config.type.checkTableShape = -- TODO: need translate!
318321
[[
319322
对表的形状进行严格检查。
320323
]]
324+
config.type.inferTableSize = -- TODO: need translate!
325+
'Maximum number of table fields analyzed during type inference.'
321326
config.doc.privateName = -- TODO: need translate!
322327
'Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are private, witch can only be accessed in the class where the definition is located.'
323328
config.doc.protectedName = -- TODO: need translate!
324329
'Treat specific field names as protected, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are protected, witch can only be accessed in the class where the definition is located and its subclasses.'
325330
config.doc.packageName = -- TODO: need translate!
326331
'Treat specific field names as package, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are package, witch can only be accessed in the file where the definition is located.'
332+
config.doc.regengine = -- TODO: need translate!
333+
'The regular expression engine used for matching documentation scope names.'
334+
config.doc.regengine.glob = -- TODO: need translate!
335+
'The default lightweight pattern syntax.'
336+
config.doc.regengine.lua = -- TODO: need translate!
337+
'Full Lua-style regular expressions.'
338+
config.docScriptPath = -- TODO: need translate!
339+
'The regular expression engine used for matching documentation scope names.'
327340
config.diagnostics['unused-local'] = -- TODO: need translate!
328341
'未使用的局部变量'
329342
config.diagnostics['unused-function'] = -- TODO: need translate!

locale/zh-cn/setting.lua

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ config.diagnostics.disable =
5555
config.diagnostics.globals =
5656
"已定义的全局变量。"
5757
config.diagnostics.globalsRegex =
58-
"启用诊断以检测尝试关闭非对象的变量"
58+
"已定义的全局变量符合的正则表达式"
5959
config.diagnostics.severity =
6060
[[
6161
修改诊断等级。
@@ -279,7 +279,10 @@ config.format.defaultConfig =
279279
config.spell.dict =
280280
'拼写检查的自定义单词。'
281281
config.nameStyle.config =
282-
'设定命名风格检查的配置'
282+
[[
283+
设定命名风格检查的配置。
284+
请查阅[格式化文档](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs)了解用法。
285+
]]
283286
config.telemetry.enable =
284287
[[
285288
启用遥测,通过网络发送你的编辑器信息与错误日志。在[此处](https://luals.github.io/privacy/#language-server)阅读我们的隐私声明。
@@ -316,12 +319,22 @@ config.type.checkTableShape =
316319
[[
317320
对表的形状进行严格检查。
318321
]]
322+
config.type.inferTableSize =
323+
'类型推断期间分析的表字段的最大数量。'
319324
config.doc.privateName =
320325
'将特定名称的字段视为私有,例如 `m_*` 意味着 `XXX.m_id` 与 `XXX.m_type` 是私有字段,只能在定义所在的类中访问。'
321326
config.doc.protectedName =
322327
'将特定名称的字段视为受保护,例如 `m_*` 意味着 `XXX.m_id` 与 `XXX.m_type` 是受保护的字段,只能在定义所在的类极其子类中访问。'
323328
config.doc.packageName =
324329
'将特定名称的字段视为package,例如 `m_*` 意味着 `XXX.m_id` 与 `XXX.m_type` 只能在定义所在的文件中访问。'
330+
config.doc.regengine =
331+
'用于匹配文档作用域名称的正则表达式引擎。'
332+
config.doc.regengine.glob =
333+
'默认轻量级模式语法。'
334+
config.doc.regengine.lua =
335+
'完整的 Lua 风格正则表达式。'
336+
config.docScriptPath =
337+
'自定义 Lua 脚本路径,覆盖默认文档生成行为。'
325338
config.diagnostics['unused-local'] =
326339
'未使用的局部变量'
327340
config.diagnostics['unused-function'] =

locale/zh-tw/setting.lua

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ config.format.defaultConfig =
279279
config.spell.dict =
280280
'拼寫檢查的自訂單詞。'
281281
config.nameStyle.config = -- TODO: need translate!
282-
'Set name style config'
282+
[[
283+
Set name style config.
284+
Read [formatter docs](https://github.com/CppCXY/EmmyLuaCodeStyle/tree/master/docs) to learn usage.
285+
]]
283286
config.telemetry.enable =
284287
[[
285288
啟用遙測,透過網路發送你的編輯器資訊與錯誤日誌。在[此處](https://luals.github.io/privacy/#language-server)閱讀我們的隱私聲明。
@@ -316,12 +319,22 @@ config.type.checkTableShape = -- TODO: need translate!
316319
[[
317320
对表的形状进行严格检查。
318321
]]
322+
config.type.inferTableSize = -- TODO: need translate!
323+
'Maximum number of table fields analyzed during type inference.'
319324
config.doc.privateName = -- TODO: need translate!
320325
'Treat specific field names as private, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are private, witch can only be accessed in the class where the definition is located.'
321326
config.doc.protectedName = -- TODO: need translate!
322327
'Treat specific field names as protected, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are protected, witch can only be accessed in the class where the definition is located and its subclasses.'
323328
config.doc.packageName = -- TODO: need translate!
324329
'Treat specific field names as package, e.g. `m_*` means `XXX.m_id` and `XXX.m_type` are package, witch can only be accessed in the file where the definition is located.'
330+
config.doc.regengine = -- TODO: need translate!
331+
'The regular expression engine used for matching documentation scope names.'
332+
config.doc.regengine.glob = -- TODO: need translate!
333+
'The default lightweight pattern syntax.'
334+
config.doc.regengine.lua = -- TODO: need translate!
335+
'Full Lua-style regular expressions.'
336+
config.docScriptPath = -- TODO: need translate!
337+
'The regular expression engine used for matching documentation scope names.'
325338
config.diagnostics['unused-local'] =
326339
'未使用的區域變數'
327340
config.diagnostics['unused-function'] =

script/core/color.lua

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@ local files = require "files"
22
local guide = require "parser.guide"
33

44
local colorPattern = string.rep('%x', 8)
5+
local hex6Pattern = string.format("^#%s", string.rep('%x', 6))
56
---@param source parser.object
67
---@return boolean
78
local function isColor(source)
89
---@type string
910
local text = source[1]
10-
if text:len() ~= 8 then
11-
return false
11+
if text:len() == 8 then
12+
return text:match(colorPattern)
1213
end
13-
return text:match(colorPattern)
14+
15+
if text:len() == 7 then
16+
return text:match(hex6Pattern)
17+
end
18+
19+
return false
1420
end
1521

1622

@@ -25,6 +31,16 @@ local function textToColor(colorText)
2531
}
2632
end
2733

34+
---@param colorText string
35+
---@return Color
36+
local function hexTextToColor(colorText)
37+
return {
38+
alpha = 255,
39+
red = tonumber(colorText:sub(2, 3), 16) / 255,
40+
green = tonumber(colorText:sub(4, 5), 16) / 255,
41+
blue = tonumber(colorText:sub(6, 7), 16) / 255,
42+
}
43+
end
2844

2945
---@param color Color
3046
---@return string
@@ -63,10 +79,12 @@ local function colors(uri)
6379
---@type string
6480
local colorText = source[1]
6581

82+
local color = colorText:match(colorPattern) and textToColor(colorText) or hexTextToColor(colorText)
83+
6684
colorValues[#colorValues+1] = {
6785
start = source.start + 1,
6886
finish = source.finish - 1,
69-
color = textToColor(colorText)
87+
color = color
7088
}
7189
end
7290
end)

0 commit comments

Comments
 (0)