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.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/ide/src/syntax_highlighting/html.rs b/crates/ide/src/syntax_highlighting/html.rs index cd69a6eb23..9fd807f031 100644 --- a/crates/ide/src/syntax_highlighting/html.rs +++ b/crates/ide/src/syntax_highlighting/html.rs @@ -1,9 +1,7 @@ //! Renders a bit of code as HTML. -use hir::Semantics; -use ide_db::base_db::salsa::AsDynDatabase; +use hir::{EditionedFileId, Semantics}; use oorandom::Rand32; -use span::EditionedFileId; use stdx::format_to; use syntax::AstNode; @@ -16,10 +14,8 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo let sema = Semantics::new(db); let file_id = sema .attach_first_edition(file_id) - .unwrap_or_else(|| EditionedFileId::current_edition(file_id)); - let editioned_file_id_wrapper = - ide_db::base_db::EditionedFileId::new(db.as_dyn_database(), file_id); - let file = sema.parse(editioned_file_id_wrapper); + .unwrap_or_else(|| EditionedFileId::current_edition(db, file_id)); + let file = sema.parse(file_id); let file = file.syntax(); fn rainbowify(seed: u64) -> String { let mut rng = Rand32::new(seed); @@ -43,7 +39,7 @@ pub(crate) fn highlight_as_html(db: &RootDatabase, file_id: FileId, rainbow: boo macro_bang: true, syntactic_name_ref_highlighting: false, }, - file_id.into(), + file_id.file_id(db), None, ); let text = file.to_string(); |