Trait apollo_compiler::database::AstDatabase
source · pub trait AstDatabase: Database + HasQueryGroup<AstStorage> + InputDatabase {
// Required methods
fn ast(&self, key0: FileId) -> SyntaxTree;
fn document(&self, key0: FileId) -> GreenNode;
fn syntax_errors(&self) -> Vec<ApolloDiagnostic>;
}
Required Methods§
sourcefn ast(&self, key0: FileId) -> SyntaxTree
fn ast(&self, key0: FileId) -> SyntaxTree
Get an AST for a particular file. Returns a rowan
SyntaxTree. The
SyntaxTree can be safely shared between threads as it’s Send
and
Sync
.
sourcefn document(&self, key0: FileId) -> GreenNode
fn document(&self, key0: FileId) -> GreenNode
Get a file’s GraphQL Document. Returns a rowan
Green Node. This is the
top level document node that can be used when going between an
SyntaxNodePtr to an actual SyntaxNode.
sourcefn syntax_errors(&self) -> Vec<ApolloDiagnostic>
fn syntax_errors(&self) -> Vec<ApolloDiagnostic>
Get syntax errors found in the compiler’s manifest.