From 031dc060e3cf2096e9171e168f15346e7d481f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sun, 26 Jun 2022 02:00:22 +0800 Subject: update description about `---@cast` --- locale/zh-tw/script.lua | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'locale/zh-tw/script.lua') 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 <[+|-]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) ]=] -- cgit v1.2.3