summaryrefslogtreecommitdiff
path: root/locale/en-us
diff options
context:
space:
mode:
authorcarsakiller <carsakiller@gmail.com>2022-07-18 13:48:59 -0400
committercarsakiller <carsakiller@gmail.com>2022-07-18 13:48:59 -0400
commit6f2248ff0816164b31a3dd0e504cf36b0ad6b100 (patch)
tree4d4ac104609859d7aa882ccd31f4590b58d50cc7 /locale/en-us
parent3017212183fa58a4596473a9e0ed26832726ac59 (diff)
downloadlua-language-server-6f2248ff0816164b31a3dd0e504cf36b0ad6b100.zip
add: description for @enum #1255
Diffstat (limited to 'locale/en-us')
-rw-r--r--locale/en-us/script.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/locale/en-us/script.lua b/locale/en-us/script.lua
index 8880701e..d0066129 100644
--- a/locale/en-us/script.lua
+++ b/locale/en-us/script.lua
@@ -1052,3 +1052,30 @@ pB = -pA
```
[View Request](https://github.com/sumneko/lua-language-server/issues/599)
]=]
+LUADOC_DESC_ENUM =
+[=[
+Mark a table as an enum. If you want an enum but can't define it as a Lua
+table, take a look at the [`@alias`](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations#alias)
+tag.
+
+## Syntax
+`@enum <name>`
+
+## Usage
+```
+---@enum colors
+local colors = {
+ white = 0,
+ orange = 2,
+ yellow = 4,
+ green = 8,
+ black = 16,
+}
+
+---@param color colors
+local function setColor(color) end
+
+-- Completion and hover is provided for the below param
+setColor(colors.green)
+```
+]=]