@@ -8,6 +8,7 @@ mod goto_type_definition;
88mod hover;
99mod inlay_hints;
1010mod markup;
11+ mod references;
1112mod semantic_tokens;
1213mod signature_help;
1314mod stub_mapping;
@@ -18,6 +19,7 @@ pub use goto::{goto_declaration, goto_definition, goto_type_definition};
1819pub use hover:: hover;
1920pub use inlay_hints:: inlay_hints;
2021pub use markup:: MarkupKind ;
22+ pub use references:: references;
2123pub use semantic_tokens:: {
2224 SemanticToken , SemanticTokenModifier , SemanticTokenType , SemanticTokens , semantic_tokens,
2325} ;
@@ -86,6 +88,15 @@ pub struct NavigationTarget {
8688}
8789
8890impl NavigationTarget {
91+ /// Creates a new `NavigationTarget` where the focus and full range are identical.
92+ pub fn new ( file : File , range : TextRange ) -> Self {
93+ Self {
94+ file,
95+ focus_range : range,
96+ full_range : range,
97+ }
98+ }
99+
89100 pub fn file ( & self ) -> File {
90101 self . file
91102 }
@@ -291,6 +302,7 @@ mod tests {
291302 ) ) ;
292303
293304 let mut cursor: Option < Cursor > = None ;
305+
294306 for & Source {
295307 ref path,
296308 ref contents,
@@ -299,19 +311,19 @@ mod tests {
299311 {
300312 db. write_file ( path, contents)
301313 . expect ( "write to memory file system to be successful" ) ;
302- let Some ( offset) = cursor_offset else {
303- continue ;
304- } ;
305314
306315 let file = system_path_to_file ( & db, path) . expect ( "newly written file to existing" ) ;
307- // This assert should generally never trip, since
308- // we have an assert on `CursorTestBuilder::source`
309- // to ensure we never have more than one marker.
310- assert ! (
311- cursor. is_none( ) ,
312- "found more than one source that contains `<CURSOR>`"
313- ) ;
314- cursor = Some ( Cursor { file, offset } ) ;
316+
317+ if let Some ( offset) = cursor_offset {
318+ // This assert should generally never trip, since
319+ // we have an assert on `CursorTestBuilder::source`
320+ // to ensure we never have more than one marker.
321+ assert ! (
322+ cursor. is_none( ) ,
323+ "found more than one source that contains `<CURSOR>`"
324+ ) ;
325+ cursor = Some ( Cursor { file, offset } ) ;
326+ }
315327 }
316328
317329 let search_paths = SearchPathSettings :: new ( vec ! [ SystemPathBuf :: from( "/" ) ] )
0 commit comments