Add API to emit type-checking diagnostics (#12988)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Micha Reiser 2024-08-20 09:22:30 +02:00 committed by GitHub
parent 38c19fb96e
commit c65e3310d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 337 additions and 142 deletions

View file

@ -154,6 +154,10 @@ impl<'db> SemanticIndex<'db> {
&self.scopes[id]
}
pub(crate) fn scope_ids(&self) -> impl Iterator<Item = ScopeId> {
self.scope_ids_by_scope.iter().copied()
}
/// Returns the id of the parent scope.
pub(crate) fn parent_scope_id(&self, scope_id: FileScopeId) -> Option<FileScopeId> {
let scope = self.scope(scope_id);