loom
1#include "script/ScriptDocumentOperation.h"
2
3using namespace simodo;
4
5/// \file
6/// \todo Добавить возможность Folding Range
7/// \see https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_foldingRange
8
9//variable::Value ScriptDocumentOperation::produceFoldingRangeResponse() const
10//{
11// std::vector<variable::Value> folding_ranges;
12//
13// for(const variable::Variable & var : _semantic_data.declared()) {
14// if (not isInCurrentFile(var.location())) continue;
15// if (not var.value().isFunction()) continue;
16//
17// const auto & body_range = getFunctionBodyRange(var);
18//
19// folding_ranges.push_back(variable::Object{{
20// { u"startLine", int64_t(body_range.start().line()) },
21// { u"startCharacter", int64_t(body_range.start().character()) },
22// { u"endLine", int64_t(body_range.end().line()) },
23// { u"endCharacter", int64_t(body_range.end().character()) },
24// { u"kind", u"region" /* getFoldingRangeKindName(FoldingRangeKind::Region) */ }, // Полагаю, для функций тут Region?
25// }});
26// }
27// return folding_ranges;
28//}