diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-26 02:00:22 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-26 02:00:22 +0800 |
commit | 031dc060e3cf2096e9171e168f15346e7d481f41 (patch) | |
tree | 54fd3bb0d8c548c066e0d28fb7edaee40554d648 /locale/zh-tw/script.lua | |
parent | fc4e8ef687ad996f96091c664c6a9110dd087a5d (diff) | |
download | lua-language-server-031dc060e3cf2096e9171e168f15346e7d481f41.zip |
update description about `---@cast`
Diffstat (limited to 'locale/zh-tw/script.lua')
-rw-r--r-- | locale/zh-tw/script.lua | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/locale/zh-tw/script.lua b/locale/zh-tw/script.lua index 437d4dc6..91fd1bb7 100644 --- a/locale/zh-tw/script.lua +++ b/locale/zh-tw/script.lua @@ -964,17 +964,15 @@ LUADOC_DESC_NODISCARD = --- [檢視文件](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations#nodiscard) ]=] -LUADOC_DESC_CAST = +LUADOC_DESC_CAST = -- TODO: need translate! [=[ -允許類型轉換。 +Allows type casting (type conversion). -⚠️ **不是最終定案** - -## 語法 +## Syntax `@cast <variable> <[+|-]type>[, <[+|-]type>]...` -## 用法 -### 覆蓋類型 +## Usage +### Overwrite type ``` ---@type integer local x --> integer @@ -982,7 +980,7 @@ local x --> integer ---@cast x string print(x) --> string ``` -### 增加類型 +### Add Type ``` ---@type string local x --> string @@ -990,7 +988,7 @@ local x --> string ---@cast x +boolean, +number print(x) --> string|boolean|number ``` -### 移除類型 +### Remove Type ``` ---@type string|table local x --> string|table @@ -999,5 +997,5 @@ local x --> string|table print(x) --> table ``` --- -[檢視提議](https://github.com/sumneko/lua-language-server/issues/1030) +[View Wiki](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations#cast) ]=] |