From 45298b5d2a8e7d1f962f3117de27957e393c03e2 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 16 Sep 2020 20:33:08 +0200 Subject: Add make::glob_use_tree function to create star-only UseTree --- crates/assists/src/utils/insert_use.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'crates/assists') 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( None, false, ); - use_trees.insert( - idx, - make::use_tree( - make::path_unqualified(make::path_segment_self()), - None, - None, - true, - ), - ); + use_trees.insert(idx, make::glob_use_tree()); continue; } } @@ -806,14 +798,14 @@ use std::io;", check_full( "token::TokenKind", r"use token::TokenKind::*;", - r"use token::TokenKind::{self::*, self};", + r"use token::TokenKind::{*, self};", ) // FIXME: have it emit `use token::TokenKind::{self, *}`? } #[test] fn merge_self_glob() { - check_full("self", r"use self::*;", r"use self::{self::*, self};") + check_full("self", r"use self::*;", r"use self::{*, self};") // FIXME: have it emit `use {self, *}`? } -- cgit v1.2.3