summaryrefslogtreecommitdiff
path: root/server/src/method/textDocument/signatureHelp.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/method/textDocument/signatureHelp.lua')
-rw-r--r--server/src/method/textDocument/signatureHelp.lua48
1 files changed, 48 insertions, 0 deletions
diff --git a/server/src/method/textDocument/signatureHelp.lua b/server/src/method/textDocument/signatureHelp.lua
new file mode 100644
index 00000000..0fb7fd10
--- /dev/null
+++ b/server/src/method/textDocument/signatureHelp.lua
@@ -0,0 +1,48 @@
+local matcher = require 'matcher'
+
+return function (lsp, params)
+ local uri = params.textDocument.uri
+ local vm, lines = lsp:loadVM(uri)
+ if not vm then
+ return {}
+ end
+ -- lua是从1开始的,因此都要+1
+ local position = lines:position(params.position.line + 1, params.position.character + 1)
+ do return end
+ return {
+ activeSignature = 0,
+ activeParameter = 1,
+ signatures = {
+ {
+ label = 'xxxx(a, b, c)',
+ documentation = {
+ kind = 'markdown',
+ value = '函数说明',
+ },
+ parameters = {
+ {
+ label = 'a',
+ documentation = {
+ kind = 'markdown',
+ value = '参数a说明',
+ },
+ },
+ {
+ label = 'b',
+ documentation = {
+ kind = 'markdown',
+ value = '参数b说明',
+ },
+ },
+ {
+ label = 'c',
+ documentation = {
+ kind = 'markdown',
+ value = '参数c说明',
+ },
+ },
+ },
+ },
+ }
+ }
+end