diff options
-rw-r--r-- | locale/en-US/script.lni | 20 | ||||
-rw-r--r-- | locale/zh-CN/script.lni | 20 | ||||
-rw-r--r-- | script-beta/core/hover/label.lua | 3 | ||||
-rw-r--r-- | script-beta/core/hover/table.lua | 3 |
4 files changed, 43 insertions, 3 deletions
diff --git a/locale/en-US/script.lni b/locale/en-US/script.lni index 88ad7a85..c8d7ebf6 100644 --- a/locale/en-US/script.lni +++ b/locale/en-US/script.lni @@ -34,6 +34,24 @@ DIAG_DUPLICATE_FIELD = 'Duplicate field.' DIAG_SET_CONST = 'Assignment to const variable.' DIAG_SET_FOR_STATE = 'Assignment to for-state variable.' +DIAG_LUADOC_MISS_CLASS_NAME = '<class name> expected.' +DIAG_LUADOC_MISS_EXTENDS_SYMBOL = '`:` expected.' +DIAG_LUADOC_MISS_CLASS_EXTENDS_NAME = '<class extends name> expected.' +DIAG_LUADOC_MISS_SYMBOL = '`{symbol}` expected.' +DIAG_LUADOC_MISS_ARG_NAME = '<arg name> expected.' +DIAG_LUADOC_MISS_TYPE_NAME = '<type name> expected.' +DIAG_LUADOC_MISS_ALIAS_NAME = '<alias name> expected.' +DIAG_LUADOC_MISS_ALIAS_EXTENDS = '<alias extends> expected.' +DIAG_LUADOC_MISS_PARAM_NAME = '<param name> expected.' +DIAG_LUADOC_MISS_PARAM_EXTENDS = '<param extends> expected.' +DIAG_LUADOC_MISS_FIELD_NAME = '<field name> expected.' +DIAG_LUADOC_MISS_FIELD_EXTENDS = '<field extends> expected.' +DIAG_LUADOC_MISS_GENERIC_NAME = '<generic name> expected.' +DIAG_LUADOC_MISS_GENERIC_EXTENDS_NAME = '<generic extends name> expected.' +DIAG_LUADOC_MISS_VARARG_TYPE = '<vararg type> expected.' +DIAG_LUADOC_MISS_FUN_AFTER_OVERLOAD = '`fun` expected.' +DIAG_LUADOC_MISS_CATE_NAME = '<doc name> expected.' + MWS_NOT_SUPPORT = '{} dose not support multi workspace for now, I may need to restart to support the new workspace ...' MWS_RESTART = 'Restart' MWS_NOT_COMPLETE = 'Workspace is not complete yet. You may try again later...' @@ -110,6 +128,8 @@ HOVER_MULTI_DEF_PROTO = '({} definitions, {} prototypes)' HOVER_MULTI_PROTO_NOT_FUNC = '({} non functional definition)' HOVER_USE_LUA_PATH = '(Suppose the search path contains `{}`)' +HOVER_EXTENDS = 'Expand to {}' +HOVER_TABLE_TIME_UP = 'Partial type inference has been disabled for performance reasons.' ACTION_DISABLE_DIAG = 'Disable diagnostics ({}).' ACTION_MARK_GLOBAL = 'Mark `{}` as defined global.' diff --git a/locale/zh-CN/script.lni b/locale/zh-CN/script.lni index 7c223dd2..2409b6f1 100644 --- a/locale/zh-CN/script.lni +++ b/locale/zh-CN/script.lni @@ -34,6 +34,24 @@ DIAG_DUPLICATE_FIELD = '重复定义的 field 。' DIAG_SET_CONST = '不能对常量赋值。' DIAG_SET_FOR_STATE = '修改了循环变量。' +DIAG_LUADOC_MISS_CLASS_NAME = '缺少类名称。' +DIAG_LUADOC_MISS_EXTENDS_SYMBOL = '缺少符号 `:`。' +DIAG_LUADOC_MISS_CLASS_EXTENDS_NAME = '缺少要继承的类名称。' +DIAG_LUADOC_MISS_SYMBOL = '缺少符号 `{symbol}`。' +DIAG_LUADOC_MISS_ARG_NAME = '缺少参数名称。' +DIAG_LUADOC_MISS_TYPE_NAME = '缺少类型名。' +DIAG_LUADOC_MISS_ALIAS_NAME = '缺少别名。' +DIAG_LUADOC_MISS_ALIAS_EXTENDS = '缺少别名定义。' +DIAG_LUADOC_MISS_PARAM_NAME = '缺少要指向的参数名称。' +DIAG_LUADOC_MISS_PARAM_EXTENDS = '缺少参数的类型定义。' +DIAG_LUADOC_MISS_FIELD_NAME = '缺少字段名称。' +DIAG_LUADOC_MISS_FIELD_EXTENDS = '缺少字段的类型定义。' +DIAG_LUADOC_MISS_GENERIC_NAME = '缺少泛型名称。' +DIAG_LUADOC_MISS_GENERIC_EXTENDS_NAME = '缺少泛型要继承的类名称。' +DIAG_LUADOC_MISS_VARARG_TYPE = '缺少不定参的类型定义。' +DIAG_LUADOC_MISS_FUN_AFTER_OVERLOAD = '缺少关键字 `fun`。' +DIAG_LUADOC_MISS_CATE_NAME = '缺少文档类型名称。' + MWS_NOT_SUPPORT = '{} 目前还不支持多工作目录,我可能需要重启才能支持新的工作目录...' MWS_RESTART = '重启' MWS_NOT_COMPLETE = '工作目录还没有准备好,你可以稍后再试一下...' @@ -109,6 +127,8 @@ HOVER_MULTI_DEF_PROTO = '({} 个定义,{} 个原型)' HOVER_MULTI_PROTO_NOT_FUNC = '({} 个非函数定义)' HOVER_USE_LUA_PATH = '(假设搜索路径包含 `{}`)' +HOVER_EXTENDS = '展开为 {}' +HOVER_TABLE_TIME_UP = '出于性能考虑,已禁用了部分类型推断。' ACTION_DISABLE_DIAG = '禁用诊断({})。' ACTION_MARK_GLOBAL = '标记 `{}` 为已定义的全局变量。' diff --git a/script-beta/core/hover/label.lua b/script-beta/core/hover/label.lua index b96421b1..24779c41 100644 --- a/script-beta/core/hover/label.lua +++ b/script-beta/core/hover/label.lua @@ -36,8 +36,7 @@ local function asDocTypeName(source) end if doc.type == 'doc.alias.name' then local extends = doc.parent.extends - -- TODO - return '展开为 ' .. vm.getInferType(extends) + return lang.script('HOVER_EXTENDS', vm.getInferType(extends)) end end end diff --git a/script-beta/core/hover/table.lua b/script-beta/core/hover/table.lua index 0da2a18b..145f3c08 100644 --- a/script-beta/core/hover/table.lua +++ b/script-beta/core/hover/table.lua @@ -2,6 +2,7 @@ local vm = require 'vm' local util = require 'utility' local guide = require 'parser.guide' local config = require 'config' +local lang = require 'language' local function getKey(src) if src.type == 'library' then @@ -275,9 +276,9 @@ return function (source) else result = buildAsHash(classes, literals) end - -- TODO if timeUp then result = '\n--出于性能考虑,已禁用了部分类型推断。\n' .. result + result = ('\n--%s\n%s'):format(lang.script.HOVER_TABLE_TIME_UP, result) end return result end |