@@ -7,7 +7,7 @@ use ty_python_semantic::SemanticModel;
77
88/// Find all references to a symbol at the given position.
99/// Search for references across all files in the project.
10- pub fn goto_references (
10+ pub fn find_references (
1111 db : & dyn Db ,
1212 file : File ,
1313 offset : TextSize ,
@@ -41,7 +41,7 @@ mod tests {
4141 impl CursorTest {
4242 fn references ( & self ) -> String {
4343 let Some ( mut reference_results) =
44- goto_references ( & self . db , self . cursor . file , self . cursor . offset , true )
44+ find_references ( & self . db , self . cursor . file , self . cursor . offset , true )
4545 else {
4646 return "No references found" . to_string ( ) ;
4747 } ;
@@ -84,7 +84,7 @@ mod tests {
8484 }
8585
8686 #[ test]
87- fn test_parameter_references_in_function ( ) {
87+ fn parameter_references_in_function ( ) {
8888 let test = cursor_test (
8989 "
9090def calculate_sum(<CURSOR>value: int) -> int:
@@ -149,28 +149,28 @@ result = calculate_sum(value=42)
149149 }
150150
151151 #[ test]
152- fn test_nonlocal_variable_references ( ) {
152+ fn nonlocal_variable_references ( ) {
153153 let test = cursor_test (
154154 "
155155def outer_function():
156156 coun<CURSOR>ter = 0
157-
157+
158158 def increment():
159159 nonlocal counter
160160 counter += 1
161161 return counter
162-
162+
163163 def decrement():
164164 nonlocal counter
165165 counter -= 1
166166 return counter
167-
167+
168168 # Use counter in outer scope
169169 initial = counter
170170 increment()
171171 decrement()
172172 final = counter
173-
173+
174174 return increment, decrement
175175" ,
176176 ) ;
@@ -272,7 +272,7 @@ def outer_function():
272272 }
273273
274274 #[ test]
275- fn test_global_variable_references ( ) {
275+ fn global_variable_references ( ) {
276276 let test = cursor_test (
277277 "
278278glo<CURSOR>bal_counter = 0
@@ -389,7 +389,7 @@ final_value = global_counter
389389 }
390390
391391 #[ test]
392- fn test_except_handler_variable_references ( ) {
392+ fn except_handler_variable_references ( ) {
393393 let test = cursor_test (
394394 "
395395try:
@@ -450,7 +450,7 @@ except ValueError as err:
450450 }
451451
452452 #[ test]
453- fn test_pattern_match_as_references ( ) {
453+ fn pattern_match_as_references ( ) {
454454 let test = cursor_test (
455455 "
456456match x:
@@ -498,7 +498,7 @@ match x:
498498 }
499499
500500 #[ test]
501- fn test_pattern_match_mapping_rest_references ( ) {
501+ fn pattern_match_mapping_rest_references ( ) {
502502 let test = cursor_test (
503503 "
504504match data:
@@ -553,7 +553,7 @@ match data:
553553 }
554554
555555 #[ test]
556- fn test_function_definition_references ( ) {
556+ fn function_definition_references ( ) {
557557 let test = cursor_test (
558558 "
559559def my_func<CURSOR>tion():
@@ -632,7 +632,7 @@ value = my_function
632632 }
633633
634634 #[ test]
635- fn test_class_definition_references ( ) {
635+ fn class_definition_references ( ) {
636636 let test = cursor_test (
637637 "
638638class My<CURSOR>Class:
@@ -1105,7 +1105,7 @@ cls = MyClass
11051105 def __init__(self, pos, btn):
11061106 self.position: int = pos
11071107 self.button: str = btn
1108-
1108+
11091109 def my_func(event: Click):
11101110 match event:
11111111 case Click(x, button=a<CURSOR>b):
@@ -1144,7 +1144,7 @@ cls = MyClass
11441144 def __init__(self, pos, btn):
11451145 self.position: int = pos
11461146 self.button: str = btn
1147-
1147+
11481148 def my_func(event: Click):
11491149 match event:
11501150 case Click(x, button=ab):
@@ -1183,7 +1183,7 @@ cls = MyClass
11831183 def __init__(self, pos, btn):
11841184 self.position: int = pos
11851185 self.button: str = btn
1186-
1186+
11871187 def my_func(event: Click):
11881188 match event:
11891189 case Cl<CURSOR>ick(x, button=ab):
@@ -1233,7 +1233,7 @@ cls = MyClass
12331233 def __init__(self, pos, btn):
12341234 self.position: int = pos
12351235 self.button: str = btn
1236-
1236+
12371237 def my_func(event: Click):
12381238 match event:
12391239 case Click(x, but<CURSOR>ton=ab):
@@ -1445,7 +1445,7 @@ cls = MyClass
14451445 }
14461446
14471447 #[ test]
1448- fn test_multi_file_function_references ( ) {
1448+ fn multi_file_function_references ( ) {
14491449 let test = CursorTest :: builder ( )
14501450 . source (
14511451 "utils.py" ,
@@ -1471,7 +1471,7 @@ from utils import func
14711471class DataProcessor:
14721472 def __init__(self):
14731473 self.multiplier = func
1474-
1474+
14751475 def process(self, value):
14761476 return func(value)
14771477" ,
@@ -1535,14 +1535,14 @@ class DataProcessor:
15351535 }
15361536
15371537 #[ test]
1538- fn test_multi_file_class_attribute_references ( ) {
1538+ fn multi_file_class_attribute_references ( ) {
15391539 let test = CursorTest :: builder ( )
15401540 . source (
15411541 "models.py" ,
15421542 "
15431543class MyModel:
15441544 a<CURSOR>ttr = 42
1545-
1545+
15461546 def get_attribute(self):
15471547 return MyModel.attr
15481548" ,
@@ -1613,7 +1613,7 @@ def process_model():
16131613 }
16141614
16151615 #[ test]
1616- fn test_import_alias_references_should_not_resolve_to_original ( ) {
1616+ fn import_alias_references_should_not_resolve_to_original ( ) {
16171617 let test = CursorTest :: builder ( )
16181618 . source (
16191619 "original.py" ,
0 commit comments