importsOf method
Returns a list of all the imports and parts of a file.
This has an option to include parts because in some contexts of this application parts are considered imports as they import from the main file.
Implementation
@override
List<List<dynamic>> importsOf(String fileId, {bool includeParts = true}) {
final List<List<dynamic>>? fileDirectives = directives[getParentSrc(fileId)];
if (fileDirectives == null) return const <List<dynamic>>[];
return List<List<dynamic>>.of(
fileDirectives.where((List<dynamic> e) {
if (e[GraphIndex.directiveType] == DirectiveStatement.import) {
return true;
} else if (includeParts && e[GraphIndex.directiveType] == DirectiveStatement.part) {
return true;
}
return false;
}),
);
}