Return the first namespace declared in a file. For single-namespace files this is the file's namespace. For multi-namespace files this returns the first block's namespace, which may not be correct for all positions in the file. Prefer [`namespace_at_offset`](Self::namespace_at_offset) when a cursor position is available.
(&self, uri: &str)
| 1664 | /// [`namespace_at_offset`](Self::namespace_at_offset) when a cursor |
| 1665 | /// position is available. |
| 1666 | pub(crate) fn first_file_namespace(&self, uri: &str) -> Option<String> { |
| 1667 | self.file_namespaces |
| 1668 | .read() |
| 1669 | .get(uri) |
| 1670 | .and_then(|spans| spans.first()) |
| 1671 | .and_then(|s| s.namespace.clone()) |
| 1672 | } |
| 1673 | |
| 1674 | /// Return the import table (short name → FQN) for a file. |
| 1675 | /// |
no test coverage detected