summaryrefslogtreecommitdiff
path: root/locale/en-us
diff options
context:
space:
mode:
authorcarsakiller <carsakiller@gmail.com>2022-07-18 13:48:38 -0400
committercarsakiller <carsakiller@gmail.com>2022-07-18 13:48:38 -0400
commit3017212183fa58a4596473a9e0ed26832726ac59 (patch)
tree85782ae94309454c09d1bbc9c530e140f046582f /locale/en-us
parenta92a8003600dc2a0dc867c31bd817320cf6f7c56 (diff)
downloadlua-language-server-3017212183fa58a4596473a9e0ed26832726ac59.zip
add: description for @operator #599
Diffstat (limited to 'locale/en-us')
-rw-r--r--locale/en-us/script.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/locale/en-us/script.lua b/locale/en-us/script.lua
index 6f1a2bc6..8880701e 100644
--- a/locale/en-us/script.lua
+++ b/locale/en-us/script.lua
@@ -1022,3 +1022,33 @@ print(x) --> table
---
[View Wiki](https://github.com/sumneko/lua-language-server/wiki/EmmyLua-Annotations#cast)
]=]
+LUADOC_DESC_OPERATOR =
+[=[
+Provide type declaration for [operator metamethods](http://lua-users.org/wiki/MetatableEvents).
+
+## Syntax
+`@operator <operation>[(input_type)]:<resulting_type>`
+
+## Usage
+### Vector Add Metamethod
+```
+---@class Vector
+---@operation add(Vector):Vector
+
+vA = Vector.new(1, 2, 3)
+vB = Vector.new(10, 20, 30)
+
+vC = vA + vB
+--> Vector
+```
+### Unary Minus
+```
+---@class Passcode
+---@operation unm:integer
+
+pA = Passcode.new(1234)
+pB = -pA
+--> integer
+```
+[View Request](https://github.com/sumneko/lua-language-server/issues/599)
+]=]