OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library analyzer.test.src.context.abstract_context; | 5 library analyzer.test.src.context.abstract_context; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
9 import 'package:analyzer/dart/element/visitor.dart'; | 9 import 'package:analyzer/dart/element/visitor.dart'; |
10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 } | 156 } |
157 | 157 |
158 CompilationUnit resolveLibraryUnit(Source source) { | 158 CompilationUnit resolveLibraryUnit(Source source) { |
159 return context.resolveCompilationUnit2(source, source); | 159 return context.resolveCompilationUnit2(source, source); |
160 } | 160 } |
161 | 161 |
162 void setUp() { | 162 void setUp() { |
163 List<Plugin> plugins = <Plugin>[]; | 163 List<Plugin> plugins = <Plugin>[]; |
164 plugins.addAll(AnalysisEngine.instance.requiredPlugins); | 164 plugins.addAll(AnalysisEngine.instance.requiredPlugins); |
165 plugins.add(AnalysisEngine.instance.commandLinePlugin); | 165 plugins.add(AnalysisEngine.instance.commandLinePlugin); |
166 plugins.add(AnalysisEngine.instance.optionsPlugin); | |
167 | 166 |
168 ExtensionManager manager = new ExtensionManager(); | 167 ExtensionManager manager = new ExtensionManager(); |
169 manager.processPlugins(plugins); | 168 manager.processPlugins(plugins); |
170 | 169 |
171 prepareAnalysisContext(); | 170 prepareAnalysisContext(); |
172 } | 171 } |
173 | 172 |
174 void tearDown() {} | 173 void tearDown() {} |
175 } | 174 } |
176 | 175 |
177 /** | 176 /** |
178 * Wraps the given [_ElementVisitorFunction] into an instance of | 177 * Wraps the given [_ElementVisitorFunction] into an instance of |
179 * [GeneralizingElementVisitor]. | 178 * [GeneralizingElementVisitor]. |
180 */ | 179 */ |
181 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor { | 180 class _ElementVisitorFunctionWrapper extends GeneralizingElementVisitor { |
182 final _ElementVisitorFunction function; | 181 final _ElementVisitorFunction function; |
183 | 182 |
184 _ElementVisitorFunctionWrapper(this.function); | 183 _ElementVisitorFunctionWrapper(this.function); |
185 | 184 |
186 visitElement(Element element) { | 185 visitElement(Element element) { |
187 function(element); | 186 function(element); |
188 super.visitElement(element); | 187 super.visitElement(element); |
189 } | 188 } |
190 } | 189 } |
OLD | NEW |