99
1010use std:: result:: Result :: Ok ;
1111
12- use aether_lsp_utils:: proto:: to_proto;
13- use aether_lsp_utils:: proto:: PositionEncoding ;
14- use aether_path:: FilePath ;
1512use stdext:: unwrap:: IntoResult ;
1613use tower_lsp:: lsp_types:: DocumentSymbol ;
1714use tower_lsp:: lsp_types:: DocumentSymbolParams ;
@@ -21,7 +18,6 @@ use tower_lsp::lsp_types::SymbolInformation;
2118use tower_lsp:: lsp_types:: SymbolKind ;
2219use tower_lsp:: lsp_types:: WorkspaceSymbolParams ;
2320use tree_sitter:: Node ;
24- use url:: Url ;
2521
2622use crate :: lsp:: ark_file:: ArkFile ;
2723use crate :: lsp:: db:: ArkDb ;
@@ -73,7 +69,7 @@ pub(crate) fn symbols(
7369 return ;
7470 }
7571
76- let Some ( range) = index_range_to_lsp_range ( db, uri, entry. range , encoding) else {
72+ let Some ( range) = indexer :: index_range_to_lsp_range ( db, uri, entry. range , encoding) else {
7773 return ;
7874 } ;
7975
@@ -141,37 +137,6 @@ pub(crate) fn symbols(
141137 Ok ( info)
142138}
143139
144- /// Convert an index entry's tree-sitter point range to an LSP range, resolving
145- /// the file's line index from the db. Returns `None` if the file is no longer
146- /// in the db or the points fall outside it, in which case the symbol is
147- /// dropped from the results.
148- fn index_range_to_lsp_range (
149- db : & dyn ArkDb ,
150- uri : & Url ,
151- range : indexer:: IndexRange ,
152- encoding : PositionEncoding ,
153- ) -> Option < Range > {
154- let file = db. file_by_path ( & FilePath :: from_url ( uri) ) ?;
155- let line_index = file. line_index ( db) ;
156-
157- let to_position = |point : indexer:: IndexPoint | {
158- to_proto:: position_from_line_col (
159- biome_line_index:: LineCol {
160- line : point. row ,
161- col : point. column ,
162- } ,
163- line_index,
164- encoding,
165- )
166- . ok ( )
167- } ;
168-
169- Some ( Range :: new (
170- to_position ( range. start ) ?,
171- to_position ( range. end ) ?,
172- ) )
173- }
174-
175140/// Represents a section in the document with its title, level, range, and children
176141#[ derive( Debug ) ]
177142struct Section {
0 commit comments