Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/tests/expression.rs')
-rw-r--r--crates/ide-completion/src/tests/expression.rs78
1 files changed, 78 insertions, 0 deletions
diff --git a/crates/ide-completion/src/tests/expression.rs b/crates/ide-completion/src/tests/expression.rs
index 595c864ae3..eb99664c35 100644
--- a/crates/ide-completion/src/tests/expression.rs
+++ b/crates/ide-completion/src/tests/expression.rs
@@ -2964,6 +2964,84 @@ fn foo() {
}
#[test]
+fn flyimport_excluded_mod_items_from_flyimport() {
+ check_with_config(
+ CompletionConfig {
+ exclude_flyimport: vec![(
+ "ra_test_fixture::xpack::xmodule2".to_owned(),
+ AutoImportExclusionType::SubItems,
+ )],
+ ..TEST_CONFIG
+ },
+ r#"
+mod xpack {
+ mod xmodule1 {
+ pub struct XOther;
+ }
+ pub mod xmodule2 {
+ pub use super::xmodule1::*;
+ pub struct XStruct;
+ pub fn xfn() {}
+ }
+}
+
+fn foo() {
+ x$0
+}
+ "#,
+ expect![[r#"
+ ct CONST Unit
+ en Enum Enum
+ fn foo() fn()
+ fn function() fn()
+ ma makro!(…) macro_rules! makro
+ md module::
+ md xmodule2:: (use xpack::xmodule2)
+ md xpack::
+ sc STATIC Unit
+ st Record Record
+ st Tuple Tuple
+ st Unit Unit
+ un Union Union
+ ev TupleV(…) TupleV(u32)
+ bt u32 u32
+ kw async
+ kw const
+ kw crate::
+ kw enum
+ kw extern
+ kw false
+ kw fn
+ kw for
+ kw if
+ kw if let
+ kw impl
+ kw impl for
+ kw let
+ kw letm
+ kw loop
+ kw match
+ kw mod
+ kw return
+ kw self::
+ kw static
+ kw struct
+ kw trait
+ kw true
+ kw type
+ kw union
+ kw unsafe
+ kw use
+ kw while
+ kw while let
+ sn macro_rules
+ sn pd
+ sn ppd
+ "#]],
+ );
+}
+
+#[test]
fn excluded_trait_method_is_excluded_from_path_completion() {
check_with_config(
CompletionConfig {