@@ -127,7 +127,7 @@ impl SearchScope {
127127 }
128128
129129 /// Build a search scope spanning the given module and all its submodules.
130- fn module_and_children ( db : & RootDatabase , module : hir:: Module ) -> SearchScope {
130+ pub fn module_and_children ( db : & RootDatabase , module : hir:: Module ) -> SearchScope {
131131 let mut entries = IntMap :: default ( ) ;
132132
133133 let ( file_id, range) = {
@@ -329,7 +329,7 @@ impl Definition {
329329pub struct FindUsages < ' a > {
330330 def : Definition ,
331331 sema : & ' a Semantics < ' a , RootDatabase > ,
332- scope : Option < SearchScope > ,
332+ scope : Option < & ' a SearchScope > ,
333333 /// The container of our definition should it be an assoc item
334334 assoc_item_container : Option < hir:: AssocItemContainer > ,
335335 /// whether to search for the `Self` type of the definition
@@ -338,7 +338,7 @@ pub struct FindUsages<'a> {
338338 search_self_mod : bool ,
339339}
340340
341- impl FindUsages < ' _ > {
341+ impl < ' a > FindUsages < ' a > {
342342 /// Enable searching for `Self` when the definition is a type or `self` for modules.
343343 pub fn include_self_refs ( mut self ) -> Self {
344344 self . include_self_kw_refs = def_to_ty ( self . sema , & self . def ) ;
@@ -347,12 +347,12 @@ impl FindUsages<'_> {
347347 }
348348
349349 /// Limit the search to a given [`SearchScope`].
350- pub fn in_scope ( self , scope : SearchScope ) -> Self {
350+ pub fn in_scope ( self , scope : & ' a SearchScope ) -> Self {
351351 self . set_scope ( Some ( scope) )
352352 }
353353
354354 /// Limit the search to a given [`SearchScope`].
355- pub fn set_scope ( mut self , scope : Option < SearchScope > ) -> Self {
355+ pub fn set_scope ( mut self , scope : Option < & ' a SearchScope > ) -> Self {
356356 assert ! ( self . scope. is_none( ) ) ;
357357 self . scope = scope;
358358 self
@@ -376,7 +376,7 @@ impl FindUsages<'_> {
376376 res
377377 }
378378
379- fn search ( & self , sink : & mut dyn FnMut ( FileId , FileReference ) -> bool ) {
379+ pub fn search ( & self , sink : & mut dyn FnMut ( FileId , FileReference ) -> bool ) {
380380 let _p = profile:: span ( "FindUsages:search" ) ;
381381 let sema = self . sema ;
382382
0 commit comments