runResolved method
Runs the scan with full type/element resolution and returns all
diagnostics found. Returns null under the same no-config / unknown-tier
conditions as run.
Resolution rewrites implicit constructor calls (File('x')) into
InstanceCreationExpression nodes and supplies a real typeProvider/
typeSystem, so rules that run silently misses fire here. The cost: it
builds an AnalysisContextCollection and resolves each unit, which is
materially slower and requires the target project to have had pub get
run (otherwise units fail to resolve and are skipped with a message).
Implementation
Future<List<ScanDiagnostic>?> runResolved() async {
// Reset per-run state so a reused ScanRunner doesn't carry stale counts.
_skippedFileCount = 0;
// Disable the Problems-tab cap when the caller requests complete output.
final cap = _applyIssueCap();
final plan = _prepare();
if (plan == null) return null;
if (plan.files.isEmpty) return const [];
final registrations = _registerRules(
plan.rules,
() => ResolvedScanRuleContext(definingUnit: _dummyContextUnit()),
);
final result = await _scanFilesResolved(plan.files, registrations);
_noteIssueCap(cap);
return result;
}