aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/assists
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-02-06 17:10:25 +0000
committerAleksey Kladov <[email protected]>2020-02-06 17:14:44 +0000
commit755077e3720bd97e1e506bf8fbe0a2534389f282 (patch)
tree11eb0c7c1c829228c546cd94c2e48331941c4891 /crates/ra_assists/src/assists
parentd1e8b8d134da802eecef5cbcd5486bd542ad75b5 (diff)
Doctest autoimport
Diffstat (limited to 'crates/ra_assists/src/assists')
-rw-r--r--crates/ra_assists/src/assists/auto_import.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/ra_assists/src/assists/auto_import.rs b/crates/ra_assists/src/assists/auto_import.rs
index 219051063..f16b08c43 100644
--- a/crates/ra_assists/src/assists/auto_import.rs
+++ b/crates/ra_assists/src/assists/auto_import.rs
@@ -18,14 +18,16 @@ use ra_ide_db::imports_locator::ImportsLocatorIde;
18// fn main() { 18// fn main() {
19// let map = HashMap<|>::new(); 19// let map = HashMap<|>::new();
20// } 20// }
21// # pub mod std { pub mod collections { pub struct HashMap { } } }
21// ``` 22// ```
22// -> 23// ->
23// ``` 24// ```
24// use std::collections::HashMap; 25// use std::collections::HashMap;
25// 26//
26// fn main() { 27// fn main() {
27// let map = HashMap<|>::new(); 28// let map = HashMap::new();
28// } 29// }
30// # pub mod std { pub mod collections { pub struct HashMap { } } }
29// ``` 31// ```
30pub(crate) fn auto_import(ctx: AssistCtx) -> Option<Assist> { 32pub(crate) fn auto_import(ctx: AssistCtx) -> Option<Assist> {
31 let path_to_import: ast::Path = ctx.find_node_at_offset()?; 33 let path_to_import: ast::Path = ctx.find_node_at_offset()?;