diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-05-24 19:49:36 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-05-24 19:49:36 +0800 |
commit | d436ebaba20ffc31c3fc807af55fb4ff40fe65ab (patch) | |
tree | 552920c6e621d323257bd18f0df7ac117960e934 | |
parent | 8adbf27feae1ab46e5ffb758f521aaf62bef9c25 (diff) | |
download | lua-language-server-d436ebaba20ffc31c3fc807af55fb4ff40fe65ab.zip |
resolve #1140 support folding `---@alias`
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | script/core/folding.lua | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md index 4526b750..4184bbc5 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ * `NEW` settings: + `workspace.supportScheme`: `["file", "untitled", "git"]` + `diagnostics.disableScheme`: `["git"]` +* `NEW` folding: support folding `---@alias` * `FIX` hover: can not union `table` with other basic types * `FIX` [#1125](https://github.com/sumneko/lua-language-server/issues/1125) * `FIX` [#1131](https://github.com/sumneko/lua-language-server/issues/1131) diff --git a/script/core/folding.lua b/script/core/folding.lua index 4f93aed9..6154ba72 100644 --- a/script/core/folding.lua +++ b/script/core/folding.lua @@ -143,6 +143,15 @@ local care = { } results[#results+1] = folding end, + ['doc.alias'] = function (source, text, results) + local folding = { + start = source.start, + finish = source.bindGroup[#source.bindGroup].finish, + kind = 'comment', + hideLastLine = true, + } + results[#results+1] = folding + end } ---@async |