documentSymbols method

Future<Map<String, Object?>> documentSymbols(
  1. String language,
  2. String source, {
  3. String? uri,
})

The document outline: hierarchical symbols with their source ranges.

Implementation

Future<Map<String, Object?>> documentSymbols(
  String language,
  String source, {
  String? uri,
}) => _withDoc(language, source, uri: uri, (lsp, docUri) async {
  final symbols = await lsp.documentSymbols(docUri);
  return <String, Object?>{
    'symbols': symbols.map((s) => s.toJson()).toList(),
    'isError': false,
  };
});