| 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.task.model; | 5 library analyzer.task.model; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:developer'; | 8 import 'dart:developer'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 * An [AnalysisTarget] wrapper for an [AnalysisContext]. | 54 * An [AnalysisTarget] wrapper for an [AnalysisContext]. |
| 55 */ | 55 */ |
| 56 class AnalysisContextTarget implements AnalysisTarget { | 56 class AnalysisContextTarget implements AnalysisTarget { |
| 57 static final AnalysisContextTarget request = new AnalysisContextTarget(null); | 57 static final AnalysisContextTarget request = new AnalysisContextTarget(null); |
| 58 | 58 |
| 59 final AnalysisContext context; | 59 final AnalysisContext context; |
| 60 | 60 |
| 61 AnalysisContextTarget(this.context); | 61 AnalysisContextTarget(this.context); |
| 62 | 62 |
| 63 @override | 63 @override |
| 64 Source get librarySource => null; |
| 65 |
| 66 @override |
| 64 Source get source => null; | 67 Source get source => null; |
| 65 } | 68 } |
| 66 | 69 |
| 67 /** | 70 /** |
| 68 * An object with which an analysis result can be associated. | 71 * An object with which an analysis result can be associated. |
| 69 * | 72 * |
| 70 * Clients may implement this class when creating new kinds of targets. | 73 * Clients may implement this class when creating new kinds of targets. |
| 71 * Instances of this type are used in hashed data structures, so subtypes are | 74 * Instances of this type are used in hashed data structures, so subtypes are |
| 72 * required to correctly implement [==] and [hashCode]. | 75 * required to correctly implement [==] and [hashCode]. |
| 73 */ | 76 */ |
| 74 abstract class AnalysisTarget { | 77 abstract class AnalysisTarget { |
| 75 /** | 78 /** |
| 79 * If this target is associated with a library, return the source of the |
| 80 * library's defining compilation unit; otherwise return `null`. |
| 81 */ |
| 82 Source get librarySource; |
| 83 |
| 84 /** |
| 76 * Return the source associated with this target, or `null` if this target is | 85 * Return the source associated with this target, or `null` if this target is |
| 77 * not associated with a source. | 86 * not associated with a source. |
| 78 */ | 87 */ |
| 79 Source get source; | 88 Source get source; |
| 80 } | 89 } |
| 81 | 90 |
| 82 /** | 91 /** |
| 83 * An object used to compute one or more analysis results associated with a | 92 * An object used to compute one or more analysis results associated with a |
| 84 * single target. | 93 * single target. |
| 85 * | 94 * |
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 /** | 794 /** |
| 786 * A work should be done, but without any special urgency. | 795 * A work should be done, but without any special urgency. |
| 787 */ | 796 */ |
| 788 NORMAL, | 797 NORMAL, |
| 789 | 798 |
| 790 /** | 799 /** |
| 791 * Nothing to do. | 800 * Nothing to do. |
| 792 */ | 801 */ |
| 793 NONE | 802 NONE |
| 794 } | 803 } |
| OLD | NEW |