From 2b18de28cc0c9b668d3ed7aab033819988af1cfc Mon Sep 17 00:00:00 2001 From: rhcher Date: Fri, 1 Jul 2022 13:29:57 +0800 Subject: [PATCH] add var support in textDocument_foldingRange but also has some issue --- src/messages/textDocument_foldingRange.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/messages/textDocument_foldingRange.cc b/src/messages/textDocument_foldingRange.cc index e27a6e22..8a347ea6 100644 --- a/src/messages/textDocument_foldingRange.cc +++ b/src/messages/textDocument_foldingRange.cc @@ -27,7 +27,8 @@ void MessageHandler::textDocument_foldingRange(TextDocumentParam ¶m, for (auto [sym, refcnt] : file->symbol2refcnt) if (refcnt > 0 && sym.extent.valid() && - (sym.kind == Kind::Func || sym.kind == Kind::Type) && + (sym.kind == Kind::Func || sym.kind == Kind::Type || + sym.kind == Kind::Var) && (ls_range = getLsRange(wf, sym.extent))) { FoldingRange &fold = result.emplace_back(); fold.startLine = ls_range->start.line;