From 04e6cbfa35a72982bc200fe0ec1ee3359f5b07d9 Mon Sep 17 00:00:00 2001 From: Alex Kuzmin Date: Tue, 27 Aug 2024 16:58:13 +0800 Subject: [PATCH] Improve trait naming --- src/parser/ast/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/parser/ast/mod.rs b/src/parser/ast/mod.rs index 1a1ec198..a65c683b 100644 --- a/src/parser/ast/mod.rs +++ b/src/parser/ast/mod.rs @@ -142,12 +142,14 @@ impl PartialEq for DebugSymRef { } /// Interface of the debug symbol reference to use with the Chiquito language server -pub trait LanguageServerInterface { +pub trait Spanned { + /// Get span start fn get_start(&self) -> usize; + /// Get span end fn get_end(&self) -> usize; } -impl LanguageServerInterface for DebugSymRef { +impl Spanned for DebugSymRef { fn get_start(&self) -> usize { self.start } @@ -243,7 +245,7 @@ mod test { use codespan_reporting::files::SimpleFile; - use crate::parser::ast::{DebugSymRef, Identifier, LanguageServerInterface}; + use crate::parser::ast::{DebugSymRef, Identifier, Spanned}; #[test] fn test_language_server_interface() {