OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 | 6 |
| 7 import 'package:analyzer/dart/analysis/session.dart'; |
7 import 'package:analyzer/dart/ast/ast.dart'; | 8 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
9 import 'package:analyzer/dart/element/visitor.dart'; | 10 import 'package:analyzer/dart/element/visitor.dart'; |
10 import 'package:analyzer/exception/exception.dart'; | 11 import 'package:analyzer/exception/exception.dart'; |
11 import 'package:analyzer/file_system/file_system.dart'; | 12 import 'package:analyzer/file_system/file_system.dart'; |
12 import 'package:analyzer/file_system/memory_file_system.dart'; | 13 import 'package:analyzer/file_system/memory_file_system.dart'; |
13 import 'package:analyzer/source/package_map_resolver.dart'; | 14 import 'package:analyzer/source/package_map_resolver.dart'; |
14 import 'package:analyzer/src/dart/analysis/driver.dart'; | 15 import 'package:analyzer/src/dart/analysis/driver.dart'; |
15 import 'package:analyzer/src/dart/analysis/file_state.dart'; | 16 import 'package:analyzer/src/dart/analysis/file_state.dart'; |
16 import 'package:analyzer/src/generated/engine.dart'; | 17 import 'package:analyzer/src/generated/engine.dart'; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 FileContentOverlay _fileContentOverlay = new FileContentOverlay(); | 55 FileContentOverlay _fileContentOverlay = new FileContentOverlay(); |
55 AnalysisDriver _driver; | 56 AnalysisDriver _driver; |
56 | 57 |
57 AnalysisDriver get driver => _driver; | 58 AnalysisDriver get driver => _driver; |
58 | 59 |
59 /** | 60 /** |
60 * Return `true` if strong mode should be enabled for this test. | 61 * Return `true` if strong mode should be enabled for this test. |
61 */ | 62 */ |
62 bool get enableStrongMode => false; | 63 bool get enableStrongMode => false; |
63 | 64 |
| 65 /** |
| 66 * Return the analysis session associated with the driver. |
| 67 */ |
| 68 AnalysisSession get session => driver.currentSession; |
| 69 |
64 Source addMetaPackageSource() => addPackageSource( | 70 Source addMetaPackageSource() => addPackageSource( |
65 'meta', | 71 'meta', |
66 'meta.dart', | 72 'meta.dart', |
67 r''' | 73 r''' |
68 library meta; | 74 library meta; |
69 | 75 |
70 const Required required = const Required(); | 76 const Required required = const Required(); |
71 | 77 |
72 class Required { | 78 class Required { |
73 final String reason; | 79 final String reason; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 final _ElementVisitorFunction function; | 185 final _ElementVisitorFunction function; |
180 | 186 |
181 _ElementVisitorFunctionWrapper(this.function); | 187 _ElementVisitorFunctionWrapper(this.function); |
182 | 188 |
183 @override | 189 @override |
184 visitElement(Element element) { | 190 visitElement(Element element) { |
185 function(element); | 191 function(element); |
186 super.visitElement(element); | 192 super.visitElement(element); |
187 } | 193 } |
188 } | 194 } |
OLD | NEW |