From 1972913c2d12d5b01245eb77290f1fa2d22d2408 Mon Sep 17 00:00:00 2001 From: Monica Tang Date: Tue, 2 Jan 2024 16:11:43 -0800 Subject: [PATCH] augment corpus digraph logic to intake a vec of TextSource Reviewed By: tyao1 Differential Revision: D52217455 fbshipit-source-id: 7ee4990c8b63c17588d87f6bda1db27d0482a2d0 --- compiler/crates/common/src/text_source.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/crates/common/src/text_source.rs b/compiler/crates/common/src/text_source.rs index e4b2063e76f1c..42f8410ac95b6 100644 --- a/compiler/crates/common/src/text_source.rs +++ b/compiler/crates/common/src/text_source.rs @@ -71,6 +71,10 @@ impl TextSource { Range::new(start_position, end_position) } + /** + * Converts span, which is the relative indices of characters within this text source, + * into the equivalent line and character number range. + */ pub fn to_span_range(&self, span: Span) -> lsp_types::Range { let start = span.start as usize; let end = span.end as usize;