Skip to content

Commit

Permalink
Only push to id_to_location in LSP mode
Browse files Browse the repository at this point in the history
  • Loading branch information
asterite committed Jul 3, 2024
1 parent e1ebd06 commit bd1f855
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions compiler/noirc_frontend/src/node_interner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,10 @@ impl NodeInterner {

/// Stores the span for an interned expression.
pub fn push_expr_location(&mut self, expr_id: ExprId, span: Span, file: FileId) {
if !self.track_references {
return;
}

self.id_to_location.insert(expr_id.into(), Location::new(span, file));
}

Expand Down Expand Up @@ -1059,6 +1063,10 @@ impl NodeInterner {
}

pub fn push_stmt_location(&mut self, id: StmtId, span: Span, file: FileId) {
if !self.track_references {
return;
}

self.id_to_location.insert(id.into(), Location::new(span, file));
}

Expand Down

0 comments on commit bd1f855

Please sign in to comment.