diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-08-03 18:00:19 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-08-03 18:00:19 +0800 |
commit | b96ab075f43e04d5bb42566df4f7c172b35a3df8 (patch) | |
tree | d3f8c11102bc46f3e628b8bc267838877d60d9e1 | |
parent | e98b56ffbcb49b465abd2ba1eddfc73ce8f2a3c5 (diff) | |
download | lua-language-server-b96ab075f43e04d5bb42566df4f7c172b35a3df8.zip |
function may not have a name
-rw-r--r-- | locale/en-us/script.lua | 4 | ||||
-rw-r--r-- | locale/pt-br/script.lua | 4 | ||||
-rw-r--r-- | locale/zh-cn/script.lua | 4 | ||||
-rw-r--r-- | locale/zh-tw/script.lua | 4 | ||||
-rw-r--r-- | script/core/diagnostics/incomplete-signature-doc.lua | 6 |
5 files changed, 10 insertions, 12 deletions
diff --git a/locale/en-us/script.lua b/locale/en-us/script.lua index 5a1c5ef3..060c7c45 100644 --- a/locale/en-us/script.lua +++ b/locale/en-us/script.lua @@ -127,9 +127,9 @@ DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM = DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN = 'Missing @return annotation at index `{}` in exported local function `{}`.' DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM = -'Incomplete signature. Missing @param annotation for parameter `{}` in function `{}`.' +'Incomplete signature. Missing @param annotation for parameter `{}`.' DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN = -'Incomplete signature. Missing @return annotation at index `{}` in function `{}`.' +'Incomplete signature. Missing @return annotation at index `{}`.' DIAG_UNKNOWN_DIAG_CODE = 'Unknown diagnostic code `{}`.' DIAG_CAST_LOCAL_TYPE = diff --git a/locale/pt-br/script.lua b/locale/pt-br/script.lua index 11b7a091..4c4e5d2b 100644 --- a/locale/pt-br/script.lua +++ b/locale/pt-br/script.lua @@ -127,9 +127,9 @@ DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM = -- TODO: need translate! DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN = -- TODO: need translate! 'Missing @return annotation at index `{}` in exported local function `{}`.' DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM = -- TODO: need translate! -'Incomplete signature. Missing @param annotation for parameter `{}` in function `{}`.' +'Incomplete signature. Missing @param annotation for parameter `{}`.' DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN = -- TODO: need translate! -'Incomplete signature. Missing @return annotation at index `{}` in function `{}`.' +'Incomplete signature. Missing @return annotation at index `{}`.' DIAG_UNKNOWN_DIAG_CODE = -- TODO: need translate! 'Código de diagnóstico desconhecido `{}`.' DIAG_CAST_LOCAL_TYPE = -- TODO: need translate! diff --git a/locale/zh-cn/script.lua b/locale/zh-cn/script.lua index 57f6e5e0..40ba7cbc 100644 --- a/locale/zh-cn/script.lua +++ b/locale/zh-cn/script.lua @@ -127,9 +127,9 @@ DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM = DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN = '导出的局部函数 `{2}` 的第 {1} 个返回值缺少 @return 注解。' DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM = -'签名不完整。函数 `{2}` 的参数 `{1}` 缺少 @param 注解。' +'签名不完整。参数 `{1}` 缺少 @param 注解。' DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN = -'签名不完整。函数 `{2}` 的第 {1} 个返回值缺少 @return 注解。' +'签名不完整。第 {1} 个返回值缺少 @return 注解。' DIAG_UNKNOWN_DIAG_CODE = '未知的诊断代号 `{}`。' DIAG_CAST_LOCAL_TYPE = diff --git a/locale/zh-tw/script.lua b/locale/zh-tw/script.lua index b72f23c0..1208a840 100644 --- a/locale/zh-tw/script.lua +++ b/locale/zh-tw/script.lua @@ -127,9 +127,9 @@ DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM = -- TODO: need translate! DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN = -- TODO: need translate! 'Missing @return annotation at index `{}` in exported local function `{}`.' DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM = -- TODO: need translate! -'Incomplete signature. Missing @param annotation for parameter `{}` in function `{}`.' +'Incomplete signature. Missing @param annotation for parameter `{}`.' DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN = -- TODO: need translate! -'Incomplete signature. Missing @return annotation at index `{}` in function `{}`.' +'Incomplete signature. Missing @return annotation at index `{}`.' DIAG_UNKNOWN_DIAG_CODE = '未知的診斷代碼 `{}`。' DIAG_CAST_LOCAL_TYPE = diff --git a/script/core/diagnostics/incomplete-signature-doc.lua b/script/core/diagnostics/incomplete-signature-doc.lua index b800eb4e..1ffbb77a 100644 --- a/script/core/diagnostics/incomplete-signature-doc.lua +++ b/script/core/diagnostics/incomplete-signature-doc.lua @@ -70,8 +70,6 @@ return function (uri, callback) return end - local functionName = source.parent[1] - --- don't apply rule if there is no @param or @return annotation yet --- so comments and @async can be applied without the need for a full documentation if(not findSignatureDoc(source.bindDocs)) then @@ -87,7 +85,7 @@ return function (uri, callback) callback { start = arg.start, finish = arg.finish, - message = lang.script('DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM', argName, functionName), + message = lang.script('DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM', argName), } end end @@ -101,7 +99,7 @@ return function (uri, callback) callback { start = expr.start, finish = expr.finish, - message = lang.script('DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN', index, functionName), + message = lang.script('DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN', index), } end end |