Look up the most recent variable definition before `cursor_offset` in the precomputed symbol map for `uri`. Returns a cloned [`VarDefSite`] (if found) so that the mutex lock is not held across the resolution logic.
(
&self,
uri: &str,
var_name: &str,
cursor_offset: u32,
)
| 102 | /// Returns a cloned [`VarDefSite`] (if found) so that the mutex lock |
| 103 | /// is not held across the resolution logic. |
| 104 | fn lookup_var_definition( |
| 105 | &self, |
| 106 | uri: &str, |
| 107 | var_name: &str, |
| 108 | cursor_offset: u32, |
| 109 | ) -> Option<crate::symbol_map::VarDefSite> { |
| 110 | let maps = self.symbol_maps.read(); |
| 111 | let map = maps.get(uri)?; |
| 112 | let scope_start = map.find_enclosing_scope(cursor_offset); |
| 113 | map.find_var_definition(var_name, cursor_offset, scope_start) |
| 114 | .cloned() |
| 115 | } |
| 116 | |
| 117 | /// If the cursor is physically sitting on a variable definition token |
| 118 | /// (assignment LHS, parameter, foreach binding, etc.), return the |
no test coverage detected