summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/core/folding_range.lua7
-rw-r--r--server/src/method/textDocument/foldingRange.lua3
2 files changed, 10 insertions, 0 deletions
diff --git a/server/src/core/folding_range.lua b/server/src/core/folding_range.lua
index db0b0bdf..e94d1ffe 100644
--- a/server/src/core/folding_range.lua
+++ b/server/src/core/folding_range.lua
@@ -8,6 +8,7 @@ local foldingType = {
['while'] = {'region', 'end', },
['repeat'] = {'region', 'until',},
['table'] = {'region', '}', },
+ ['string'] = {'regtion', ']', },
}
return function (vm, comments)
@@ -42,6 +43,12 @@ return function (vm, comments)
kind = data[1],
}
end
+ elseif tp == 'string' then
+ result[#result+1] = {
+ start = start,
+ finish = finish,
+ kind = data[1],
+ }
elseif data[1] == 'region' then
result[#result+1] = {
start = start,
diff --git a/server/src/method/textDocument/foldingRange.lua b/server/src/method/textDocument/foldingRange.lua
index 33346285..0320b422 100644
--- a/server/src/method/textDocument/foldingRange.lua
+++ b/server/src/method/textDocument/foldingRange.lua
@@ -10,6 +10,9 @@ local function convertRange(lines, range)
endLine = finish_row - 2,
kind = range.kind,
}
+ if result.startLine >= result.endLine then
+ return nil
+ end
return result
end