diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-14 11:35:52 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-14 11:35:52 +0800 |
commit | 6b51351ecf215a09609e63a17209ac8757cc3844 (patch) | |
tree | cc014b6beb7438be735168a3eecf2792bf393627 /server/src/core | |
parent | a1a5e4da0d5b1f994117d8e51ea7e105cca7d049 (diff) | |
download | lua-language-server-6b51351ecf215a09609e63a17209ac8757cc3844.zip |
多行注释支持折行
Diffstat (limited to 'server/src/core')
-rw-r--r-- | server/src/core/folding_range.lua | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/server/src/core/folding_range.lua b/server/src/core/folding_range.lua index ec8029f8..db0b0bdf 100644 --- a/server/src/core/folding_range.lua +++ b/server/src/core/folding_range.lua @@ -10,7 +10,7 @@ local foldingType = { ['table'] = {'region', '}', }, } -return function (vm) +return function (vm, comments) local result = {} vm:eachSource(function (source) local tp = source.type @@ -50,6 +50,15 @@ return function (vm) } end end) + if comments then + for _, comment in ipairs(comments) do + result[#result+1] = { + start = comment.start, + finish = comment.finish, + kind = 'comment', + } + end + end if #result == 0 then return nil end |