aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/completion
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-10-02 15:13:48 +0100
committerAleksey Kladov <[email protected]>2020-10-02 16:31:20 +0100
commit09348b247465864c6462a39055803bcbb0156cfe (patch)
treed57122ddcaa21d6f4ea50204afc3e3bc341583fc /crates/ide/src/completion
parenteeb27f95f1025128f8a1d24a515eb009498a1d44 (diff)
Get rid of MockAnalysis
Diffstat (limited to 'crates/ide/src/completion')
-rw-r--r--crates/ide/src/completion/complete_keyword.rs8
-rw-r--r--crates/ide/src/completion/complete_mod.rs4
-rw-r--r--crates/ide/src/completion/complete_qualified_path.rs4
-rw-r--r--crates/ide/src/completion/complete_unqualified_path.rs14
-rw-r--r--crates/ide/src/completion/presentation.rs4
5 files changed, 17 insertions, 17 deletions
diff --git a/crates/ide/src/completion/complete_keyword.rs b/crates/ide/src/completion/complete_keyword.rs
index 5645b41fa..e59747095 100644
--- a/crates/ide/src/completion/complete_keyword.rs
+++ b/crates/ide/src/completion/complete_keyword.rs
@@ -495,13 +495,13 @@ Some multi-line comment<|>
495 fn test_completion_await_impls_future() { 495 fn test_completion_await_impls_future() {
496 check( 496 check(
497 r#" 497 r#"
498//- /main.rs 498//- /main.rs crate:main deps:std
499use std::future::*; 499use std::future::*;
500struct A {} 500struct A {}
501impl Future for A {} 501impl Future for A {}
502fn foo(a: A) { a.<|> } 502fn foo(a: A) { a.<|> }
503 503
504//- /std/lib.rs 504//- /std/lib.rs crate:std
505pub mod future { 505pub mod future {
506 #[lang = "future_trait"] 506 #[lang = "future_trait"]
507 pub trait Future {} 507 pub trait Future {}
@@ -514,14 +514,14 @@ pub mod future {
514 514
515 check( 515 check(
516 r#" 516 r#"
517//- /main.rs 517//- /main.rs crate:main deps:std
518use std::future::*; 518use std::future::*;
519fn foo() { 519fn foo() {
520 let a = async {}; 520 let a = async {};
521 a.<|> 521 a.<|>
522} 522}
523 523
524//- /std/lib.rs 524//- /std/lib.rs crate:std
525pub mod future { 525pub mod future {
526 #[lang = "future_trait"] 526 #[lang = "future_trait"]
527 pub trait Future { 527 pub trait Future {
diff --git a/crates/ide/src/completion/complete_mod.rs b/crates/ide/src/completion/complete_mod.rs
index 3cfc2e131..c7a99bdc3 100644
--- a/crates/ide/src/completion/complete_mod.rs
+++ b/crates/ide/src/completion/complete_mod.rs
@@ -300,7 +300,7 @@ mod tests {
300 // "#, 300 // "#,
301 // expect![[r#" 301 // expect![[r#"
302 // md bar; 302 // md bar;
303 // "#]], 303 // "#]],foo
304 // ); 304 // );
305 // } 305 // }
306 306
@@ -308,7 +308,7 @@ mod tests {
308 fn already_declared_bin_module_completion_omitted() { 308 fn already_declared_bin_module_completion_omitted() {
309 check( 309 check(
310 r#" 310 r#"
311 //- /src/bin.rs 311 //- /src/bin.rs crate:main
312 fn main() {} 312 fn main() {}
313 //- /src/bin/foo.rs 313 //- /src/bin/foo.rs
314 mod <|> 314 mod <|>
diff --git a/crates/ide/src/completion/complete_qualified_path.rs b/crates/ide/src/completion/complete_qualified_path.rs
index 00e89f0fd..2fafedd47 100644
--- a/crates/ide/src/completion/complete_qualified_path.rs
+++ b/crates/ide/src/completion/complete_qualified_path.rs
@@ -422,10 +422,10 @@ fn foo() { let _ = U::<|> }
422 fn completes_use_paths_across_crates() { 422 fn completes_use_paths_across_crates() {
423 check( 423 check(
424 r#" 424 r#"
425//- /main.rs 425//- /main.rs crate:main deps:foo
426use foo::<|>; 426use foo::<|>;
427 427
428//- /foo/lib.rs 428//- /foo/lib.rs crate:foo
429pub mod bar { pub struct S; } 429pub mod bar { pub struct S; }
430"#, 430"#,
431 expect![[r#" 431 expect![[r#"
diff --git a/crates/ide/src/completion/complete_unqualified_path.rs b/crates/ide/src/completion/complete_unqualified_path.rs
index 8eda4b64d..2010d9a2f 100644
--- a/crates/ide/src/completion/complete_unqualified_path.rs
+++ b/crates/ide/src/completion/complete_unqualified_path.rs
@@ -271,10 +271,10 @@ fn quux() { <|> }
271 fn completes_extern_prelude() { 271 fn completes_extern_prelude() {
272 check( 272 check(
273 r#" 273 r#"
274//- /lib.rs 274//- /lib.rs crate:main deps:other_crate
275use <|>; 275use <|>;
276 276
277//- /other_crate/lib.rs 277//- /other_crate/lib.rs crate:other_crate
278// nothing here 278// nothing here
279"#, 279"#,
280 expect![[r#" 280 expect![[r#"
@@ -350,10 +350,10 @@ fn foo() {
350 fn completes_prelude() { 350 fn completes_prelude() {
351 check( 351 check(
352 r#" 352 r#"
353//- /main.rs 353//- /main.rs crate:main deps:std
354fn foo() { let x: <|> } 354fn foo() { let x: <|> }
355 355
356//- /std/lib.rs 356//- /std/lib.rs crate:std
357#[prelude_import] 357#[prelude_import]
358use prelude::*; 358use prelude::*;
359 359
@@ -371,16 +371,16 @@ mod prelude { struct Option; }
371 fn completes_std_prelude_if_core_is_defined() { 371 fn completes_std_prelude_if_core_is_defined() {
372 check( 372 check(
373 r#" 373 r#"
374//- /main.rs 374//- /main.rs crate:main deps:core,std
375fn foo() { let x: <|> } 375fn foo() { let x: <|> }
376 376
377//- /core/lib.rs 377//- /core/lib.rs crate:core
378#[prelude_import] 378#[prelude_import]
379use prelude::*; 379use prelude::*;
380 380
381mod prelude { struct Option; } 381mod prelude { struct Option; }
382 382
383//- /std/lib.rs 383//- /std/lib.rs crate:std deps:core
384#[prelude_import] 384#[prelude_import]
385use prelude::*; 385use prelude::*;
386 386
diff --git a/crates/ide/src/completion/presentation.rs b/crates/ide/src/completion/presentation.rs
index 987cbfa7a..a5172b87e 100644
--- a/crates/ide/src/completion/presentation.rs
+++ b/crates/ide/src/completion/presentation.rs
@@ -1172,9 +1172,9 @@ fn foo(xs: Vec<i128>)
1172 check_edit( 1172 check_edit(
1173 "frobnicate!", 1173 "frobnicate!",
1174 r#" 1174 r#"
1175//- /main.rs 1175//- /main.rs crate:main deps:foo
1176use foo::<|>; 1176use foo::<|>;
1177//- /foo/lib.rs 1177//- /foo/lib.rs crate:foo
1178#[macro_export] 1178#[macro_export]
1179macro_rules frobnicate { () => () } 1179macro_rules frobnicate { () => () }
1180"#, 1180"#,