File tree Expand file tree Collapse file tree 3 files changed +171
-0
lines changed Expand file tree Collapse file tree 3 files changed +171
-0
lines changed Original file line number Diff line number Diff line change @@ -1022,3 +1022,60 @@ print(x) --> table
1022
1022
---
1023
1023
[View Wiki](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations#cast)
1024
1024
]=]
1025
+ LUADOC_DESC_OPERATOR = -- TODO: need translate!
1026
+ [=[
1027
+ Provide type declaration for [operator metamethods](http://lua-users.org/wiki/MetatableEvents).
1028
+
1029
+ ## Syntax
1030
+ `@operator <operation>[(input_type)]:<resulting_type>`
1031
+
1032
+ ## Usage
1033
+ ### Vector Add Metamethod
1034
+ ```
1035
+ ---@class Vector
1036
+ ---@operation add(Vector):Vector
1037
+
1038
+ vA = Vector.new(1, 2, 3)
1039
+ vB = Vector.new(10, 20, 30)
1040
+
1041
+ vC = vA + vB
1042
+ --> Vector
1043
+ ```
1044
+ ### Unary Minus
1045
+ ```
1046
+ ---@class Passcode
1047
+ ---@operation unm:integer
1048
+
1049
+ pA = Passcode.new(1234)
1050
+ pB = -pA
1051
+ --> integer
1052
+ ```
1053
+ [View Request](https://github.com/sumneko/lua-language-server/issues/599)
1054
+ ]=]
1055
+ LUADOC_DESC_ENUM = -- TODO: need translate!
1056
+ [=[
1057
+ Mark a table as an enum. If you want an enum but can't define it as a Lua
1058
+ table, take a look at the [`@alias`](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations#alias)
1059
+ tag.
1060
+
1061
+ ## Syntax
1062
+ `@enum <name>`
1063
+
1064
+ ## Usage
1065
+ ```
1066
+ ---@enum colors
1067
+ local colors = {
1068
+ white = 0,
1069
+ orange = 2,
1070
+ yellow = 4,
1071
+ green = 8,
1072
+ black = 16,
1073
+ }
1074
+
1075
+ ---@param color colors
1076
+ local function setColor(color) end
1077
+
1078
+ -- Completion and hover is provided for the below param
1079
+ setColor(colors.green)
1080
+ ```
1081
+ ]=]
Original file line number Diff line number Diff line change @@ -1022,3 +1022,60 @@ print(x) --> table
1022
1022
---
1023
1023
[View Wiki](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations#cast)
1024
1024
]=]
1025
+ LUADOC_DESC_OPERATOR = -- TODO: need translate!
1026
+ [=[
1027
+ Provide type declaration for [operator metamethods](http://lua-users.org/wiki/MetatableEvents).
1028
+
1029
+ ## Syntax
1030
+ `@operator <operation>[(input_type)]:<resulting_type>`
1031
+
1032
+ ## Usage
1033
+ ### Vector Add Metamethod
1034
+ ```
1035
+ ---@class Vector
1036
+ ---@operation add(Vector):Vector
1037
+
1038
+ vA = Vector.new(1, 2, 3)
1039
+ vB = Vector.new(10, 20, 30)
1040
+
1041
+ vC = vA + vB
1042
+ --> Vector
1043
+ ```
1044
+ ### Unary Minus
1045
+ ```
1046
+ ---@class Passcode
1047
+ ---@operation unm:integer
1048
+
1049
+ pA = Passcode.new(1234)
1050
+ pB = -pA
1051
+ --> integer
1052
+ ```
1053
+ [View Request](https://github.com/sumneko/lua-language-server/issues/599)
1054
+ ]=]
1055
+ LUADOC_DESC_ENUM = -- TODO: need translate!
1056
+ [=[
1057
+ Mark a table as an enum. If you want an enum but can't define it as a Lua
1058
+ table, take a look at the [`@alias`](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations#alias)
1059
+ tag.
1060
+
1061
+ ## Syntax
1062
+ `@enum <name>`
1063
+
1064
+ ## Usage
1065
+ ```
1066
+ ---@enum colors
1067
+ local colors = {
1068
+ white = 0,
1069
+ orange = 2,
1070
+ yellow = 4,
1071
+ green = 8,
1072
+ black = 16,
1073
+ }
1074
+
1075
+ ---@param color colors
1076
+ local function setColor(color) end
1077
+
1078
+ -- Completion and hover is provided for the below param
1079
+ setColor(colors.green)
1080
+ ```
1081
+ ]=]
Original file line number Diff line number Diff line change @@ -1017,3 +1017,60 @@ print(x) --> table
1017
1017
---
1018
1018
[檢視文件](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations#cast)
1019
1019
]=]
1020
+ LUADOC_DESC_OPERATOR = -- TODO: need translate!
1021
+ [=[
1022
+ Provide type declaration for [operator metamethods](http://lua-users.org/wiki/MetatableEvents).
1023
+
1024
+ ## Syntax
1025
+ `@operator <operation>[(input_type)]:<resulting_type>`
1026
+
1027
+ ## Usage
1028
+ ### Vector Add Metamethod
1029
+ ```
1030
+ ---@class Vector
1031
+ ---@operation add(Vector):Vector
1032
+
1033
+ vA = Vector.new(1, 2, 3)
1034
+ vB = Vector.new(10, 20, 30)
1035
+
1036
+ vC = vA + vB
1037
+ --> Vector
1038
+ ```
1039
+ ### Unary Minus
1040
+ ```
1041
+ ---@class Passcode
1042
+ ---@operation unm:integer
1043
+
1044
+ pA = Passcode.new(1234)
1045
+ pB = -pA
1046
+ --> integer
1047
+ ```
1048
+ [View Request](https://github.com/sumneko/lua-language-server/issues/599)
1049
+ ]=]
1050
+ LUADOC_DESC_ENUM = -- TODO: need translate!
1051
+ [=[
1052
+ Mark a table as an enum. If you want an enum but can't define it as a Lua
1053
+ table, take a look at the [`@alias`](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations#alias)
1054
+ tag.
1055
+
1056
+ ## Syntax
1057
+ `@enum <name>`
1058
+
1059
+ ## Usage
1060
+ ```
1061
+ ---@enum colors
1062
+ local colors = {
1063
+ white = 0,
1064
+ orange = 2,
1065
+ yellow = 4,
1066
+ green = 8,
1067
+ black = 16,
1068
+ }
1069
+
1070
+ ---@param color colors
1071
+ local function setColor(color) end
1072
+
1073
+ -- Completion and hover is provided for the below param
1074
+ setColor(colors.green)
1075
+ ```
1076
+ ]=]
You can’t perform that action at this time.
0 commit comments