@@ -11,7 +11,7 @@ use std::result::Result::Ok;
1111
1212use aether_lsp_utils:: proto:: to_proto;
1313use aether_lsp_utils:: proto:: PositionEncoding ;
14- use aether_path :: FilePath ;
14+ use oak_db :: File ;
1515use stdext:: unwrap:: IntoResult ;
1616use tower_lsp:: lsp_types:: DocumentSymbol ;
1717use tower_lsp:: lsp_types:: DocumentSymbolParams ;
@@ -21,7 +21,6 @@ use tower_lsp::lsp_types::SymbolInformation;
2121use tower_lsp:: lsp_types:: SymbolKind ;
2222use tower_lsp:: lsp_types:: WorkspaceSymbolParams ;
2323use tree_sitter:: Node ;
24- use url:: Url ;
2524
2625use crate :: lsp:: ark_file:: ArkFile ;
2726use crate :: lsp:: db:: ArkDb ;
@@ -68,15 +67,17 @@ pub(crate) fn symbols(
6867 let encoding = state. config . position_encoding ;
6968 let mut info: Vec < SymbolInformation > = Vec :: new ( ) ;
7069
71- indexer:: map ( db, |uri , symbol, entry| {
70+ indexer:: map ( db, |file , symbol, entry| {
7271 if !symbol. fuzzy_matches ( query) {
7372 return ;
7473 }
7574
76- let Some ( range) = index_range_to_lsp_range ( db, uri , entry. range , encoding) else {
75+ let Some ( range) = index_range_to_lsp_range ( db, file , entry. range , encoding) else {
7776 return ;
7877 } ;
7978
79+ let uri = state. wire_url ( file) ;
80+
8081 match & entry. data {
8182 IndexEntryData :: Function { name, arguments : _ } => {
8283 info. push ( SymbolInformation {
@@ -142,16 +143,14 @@ pub(crate) fn symbols(
142143}
143144
144145/// 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.
146+ /// the file's line index from the db. Returns `None` if the points fall outside
147+ /// the line index, in which case the symbol is dropped from the results.
148148fn index_range_to_lsp_range (
149149 db : & dyn ArkDb ,
150- uri : & Url ,
150+ file : File ,
151151 range : indexer:: IndexRange ,
152152 encoding : PositionEncoding ,
153153) -> Option < Range > {
154- let file = db. file_by_path ( & FilePath :: from_url ( uri) ) ?;
155154 let line_index = file. line_index ( db) ;
156155
157156 let to_position = |point : indexer:: IndexPoint | {
0 commit comments