Skip to content

Commit 0af8018

Browse files
committed
More renames
1 parent c82a864 commit 0af8018

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

crates/ty_ide/src/goto_references.rs renamed to crates/ty_ide/src/find_references.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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
};
@@ -154,23 +154,23 @@ result = calculate_sum(value=42)
154154
"
155155
def 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
);
@@ -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):
@@ -1471,7 +1471,7 @@ from utils import func
14711471
class DataProcessor:
14721472
def __init__(self):
14731473
self.multiplier = func
1474-
1474+
14751475
def process(self, value):
14761476
return func(value)
14771477
",
@@ -1542,7 +1542,7 @@ class DataProcessor:
15421542
"
15431543
class MyModel:
15441544
a<CURSOR>ttr = 42
1545-
1545+
15461546
def get_attribute(self):
15471547
return MyModel.attr
15481548
",

crates/ty_ide/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ mod doc_highlights;
99
mod docstring;
1010
mod document_symbols;
1111
mod find_node;
12+
mod find_references;
1213
mod goto;
1314
mod goto_declaration;
1415
mod goto_definition;
15-
mod goto_references;
1616
mod goto_type_definition;
1717
mod hover;
1818
mod importer;
@@ -32,8 +32,8 @@ pub use code_action::{QuickFix, code_actions};
3232
pub use completion::{Completion, CompletionKind, CompletionSettings, completion};
3333
pub use doc_highlights::document_highlights;
3434
pub use document_symbols::document_symbols;
35+
pub use find_references::find_references;
3536
pub use goto::{goto_declaration, goto_definition, goto_type_definition};
36-
pub use goto_references::goto_references;
3737
pub use hover::hover;
3838
pub use inlay_hints::{
3939
InlayHintKind, InlayHintLabel, InlayHintSettings, InlayHintTextEdit, inlay_hints,

crates/ty_server/src/server/api/requests/references.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl BackgroundDocumentRequestHandler for ReferencesRequestHandler {
5151

5252
let include_declaration = params.context.include_declaration;
5353

54-
let Some(references_result) = goto_references(db, file, offset, include_declaration) else {
54+
let Some(references_result) = find_references(db, file, offset, include_declaration) else {
5555
return Ok(None);
5656
};
5757

crates/ty_wasm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ impl Workspace {
351351

352352
let offset = position.to_text_size(&source, &index, self.position_encoding)?;
353353

354-
let Some(targets) = goto_references(&self.db, file_id.file, offset, true) else {
354+
let Some(targets) = find_references(&self.db, file_id.file, offset, true) else {
355355
return Ok(Vec::new());
356356
};
357357

0 commit comments

Comments
 (0)