diff options
Diffstat (limited to 'support/texlab/crates/hover')
-rw-r--r-- | support/texlab/crates/hover/Cargo.toml | 1 | ||||
-rw-r--r-- | support/texlab/crates/hover/src/citation.rs | 2 | ||||
-rw-r--r-- | support/texlab/crates/hover/src/label.rs | 2 | ||||
-rw-r--r-- | support/texlab/crates/hover/src/lib.rs | 12 | ||||
-rw-r--r-- | support/texlab/crates/hover/src/string_ref.rs | 2 |
5 files changed, 10 insertions, 9 deletions
diff --git a/support/texlab/crates/hover/Cargo.toml b/support/texlab/crates/hover/Cargo.toml index f92939dd24..0db19b8189 100644 --- a/support/texlab/crates/hover/Cargo.toml +++ b/support/texlab/crates/hover/Cargo.toml @@ -8,6 +8,7 @@ rust-version.workspace = true [dependencies] base-db = { path = "../base-db" } +bibtex-utils = { path = "../bibtex-utils" } citeproc = { path = "../citeproc" } completion-data = { path = "../completion-data" } rowan = "0.15.11" diff --git a/support/texlab/crates/hover/src/citation.rs b/support/texlab/crates/hover/src/citation.rs index d36370e709..49e5359bba 100644 --- a/support/texlab/crates/hover/src/citation.rs +++ b/support/texlab/crates/hover/src/citation.rs @@ -30,7 +30,7 @@ pub(super) fn find_hover<'db>(params: &HoverParams<'db>) -> Option<Hover<'db>> { let text = params.project.documents.iter().find_map(|document| { let data = document.data.as_bib()?; let root = bibtex::Root::cast(data.root_node())?; - let entry = root.find_entry(&name)?; + let entry = root.find_entry(name)?; citeproc::render(&entry) })?; diff --git a/support/texlab/crates/hover/src/label.rs b/support/texlab/crates/hover/src/label.rs index c5f72a287e..fc9694fc6c 100644 --- a/support/texlab/crates/hover/src/label.rs +++ b/support/texlab/crates/hover/src/label.rs @@ -20,7 +20,7 @@ pub(super) fn find_hover<'db>(params: &'db HoverParams<'db>) -> Option<Hover<'db .filter(|(_, label)| label.kind == tex::LabelKind::Definition) .find(|(_, label)| label.name_text() == cursor.object.name_text())?; - let label = render_label(¶ms.workspace, ¶ms.project, definition)?; + let label = render_label(params.workspace, ¶ms.project, definition)?; Some(Hover { range: cursor.range, data: HoverData::Label(label), diff --git a/support/texlab/crates/hover/src/lib.rs b/support/texlab/crates/hover/src/lib.rs index 4b06111603..88be3b919a 100644 --- a/support/texlab/crates/hover/src/lib.rs +++ b/support/texlab/crates/hover/src/lib.rs @@ -49,12 +49,12 @@ pub enum HoverData<'db> { } pub fn find<'db>(params: &'db HoverParams<'db>) -> Option<Hover<'db>> { - citation::find_hover(¶ms) - .or_else(|| package::find_hover(¶ms)) - .or_else(|| entry_type::find_hover(¶ms)) - .or_else(|| field_type::find_hover(¶ms)) - .or_else(|| label::find_hover(¶ms)) - .or_else(|| string_ref::find_hover(¶ms)) + citation::find_hover(params) + .or_else(|| package::find_hover(params)) + .or_else(|| entry_type::find_hover(params)) + .or_else(|| field_type::find_hover(params)) + .or_else(|| label::find_hover(params)) + .or_else(|| string_ref::find_hover(params)) } #[cfg(test)] diff --git a/support/texlab/crates/hover/src/string_ref.rs b/support/texlab/crates/hover/src/string_ref.rs index 64449909d7..7ea84113e0 100644 --- a/support/texlab/crates/hover/src/string_ref.rs +++ b/support/texlab/crates/hover/src/string_ref.rs @@ -1,4 +1,4 @@ -use citeproc::field::text::TextFieldData; +use bibtex_utils::field::text::TextFieldData; use rowan::ast::AstNode; use syntax::bibtex::{self, HasName, HasValue}; |