summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-01-30 02:39:01 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-01-30 02:39:01 +0800
commit3a21b34bb31c8988bff6b636bdbf506db373d564 (patch)
treea0d2a0b6b88387c5700405516d4b6146327b11e0 /script
parentc7ad75d374ac8bbf39f43791d9fd90910ef5037a (diff)
downloadlua-language-server-3a21b34bb31c8988bff6b636bdbf506db373d564.zip
toy of decorations
Diffstat (limited to 'script')
-rw-r--r--script/provider/provider.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 9074b034..c9c0cb44 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -726,3 +726,25 @@ end)
proto.on('window/workDoneProgress/cancel', function (params)
progress.cancel(params.token)
end)
+
+proto.on('didChangeVisibleRanges', function (params)
+ log.debug(util.dump(params))
+ proto.notify('$/decorations/create', {
+ uri = params.uri,
+ edits = {
+ {
+ newText = ': 你猜猜我是啥类型',
+ range = {
+ start = {
+ line = params.ranges[1]['end'].line - 2,
+ character = params.ranges[1]['end'].character - 5,
+ },
+ ['end'] = {
+ line = params.ranges[1]['end'].line - 2,
+ character = params.ranges[1]['end'].character - 5,
+ },
+ },
+ }
+ }
+ })
+end)