summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-14 23:11:46 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-14 23:11:46 +0800
commit3e486462ee3dc14bc996d553c8e456e603b762bc (patch)
tree93a4491cbba46e2b4d4087a4df9592ae5cdad0f1
parent1af368f7c8188c2e8406a18823c4fd052c1ad685 (diff)
downloadlua-language-server-3e486462ee3dc14bc996d553c8e456e603b762bc.zip
#1207 add sample for description for LuaDoc
-rw-r--r--locale/en-us/script.lua7
-rw-r--r--script/core/completion/completion.lua1
2 files changed, 8 insertions, 0 deletions
diff --git a/locale/en-us/script.lua b/locale/en-us/script.lua
index e3071bcc..6559e21d 100644
--- a/locale/en-us/script.lua
+++ b/locale/en-us/script.lua
@@ -546,3 +546,10 @@ CLI_CHECK_SUCCESS =
'Diagnosis completed, no problems found'
CLI_CHECK_RESULTS =
'Diagnosis complete, {} problems found, see {}'
+
+LUADOC_DESC_CLASS =
+[=[
+```lua
+---@class <name> [: <parent>[, <parent2>, ...]]
+```
+]=]
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index 285f5bf2..9e8ad03e 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -1546,6 +1546,7 @@ local function tryluaDocCate(word, results)
results[#results+1] = {
label = docType,
kind = define.CompletionItemKind.Event,
+ description = lang.script('LUADOC_DESC_' .. docType:upper())
}
end
end