| 311 | } |
| 312 | |
| 313 | fn symbol<'a>(&'a self, id: &str, before: Option<&'a Self>) -> Option<&'a Symbol> { |
| 314 | if self.ambiguous.contains(id) { |
| 315 | return None; |
| 316 | } |
| 317 | let current = self.symbols.get(id); |
| 318 | let symbol = current.or_else(|| before.and_then(|graph| graph.symbols.get(id)))?; |
| 319 | if let Some(file) = self.files.get(&symbol.location.path) { |
| 320 | if file |
| 321 | .globals |
| 322 | .get(&symbol.scope) |
| 323 | .is_some_and(|names| names.contains(&symbol.entity.name)) |
| 324 | { |
| 325 | return None; |
| 326 | } |
| 327 | } else if self.paths.contains(&symbol.location.path) { |
| 328 | return None; |
| 329 | } |
| 330 | Some(symbol) |
| 331 | } |
| 332 | |
| 333 | fn local( |
| 334 | &self, |