Skip to content

Commit

Permalink
Ignore ghost positions in position map
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-botbol committed Oct 29, 2024
1 parent f970359 commit 6487895
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions server/src/position_map.ml
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,14 @@ module Make (D : Data) = struct
(li, i), (lj, j)

let add pos data variables =
let itv = pos_to_itv pos in
FileMap.update (Pos.get_file pos)
(function
| None -> Some [Trie.Node { itv; data; children = [] }]
| Some trie -> Some (Trie.insert itv data trie))
variables
if pos = Pos.no_pos then variables
else
let itv = pos_to_itv pos in
FileMap.update (Pos.get_file pos)
(function
| None -> Some [Trie.Node { itv; data; children = [] }]
| Some trie -> Some (Trie.insert itv data trie))
variables

let lookup pos pmap =
let ( let* ) = Option.bind in
Expand Down

0 comments on commit 6487895

Please sign in to comment.