Skip to content

Commit b96ab07

Browse files
committed
function may not have a name
1 parent e98b56f commit b96ab07

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

locale/en-us/script.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM =
127127
DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN =
128128
'Missing @return annotation at index `{}` in exported local function `{}`.'
129129
DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM =
130-
'Incomplete signature. Missing @param annotation for parameter `{}` in function `{}`.'
130+
'Incomplete signature. Missing @param annotation for parameter `{}`.'
131131
DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN =
132-
'Incomplete signature. Missing @return annotation at index `{}` in function `{}`.'
132+
'Incomplete signature. Missing @return annotation at index `{}`.'
133133
DIAG_UNKNOWN_DIAG_CODE =
134134
'Unknown diagnostic code `{}`.'
135135
DIAG_CAST_LOCAL_TYPE =

locale/pt-br/script.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM = -- TODO: need translate!
127127
DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN = -- TODO: need translate!
128128
'Missing @return annotation at index `{}` in exported local function `{}`.'
129129
DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM = -- TODO: need translate!
130-
'Incomplete signature. Missing @param annotation for parameter `{}` in function `{}`.'
130+
'Incomplete signature. Missing @param annotation for parameter `{}`.'
131131
DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN = -- TODO: need translate!
132-
'Incomplete signature. Missing @return annotation at index `{}` in function `{}`.'
132+
'Incomplete signature. Missing @return annotation at index `{}`.'
133133
DIAG_UNKNOWN_DIAG_CODE = -- TODO: need translate!
134134
'Código de diagnóstico desconhecido `{}`.'
135135
DIAG_CAST_LOCAL_TYPE = -- TODO: need translate!

locale/zh-cn/script.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM =
127127
DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN =
128128
'导出的局部函数 `{2}` 的第 {1} 个返回值缺少 @return 注解。'
129129
DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM =
130-
'签名不完整。函数 `{2}` 的参数 `{1}` 缺少 @param 注解。'
130+
'签名不完整。参数 `{1}` 缺少 @param 注解。'
131131
DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN =
132-
'签名不完整。函数 `{2}` 的第 {1} 个返回值缺少 @return 注解。'
132+
'签名不完整。 {1} 个返回值缺少 @return 注解。'
133133
DIAG_UNKNOWN_DIAG_CODE =
134134
'未知的诊断代号 `{}`。'
135135
DIAG_CAST_LOCAL_TYPE =

locale/zh-tw/script.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ DIAG_MISSING_LOCAL_EXPORT_DOC_PARAM = -- TODO: need translate!
127127
DIAG_MISSING_LOCAL_EXPORT_DOC_RETURN = -- TODO: need translate!
128128
'Missing @return annotation at index `{}` in exported local function `{}`.'
129129
DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM = -- TODO: need translate!
130-
'Incomplete signature. Missing @param annotation for parameter `{}` in function `{}`.'
130+
'Incomplete signature. Missing @param annotation for parameter `{}`.'
131131
DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN = -- TODO: need translate!
132-
'Incomplete signature. Missing @return annotation at index `{}` in function `{}`.'
132+
'Incomplete signature. Missing @return annotation at index `{}`.'
133133
DIAG_UNKNOWN_DIAG_CODE =
134134
'未知的診斷代碼 `{}`。'
135135
DIAG_CAST_LOCAL_TYPE =

script/core/diagnostics/incomplete-signature-doc.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ return function (uri, callback)
7070
return
7171
end
7272

73-
local functionName = source.parent[1]
74-
7573
--- don't apply rule if there is no @param or @return annotation yet
7674
--- so comments and @async can be applied without the need for a full documentation
7775
if(not findSignatureDoc(source.bindDocs)) then
@@ -87,7 +85,7 @@ return function (uri, callback)
8785
callback {
8886
start = arg.start,
8987
finish = arg.finish,
90-
message = lang.script('DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM', argName, functionName),
88+
message = lang.script('DIAG_INCOMPLETE_SIGNATURE_DOC_PARAM', argName),
9189
}
9290
end
9391
end
@@ -101,7 +99,7 @@ return function (uri, callback)
10199
callback {
102100
start = expr.start,
103101
finish = expr.finish,
104-
message = lang.script('DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN', index, functionName),
102+
message = lang.script('DIAG_INCOMPLETE_SIGNATURE_DOC_RETURN', index),
105103
}
106104
end
107105
end

0 commit comments

Comments
 (0)