Skip to content

Commit

Permalink
augment corpus digraph logic to intake a vec of TextSource
Browse files Browse the repository at this point in the history
Reviewed By: tyao1

Differential Revision: D52217455

fbshipit-source-id: 7ee4990c8b63c17588d87f6bda1db27d0482a2d0
  • Loading branch information
monicatang authored and facebook-github-bot committed Jan 3, 2024
1 parent 06cb092 commit 1972913
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/crates/common/src/text_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1972913

Please sign in to comment.