From d3188769e41a051df7f02395b43f11e5cedede0b Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sat, 1 Feb 2020 22:13:02 +0200 Subject: Auto import functions --- crates/ra_assists/src/assists/auto_import.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'crates/ra_assists/src/assists') diff --git a/crates/ra_assists/src/assists/auto_import.rs b/crates/ra_assists/src/assists/auto_import.rs index 932a52bff..8c483e2da 100644 --- a/crates/ra_assists/src/assists/auto_import.rs +++ b/crates/ra_assists/src/assists/auto_import.rs @@ -211,4 +211,28 @@ mod tests { }", ); } + + #[test] + fn function_import() { + check_assist_with_imports_locator( + auto_import, + TestImportsLocator::new, + r" + test_function<|> + + pub mod PubMod { + pub fn test_function() {}; + } + ", + r" + use PubMod::test_function; + + test_function<|> + + pub mod PubMod { + pub fn test_function() {}; + } + ", + ); + } } -- cgit v1.2.3