Skip to content

Commit 727555f

Browse files
committed
Add excluded extern-prelude IDE resolution test
1 parent a898493 commit 727555f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

crates/ide/src/syntax_highlighting/test_data/highlight_extern_crate.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
.invalid_escape_sequence { color: #FC5555; text-decoration: wavy underline; }
4646
.unresolved_reference { color: #FC5555; text-decoration: wavy underline; }
4747
</style>
48-
<pre><code><span class="keyword">extern</span> <span class="keyword">crate</span> <span class="module crate_root default_library library">std</span><span class="semicolon">;</span>
48+
<pre><code><span class="keyword">extern</span> <span class="keyword">crate</span> <span class="self_keyword crate_root public">self</span> <span class="keyword">as</span> <span class="module crate_root declaration">this</span><span class="semicolon">;</span>
49+
<span class="keyword">extern</span> <span class="keyword">crate</span> <span class="module crate_root default_library library">std</span><span class="semicolon">;</span>
4950
<span class="keyword">extern</span> <span class="keyword">crate</span> <span class="module crate_root default_library library">alloc</span> <span class="keyword">as</span> <span class="module crate_root declaration">abc</span><span class="semicolon">;</span>
5051
<span class="keyword">extern</span> <span class="keyword">crate</span> <span class="unresolved_reference">unresolved</span> <span class="keyword">as</span> <span class="module crate_root declaration">definitely_unresolved</span><span class="semicolon">;</span>
52+
<span class="keyword">extern</span> <span class="keyword">crate</span> <span class="unresolved_reference">test</span> <span class="keyword">as</span> <span class="module crate_root declaration">opt_in_crate</span><span class="semicolon">;</span>
5153
</code></pre>

crates/ide/src/syntax_highlighting/tests.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -874,14 +874,18 @@ pub fn block_comments2() {}
874874
fn test_extern_crate() {
875875
check_highlighting(
876876
r#"
877-
//- /main.rs crate:main deps:std,alloc
877+
//- /main.rs crate:main deps:std,alloc,test extern-prelude:std,alloc
878+
extern crate self as this;
878879
extern crate std;
879880
extern crate alloc as abc;
880881
extern crate unresolved as definitely_unresolved;
882+
extern crate test as opt_in_crate;
881883
//- /std/lib.rs crate:std
882884
pub struct S;
883885
//- /alloc/lib.rs crate:alloc
884-
pub struct A
886+
pub struct A;
887+
//- /test/lib.rs crate:test
888+
pub struct T;
885889
"#,
886890
expect_file!["./test_data/highlight_extern_crate.html"],
887891
false,

0 commit comments

Comments
 (0)