diff --git a/fish-rust/src/ast.rs b/fish-rust/src/ast.rs index 992ee4daf..95c46383a 100644 --- a/fish-rust/src/ast.rs +++ b/fish-rust/src/ast.rs @@ -1952,6 +1952,9 @@ impl ArgumentOrRedirectionVariant { pub fn typ(&self) -> Type { self.embedded_node().typ() } + pub fn try_source_range(&self) -> Option { + self.embedded_node().try_source_range() + } fn embedded_node(&self) -> &dyn NodeMut { match self { ArgumentOrRedirectionVariant::Argument(node) => node, @@ -2045,6 +2048,9 @@ impl StatementVariant { pub fn typ(&self) -> Type { self.embedded_node().typ() } + pub fn try_source_range(&self) -> Option { + self.embedded_node().try_source_range() + } fn embedded_node(&self) -> &dyn NodeMut { match self { StatementVariant::None => panic!("cannot visit null statement"), @@ -2129,6 +2135,9 @@ impl BlockStatementHeaderVariant { pub fn typ(&self) -> Type { self.embedded_node().typ() } + pub fn try_source_range(&self) -> Option { + self.embedded_node().try_source_range() + } fn embedded_node(&self) -> &dyn NodeMut { match self { BlockStatementHeaderVariant::None => panic!("cannot visit null block header"),