Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

update analyzer API access #63

Merged
merged 1 commit into from
Apr 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions example/crawl_async_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'dart:isolate';
import 'package:analyzer/dart/analysis/analysis_context.dart';
import 'package:analyzer/dart/analysis/context_builder.dart';
import 'package:analyzer/dart/analysis/context_locator.dart';
import 'package:analyzer/dart/analysis/results.dart';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:graphs/graphs.dart';
import 'package:path/path.dart' as p;
Expand Down Expand Up @@ -58,8 +59,8 @@ Future<Iterable<Uri>> findImports(Uri from, Source source) async {
Future<CompilationUnit> parseUri(Uri uri) async {
var path = await pathForUri(uri);
var analysisSession = (await analysisContext).currentSession;
var parseResult = analysisSession.getParsedUnit(path);
return parseResult.unit;
var parseResult = analysisSession.getParsedUnit2(path);
return (parseResult as ParsedUnitResult).unit;
}

Future<String> pathForUri(Uri uri) async {
Expand Down