aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion/src/completions
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-06-08 15:50:10 +0100
committerLukas Wirth <[email protected]>2021-06-08 15:50:10 +0100
commit1d74ef1d989b3d37f3f08d32e88670ee0f1f7ab6 (patch)
tree33560270745b1f2ad509612dc404683af7ffa6ed /crates/ide_completion/src/completions
parent590472607c9629fdd37e3f6f33dacfdc2a3f56cc (diff)
Don't complete values in type position
Diffstat (limited to 'crates/ide_completion/src/completions')
-rw-r--r--crates/ide_completion/src/completions/attribute.rs4
-rw-r--r--crates/ide_completion/src/completions/flyimport.rs3
-rw-r--r--crates/ide_completion/src/completions/unqualified_path.rs4
3 files changed, 3 insertions, 8 deletions
diff --git a/crates/ide_completion/src/completions/attribute.rs b/crates/ide_completion/src/completions/attribute.rs
index d3392100d..7f76e357e 100644
--- a/crates/ide_completion/src/completions/attribute.rs
+++ b/crates/ide_completion/src/completions/attribute.rs
@@ -69,7 +69,7 @@ fn complete_new_attribute(acc: &mut Completions, ctx: &CompletionContext, attrib
69 } 69 }
70 70
71 if is_inner || !attr_completion.prefer_inner { 71 if is_inner || !attr_completion.prefer_inner {
72 acc.add(item.build()); 72 item.add_to(acc);
73 } 73 }
74 }; 74 };
75 75
@@ -96,7 +96,7 @@ fn complete_new_attribute(acc: &mut Completions, ctx: &CompletionContext, attrib
96 if let Some(docs) = mac.docs(ctx.sema.db) { 96 if let Some(docs) = mac.docs(ctx.sema.db) {
97 item.documentation(docs); 97 item.documentation(docs);
98 } 98 }
99 acc.add(item.build()); 99 item.add_to(acc);
100 } 100 }
101 } 101 }
102 }); 102 });
diff --git a/crates/ide_completion/src/completions/flyimport.rs b/crates/ide_completion/src/completions/flyimport.rs
index 7bf47bf75..c010cbbca 100644
--- a/crates/ide_completion/src/completions/flyimport.rs
+++ b/crates/ide_completion/src/completions/flyimport.rs
@@ -90,7 +90,6 @@
90//! Note that having this flag set to `true` does not guarantee that the feature is enabled: your client needs to have the corredponding 90//! Note that having this flag set to `true` does not guarantee that the feature is enabled: your client needs to have the corredponding
91//! capability enabled. 91//! capability enabled.
92 92
93use hir::ModPath;
94use ide_db::helpers::{ 93use ide_db::helpers::{
95 import_assets::{ImportAssets, ImportCandidate}, 94 import_assets::{ImportAssets, ImportCandidate},
96 insert_use::ImportScope, 95 insert_use::ImportScope,
@@ -208,7 +207,7 @@ fn import_assets(ctx: &CompletionContext, fuzzy_name: String) -> Option<ImportAs
208} 207}
209 208
210fn compute_fuzzy_completion_order_key( 209fn compute_fuzzy_completion_order_key(
211 proposed_mod_path: &ModPath, 210 proposed_mod_path: &hir::ModPath,
212 user_input_lowercased: &str, 211 user_input_lowercased: &str,
213) -> usize { 212) -> usize {
214 cov_mark::hit!(certain_fuzzy_order_test); 213 cov_mark::hit!(certain_fuzzy_order_test);
diff --git a/crates/ide_completion/src/completions/unqualified_path.rs b/crates/ide_completion/src/completions/unqualified_path.rs
index 8b22933e0..f370dbdf0 100644
--- a/crates/ide_completion/src/completions/unqualified_path.rs
+++ b/crates/ide_completion/src/completions/unqualified_path.rs
@@ -339,7 +339,6 @@ fn x() -> $0
339"#, 339"#,
340 expect![[r#" 340 expect![[r#"
341 st Foo 341 st Foo
342 fn x() fn()
343 "#]], 342 "#]],
344 ); 343 );
345 } 344 }
@@ -391,7 +390,6 @@ pub mod prelude {
391} 390}
392"#, 391"#,
393 expect![[r#" 392 expect![[r#"
394 fn foo() fn()
395 md std 393 md std
396 st Option 394 st Option
397 "#]], 395 "#]],
@@ -448,7 +446,6 @@ pub mod prelude {
448} 446}
449"#, 447"#,
450 expect![[r#" 448 expect![[r#"
451 fn foo() fn()
452 md std 449 md std
453 md core 450 md core
454 st String 451 st String
@@ -509,7 +506,6 @@ macro_rules! foo { () => {} }
509fn main() { let x: $0 } 506fn main() { let x: $0 }
510"#, 507"#,
511 expect![[r#" 508 expect![[r#"
512 fn main() fn()
513 ma foo!(…) macro_rules! foo 509 ma foo!(…) macro_rules! foo
514 "#]], 510 "#]],
515 ); 511 );