From 7ab8326cbfba56b6419f66d8f50f4131c455512f Mon Sep 17 00:00:00 2001 From: Sunli Date: Thu, 14 May 2020 17:35:25 +0800 Subject: [PATCH] Add Context::position --- src/context.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/context.rs b/src/context.rs index 33b2d6ff..e2246a6e 100644 --- a/src/context.rs +++ b/src/context.rs @@ -516,4 +516,9 @@ impl<'a> ContextBase<'a, &'a Positioned> { .map(|alias| alias.node) .unwrap_or_else(|| self.item.name.node) } + + /// Get the position of the current field in the query code. + pub fn position(&self) -> Pos { + self.pos + } }