summaryrefslogtreecommitdiff
path: root/src/model/value.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-01-27 12:05:00 +0100
committerLaurenz <laurmaedje@gmail.com>2023-01-27 12:05:12 +0100
commit43ef60c09cc48f6b7c6dd752ab7af7c0d6071bc5 (patch)
tree525320e583fc53e9474fd4b4d4944cdf8117d406 /src/model/value.rs
parentc56299c6bde121807c3febbef0766ff2fe2b32f2 (diff)
Tracing-based expression tooltips
Diffstat (limited to 'src/model/value.rs')
-rw-r--r--src/model/value.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/model/value.rs b/src/model/value.rs
index 15656c42..ba3a550f 100644
--- a/src/model/value.rs
+++ b/src/model/value.rs
@@ -155,6 +155,14 @@ impl Value {
_ => self.display(),
}
}
+
+ /// Try to extract documentation for the value.
+ pub fn docs(&self) -> Option<&'static str> {
+ match self {
+ Self::Func(func) => func.info().map(|info| info.docs),
+ _ => None,
+ }
+ }
}
impl Default for Value {