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';
7
7
import 'dart:isolate' ;
8
8
9
9
import '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' ;
12
11
import 'package:analyzer/dart/analysis/results.dart' ;
13
12
import 'package:analyzer/dart/ast/ast.dart' ;
14
13
import 'package:glob/glob.dart' ;
@@ -66,11 +65,12 @@ class _ImportCheck {
66
65
final libPath = await _pathForUri (libUri);
67
66
final packagePath = p.dirname (libPath);
68
67
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 ' );
72
72
}
73
- return ContextBuilder (). createContext (contextRoot : roots[ 0 ]) ;
73
+ return contexts.first ;
74
74
}
75
75
76
76
static Future <String > _pathForUri (Uri uri) async {
You can’t perform that action at this time.
0 commit comments