From 4833972067c00170269c7ee7a04f1a8ce1e1d15b Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Fri, 1 Jan 2021 17:22:23 +0100 Subject: Add support for Rust 2021. --- crates/ide/src/runnables.rs | 2 +- crates/ide/src/syntax_highlighting/injection.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ide') diff --git a/crates/ide/src/runnables.rs b/crates/ide/src/runnables.rs index 891183266..c893afc7c 100644 --- a/crates/ide/src/runnables.rs +++ b/crates/ide/src/runnables.rs @@ -230,7 +230,7 @@ impl TestAttr { const RUSTDOC_FENCE: &str = "```"; const RUSTDOC_CODE_BLOCK_ATTRIBUTES_RUNNABLE: &[&str] = - &["", "rust", "should_panic", "edition2015", "edition2018"]; + &["", "rust", "should_panic", "edition2015", "edition2018", "edition2021"]; fn has_runnable_doc_test(attrs: &hir::Attrs) -> bool { attrs.docs().map_or(false, |doc| { diff --git a/crates/ide/src/syntax_highlighting/injection.rs b/crates/ide/src/syntax_highlighting/injection.rs index 9eb184c74..3fd414f80 100644 --- a/crates/ide/src/syntax_highlighting/injection.rs +++ b/crates/ide/src/syntax_highlighting/injection.rs @@ -55,7 +55,7 @@ type RangesMap = BTreeMap; const RUSTDOC_FENCE: &'static str = "```"; const RUSTDOC_FENCE_TOKENS: &[&'static str] = - &["", "rust", "should_panic", "ignore", "no_run", "compile_fail", "edition2015", "edition2018"]; + &["", "rust", "should_panic", "ignore", "no_run", "compile_fail", "edition2015", "edition2018", "edition2021"]; /// Extracts Rust code from documentation comments as well as a mapping from /// the extracted source code back to the original source ranges. -- cgit v1.2.3 From 273d2f91234367bd1348a6c4d84df22fe35becf5 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Fri, 1 Jan 2021 17:31:32 +0100 Subject: Formatting. --- crates/ide/src/syntax_highlighting/injection.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'crates/ide') diff --git a/crates/ide/src/syntax_highlighting/injection.rs b/crates/ide/src/syntax_highlighting/injection.rs index 3fd414f80..6cbd683c6 100644 --- a/crates/ide/src/syntax_highlighting/injection.rs +++ b/crates/ide/src/syntax_highlighting/injection.rs @@ -54,8 +54,17 @@ pub(super) fn highlight_injection( type RangesMap = BTreeMap; const RUSTDOC_FENCE: &'static str = "```"; -const RUSTDOC_FENCE_TOKENS: &[&'static str] = - &["", "rust", "should_panic", "ignore", "no_run", "compile_fail", "edition2015", "edition2018", "edition2021"]; +const RUSTDOC_FENCE_TOKENS: &[&'static str] = &[ + "", + "rust", + "should_panic", + "ignore", + "no_run", + "compile_fail", + "edition2015", + "edition2018", + "edition2021", +]; /// Extracts Rust code from documentation comments as well as a mapping from /// the extracted source code back to the original source ranges. -- cgit v1.2.3