diff options
author | Lukas Wirth <[email protected]> | 2020-09-16 19:33:08 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2020-09-16 19:33:08 +0100 |
commit | 45298b5d2a8e7d1f962f3117de27957e393c03e2 (patch) | |
tree | a084e63fd71cf28ea69a8ceb374f19aa9e111a4e /crates/assists/src/utils | |
parent | b874721752e07673f28ef07a003fe8582d4f1645 (diff) |
Add make::glob_use_tree function to create star-only UseTree
Diffstat (limited to 'crates/assists/src/utils')
-rw-r--r-- | crates/assists/src/utils/insert_use.rs | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/crates/assists/src/utils/insert_use.rs b/crates/assists/src/utils/insert_use.rs index 4972085d6..97ac6b832 100644 --- a/crates/assists/src/utils/insert_use.rs +++ b/crates/assists/src/utils/insert_use.rs | |||
@@ -233,15 +233,7 @@ fn recursive_merge( | |||
233 | None, | 233 | None, |
234 | false, | 234 | false, |
235 | ); | 235 | ); |
236 | use_trees.insert( | 236 | use_trees.insert(idx, make::glob_use_tree()); |
237 | idx, | ||
238 | make::use_tree( | ||
239 | make::path_unqualified(make::path_segment_self()), | ||
240 | None, | ||
241 | None, | ||
242 | true, | ||
243 | ), | ||
244 | ); | ||
245 | continue; | 237 | continue; |
246 | } | 238 | } |
247 | } | 239 | } |
@@ -806,14 +798,14 @@ use std::io;", | |||
806 | check_full( | 798 | check_full( |
807 | "token::TokenKind", | 799 | "token::TokenKind", |
808 | r"use token::TokenKind::*;", | 800 | r"use token::TokenKind::*;", |
809 | r"use token::TokenKind::{self::*, self};", | 801 | r"use token::TokenKind::{*, self};", |
810 | ) | 802 | ) |
811 | // FIXME: have it emit `use token::TokenKind::{self, *}`? | 803 | // FIXME: have it emit `use token::TokenKind::{self, *}`? |
812 | } | 804 | } |
813 | 805 | ||
814 | #[test] | 806 | #[test] |
815 | fn merge_self_glob() { | 807 | fn merge_self_glob() { |
816 | check_full("self", r"use self::*;", r"use self::{self::*, self};") | 808 | check_full("self", r"use self::*;", r"use self::{*, self};") |
817 | // FIXME: have it emit `use {self, *}`? | 809 | // FIXME: have it emit `use {self, *}`? |
818 | } | 810 | } |
819 | 811 | ||