File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1022,3 +1022,33 @@ print(x) --> table
10221022---
10231023[View Wiki](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations#cast)
10241024]=]
1025+ LUADOC_DESC_OPERATOR =
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+ ]=]
You can’t perform that action at this time.
0 commit comments