getLSPFoldRanges method
Requests folding ranges for the given document.
Sends a textDocument/foldingRange request for filePath. The server
returns folding ranges (if supported) describing regions that can be
folded in the editor. This method returns the raw server response as a
map; examine response['result'] for the folding range list.
Implementation
Future<Map<String, dynamic>> getLSPFoldRanges(String filePath) async {
if (!capabilities.codeFolding) return {'result': []};
final response = await _sendRequest(
method: "textDocument/foldingRange",
params: {
'textDocument': {'uri': Uri.file(filePath).toString()},
},
);
return response;
}