summaryrefslogtreecommitdiff
path: root/support/texlab/crates/highlights/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'support/texlab/crates/highlights/src/lib.rs')
-rw-r--r--support/texlab/crates/highlights/src/lib.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/support/texlab/crates/highlights/src/lib.rs b/support/texlab/crates/highlights/src/lib.rs
new file mode 100644
index 0000000000..1845da3907
--- /dev/null
+++ b/support/texlab/crates/highlights/src/lib.rs
@@ -0,0 +1,31 @@
+use base_db::FeatureParams;
+use rowan::{TextRange, TextSize};
+
+mod label;
+
+#[derive(Debug, PartialEq, Eq, Clone)]
+pub struct Highlight {
+ pub range: TextRange,
+ pub kind: HighlightKind,
+}
+
+#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)]
+pub enum HighlightKind {
+ Write,
+ Read,
+}
+
+#[derive(Debug)]
+pub struct HighlightParams<'a> {
+ pub feature: FeatureParams<'a>,
+ pub offset: TextSize,
+}
+
+pub fn find_all(params: HighlightParams) -> Vec<Highlight> {
+ let mut results = Vec::new();
+ label::find_highlights(&params, &mut results);
+ results
+}
+
+#[cfg(test)]
+mod tests;