aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/lib.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-02-06 17:50:11 +0000
committerGitHub <[email protected]>2020-02-06 17:50:11 +0000
commita4431e83025223d5aea0ae3d49a6356775cb5f75 (patch)
treeac72b45b25756f1ef95a552053a88285d2f2b4f5 /crates/ra_assists/src/lib.rs
parent918115c32e9a3882d1dd65f2403bd109fc64c798 (diff)
parent7e73b7a5f8d594a85627786a13e76d9d70163770 (diff)
Merge #3038
3038: Minor rename r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/lib.rs')
-rw-r--r--crates/ra_assists/src/lib.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_assists/src/lib.rs b/crates/ra_assists/src/lib.rs
index 1343043dd..3f3df3f96 100644
--- a/crates/ra_assists/src/lib.rs
+++ b/crates/ra_assists/src/lib.rs
@@ -59,7 +59,7 @@ impl ResolvedAssist {
59/// 59///
60/// Assists are returned in the "unresolved" state, that is only labels are 60/// Assists are returned in the "unresolved" state, that is only labels are
61/// returned, without actual edits. 61/// returned, without actual edits.
62pub fn applicable_assists(db: &RootDatabase, range: FileRange) -> Vec<AssistLabel> { 62pub fn unresolved_assists(db: &RootDatabase, range: FileRange) -> Vec<AssistLabel> {
63 AssistCtx::with_ctx(db, range, false, |ctx| { 63 AssistCtx::with_ctx(db, range, false, |ctx| {
64 assists::all() 64 assists::all()
65 .iter() 65 .iter()
@@ -76,7 +76,7 @@ pub fn applicable_assists(db: &RootDatabase, range: FileRange) -> Vec<AssistLabe
76/// 76///
77/// Assists are returned in the "resolved" state, that is with edit fully 77/// Assists are returned in the "resolved" state, that is with edit fully
78/// computed. 78/// computed.
79pub fn assists(db: &RootDatabase, range: FileRange) -> Vec<ResolvedAssist> { 79pub fn resolved_assists(db: &RootDatabase, range: FileRange) -> Vec<ResolvedAssist> {
80 AssistCtx::with_ctx(db, range, true, |ctx| { 80 AssistCtx::with_ctx(db, range, true, |ctx| {
81 let mut a = assists::all() 81 let mut a = assists::all()
82 .iter() 82 .iter()
@@ -301,7 +301,7 @@ mod tests {
301 use ra_syntax::TextRange; 301 use ra_syntax::TextRange;
302 use test_utils::{extract_offset, extract_range}; 302 use test_utils::{extract_offset, extract_range};
303 303
304 use crate::helpers; 304 use crate::{helpers, resolved_assists};
305 305
306 #[test] 306 #[test]
307 fn assist_order_field_struct() { 307 fn assist_order_field_struct() {
@@ -310,7 +310,7 @@ mod tests {
310 let (db, file_id) = helpers::with_single_file(&before); 310 let (db, file_id) = helpers::with_single_file(&before);
311 let frange = 311 let frange =
312 FileRange { file_id, range: TextRange::offset_len(before_cursor_pos, 0.into()) }; 312 FileRange { file_id, range: TextRange::offset_len(before_cursor_pos, 0.into()) };
313 let assists = super::assists(&db, frange); 313 let assists = resolved_assists(&db, frange);
314 let mut assists = assists.iter(); 314 let mut assists = assists.iter();
315 315
316 assert_eq!( 316 assert_eq!(
@@ -333,7 +333,7 @@ mod tests {
333 let (range, before) = extract_range(before); 333 let (range, before) = extract_range(before);
334 let (db, file_id) = helpers::with_single_file(&before); 334 let (db, file_id) = helpers::with_single_file(&before);
335 let frange = FileRange { file_id, range }; 335 let frange = FileRange { file_id, range };
336 let assists = super::assists(&db, frange); 336 let assists = resolved_assists(&db, frange);
337 let mut assists = assists.iter(); 337 let mut assists = assists.iter();
338 338
339 assert_eq!(assists.next().expect("expected assist").label.label, "Extract into variable"); 339 assert_eq!(assists.next().expect("expected assist").label.label, "Extract into variable");