File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ import 'dart:io';
77import 'dart:isolate' ;
88
99import 'package:analyzer/dart/analysis/analysis_context.dart' ;
10- import 'package:analyzer/dart/analysis/context_builder.dart' ;
11- import 'package:analyzer/dart/analysis/context_locator.dart' ;
10+ import 'package:analyzer/dart/analysis/analysis_context_collection.dart' ;
1211import 'package:analyzer/dart/analysis/results.dart' ;
1312import 'package:analyzer/dart/ast/ast.dart' ;
1413import 'package:glob/glob.dart' ;
@@ -66,11 +65,12 @@ class _ImportCheck {
6665 final libPath = await _pathForUri (libUri);
6766 final packagePath = p.dirname (libPath);
6867
69- final roots = ContextLocator ().locateRoots (includedPaths: [packagePath]);
70- if (roots.length != 1 ) {
71- throw StateError ('Expected to find exactly one context root, got $roots ' );
68+ final contexts =
69+ AnalysisContextCollection (includedPaths: [packagePath]).contexts;
70+ if (contexts.length != 1 ) {
71+ throw StateError ('Expected to find exactly one context, got $contexts ' );
7272 }
73- return ContextBuilder (). createContext (contextRoot : roots[ 0 ]) ;
73+ return contexts.first ;
7474 }
7575
7676 static Future <String > _pathForUri (Uri uri) async {
You can’t perform that action at this time.
0 commit comments