| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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_impl; | 5 library analyzer_impl; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 packageDirectory = getPackageDirectoryFor(sourceFile); | 152 packageDirectory = getPackageDirectoryFor(sourceFile); |
| 153 } | 153 } |
| 154 if (packageDirectory != null) { | 154 if (packageDirectory != null) { |
| 155 resolvers.add(new PackageUriResolver([packageDirectory])); | 155 resolvers.add(new PackageUriResolver([packageDirectory])); |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 sourceFactory = new SourceFactory(resolvers); | 158 sourceFactory = new SourceFactory(resolvers); |
| 159 context = AnalysisEngine.instance.createAnalysisContext(); | 159 context = AnalysisEngine.instance.createAnalysisContext(); |
| 160 context.sourceFactory = sourceFactory; | 160 context.sourceFactory = sourceFactory; |
| 161 // Uncomment the following to have errors reported on stdout and stderr | 161 // Uncomment the following to have errors reported on stdout and stderr |
| 162 // AnalysisEngine.instance.logger = new StdLogger(); | 162 if (options.verbose) { |
| 163 AnalysisEngine.instance.logger = new StdLogger(); |
| 164 } |
| 163 | 165 |
| 164 // set options for context | 166 // set options for context |
| 165 AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl(); | 167 AnalysisOptionsImpl contextOptions = new AnalysisOptionsImpl(); |
| 166 contextOptions.cacheSize = _MAX_CACHE_SIZE; | 168 contextOptions.cacheSize = _MAX_CACHE_SIZE; |
| 167 contextOptions.hint = !options.disableHints; | 169 contextOptions.hint = !options.disableHints; |
| 168 context.analysisOptions = contextOptions; | 170 context.analysisOptions = contextOptions; |
| 169 | 171 |
| 170 // Create and add a ChangeSet | 172 // Create and add a ChangeSet |
| 171 ChangeSet changeSet = new ChangeSet(); | 173 ChangeSet changeSet = new ChangeSet(); |
| 172 changeSet.addedSource(source); | 174 changeSet.addedSource(source); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 @override | 283 @override |
| 282 void logInformation(String message) { | 284 void logInformation(String message) { |
| 283 stdout.writeln(message); | 285 stdout.writeln(message); |
| 284 } | 286 } |
| 285 | 287 |
| 286 @override | 288 @override |
| 287 void logInformation2(String message, Exception exception) { | 289 void logInformation2(String message, Exception exception) { |
| 288 stdout.writeln(message); | 290 stdout.writeln(message); |
| 289 } | 291 } |
| 290 } | 292 } |
| OLD | NEW |