aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/syntax_highlighting
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-08-10 00:16:58 +0100
committerGitHub <[email protected]>2020-08-10 00:16:58 +0100
commit7a03f05eac4ff1e9ca4ceeced54ce06892bd30b8 (patch)
tree2a8074952398d7d72d8a83ddda35785c4821e20b /crates/ra_ide/src/syntax_highlighting
parentb1cb4ac13d5b625dd497692b6396287a30ff12e2 (diff)
parentbf9b4578bbe038501ef7c337e22b448de477f61c (diff)
Merge #5692
5692: Add support for extern crate r=jonas-schievink a=Nashenas88 This adds syntax highlighting, hover and goto def functionality for extern crate. Fixes #5690 Co-authored-by: Paul Daniel Faria <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/syntax_highlighting')
-rw-r--r--crates/ra_ide/src/syntax_highlighting/tests.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs
index 730efff0d..09062c38e 100644
--- a/crates/ra_ide/src/syntax_highlighting/tests.rs
+++ b/crates/ra_ide/src/syntax_highlighting/tests.rs
@@ -391,6 +391,23 @@ macro_rules! noop {
391 ); 391 );
392} 392}
393 393
394#[test]
395fn test_extern_crate() {
396 check_highlighting(
397 r#"
398 //- /main.rs
399 extern crate std;
400 extern crate alloc as abc;
401 //- /std/lib.rs
402 pub struct S;
403 //- /alloc/lib.rs
404 pub struct A
405 "#,
406 expect_file!["crates/ra_ide/test_data/highlight_extern_crate.html"],
407 false,
408 );
409}
410
394/// Highlights the code given by the `ra_fixture` argument, renders the 411/// Highlights the code given by the `ra_fixture` argument, renders the
395/// result as HTML, and compares it with the HTML file given as `snapshot`. 412/// result as HTML, and compares it with the HTML file given as `snapshot`.
396/// Note that the `snapshot` file is overwritten by the rendered HTML. 413/// Note that the `snapshot` file is overwritten by the rendered HTML.