Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/syntax_highlighting/html.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/html.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/crates/ide/src/syntax_highlighting/html.rs b/crates/ide/src/syntax_highlighting/html.rs
index 358ac9b4ef..74567e8213 100644
--- a/crates/ide/src/syntax_highlighting/html.rs
+++ b/crates/ide/src/syntax_highlighting/html.rs
@@ -1,6 +1,7 @@
//! Renders a bit of code as HTML.
-use hir::{EditionedFileId, Semantics};
+use hir::Semantics;
+use ide_db::MiniCore;
use oorandom::Rand32;
use stdx::format_to;
use syntax::AstNode;
@@ -12,14 +13,12 @@ use crate::{
pub(crate) fn highlight_as_html_with_config(
db: &RootDatabase,
- config: HighlightConfig,
+ config: &HighlightConfig<'_>,
file_id: FileId,
rainbow: bool,
) -> String {
let sema = Semantics::new(db);
- let file_id = sema
- .attach_first_edition(file_id)
- .unwrap_or_else(|| EditionedFileId::current_edition(db, file_id));
+ let file_id = sema.attach_first_edition(file_id);
let file = sema.parse(file_id);
let file = file.syntax();
fn rainbowify(seed: u64) -> String {
@@ -60,7 +59,7 @@ pub(crate) fn highlight_as_html_with_config(
pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: bool) -> String {
highlight_as_html_with_config(
db,
- HighlightConfig {
+ &HighlightConfig {
strings: true,
comments: true,
punctuation: true,
@@ -70,6 +69,7 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo
inject_doc_comment: true,
macro_bang: true,
syntactic_name_ref_highlighting: false,
+ minicore: MiniCore::default(),
},
file_id,
rainbow,
@@ -119,6 +119,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd
.reference { font-style: italic; font-weight: bold; }
.const { font-weight: bolder; }
.unsafe { color: #BC8383; }
+.deprecated { text-decoration: line-through; }
.invalid_escape_sequence { color: #FC5555; text-decoration: wavy underline; }
.unresolved_reference { color: #FC5555; text-decoration: wavy underline; }