Skip to content

Commit 8d10822

Browse files
authored
add: literal enum example to @alias #1685 (#1730)
1 parent 7400644 commit 8d10822

File tree

4 files changed

+56
-0
lines changed

4 files changed

+56
-0
lines changed

locale/en-us/script.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,20 @@ function find(path, pattern) end
721721
---@param style font-style Style to apply
722722
function setFontStyle(style) end
723723
```
724+
725+
### Literal Enum
726+
```
727+
local enums = {
728+
READ = 0,
729+
WRITE = 1,
730+
CLOSED = 2
731+
}
732+
733+
---@alias FileStates
734+
---| `enums.READ`
735+
---| `enums.WRITE`
736+
---| `enums.CLOSE`
737+
```
724738
---
725739
[View Wiki](https://github.com/sumneko/lua-language-server/wiki/Annotations#alias)
726740
]=]

locale/pt-br/script.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,20 @@ function find(path, pattern) end
721721
---@param style font-style Style to apply
722722
function setFontStyle(style) end
723723
```
724+
725+
### Literal Enum
726+
```
727+
local enums = {
728+
READ = 0,
729+
WRITE = 1,
730+
CLOSED = 2
731+
}
732+
733+
---@alias FileStates
734+
---| `enums.READ`
735+
---| `enums.WRITE`
736+
---| `enums.CLOSE`
737+
```
724738
---
725739
[View Wiki](https://github.com/sumneko/lua-language-server/wiki/Annotations#alias)
726740
]=]

locale/zh-cn/script.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,20 @@ function find(path, pattern) end
721721
---@param style font-style Style to apply
722722
function setFontStyle(style) end
723723
```
724+
725+
### Literal Enum
726+
```
727+
local enums = {
728+
READ = 0,
729+
WRITE = 1,
730+
CLOSED = 2
731+
}
732+
733+
---@alias FileStates
734+
---| `enums.READ`
735+
---| `enums.WRITE`
736+
---| `enums.CLOSE`
737+
```
724738
---
725739
[View Wiki](https://github.com/sumneko/lua-language-server/wiki/Annotations#alias)
726740
]=]

locale/zh-tw/script.lua

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,20 @@ function find(path, pattern) end
721721
---@param style font-style Style to apply
722722
function setFontStyle(style) end
723723
```
724+
725+
### Literal Enum
726+
```
727+
local enums = {
728+
READ = 0,
729+
WRITE = 1,
730+
CLOSED = 2
731+
}
732+
733+
---@alias FileStates
734+
---| `enums.READ`
735+
---| `enums.WRITE`
736+
---| `enums.CLOSE`
737+
```
724738
---
725739
[檢視文件](https://github.com/sumneko/lua-language-server/wiki/Annotations#alias)
726740
]=]

0 commit comments

Comments
 (0)