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 analysis_server.plugin.analysis.occurrences.occurrences_core; | 5 library analysis_server.plugin.analysis.occurrences.occurrences_core; |
6 | 6 |
7 import 'package:analysis_server/plugin/protocol/protocol.dart' show Occurrences; | 7 import 'package:analysis_server/protocol/protocol_generated.dart' |
| 8 show Occurrences; |
8 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 9 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; |
9 import 'package:analyzer/src/generated/source.dart' show Source; | 10 import 'package:analyzer/src/generated/source.dart' show Source; |
10 | 11 |
11 /** | 12 /** |
12 * An object that [OccurrencesContributor]s use to record occurrences into. | 13 * An object that [OccurrencesContributor]s use to record occurrences into. |
13 * | 14 * |
14 * Clients may not extend, implement or mix-in this class. | 15 * Clients may not extend, implement or mix-in this class. |
15 */ | 16 */ |
16 abstract class OccurrencesCollector { | 17 abstract class OccurrencesCollector { |
17 /** | 18 /** |
18 * Record a new element occurrences. | 19 * Record a new element occurrences. |
19 */ | 20 */ |
20 void addOccurrences(Occurrences occurrences); | 21 void addOccurrences(Occurrences occurrences); |
21 } | 22 } |
22 | 23 |
23 /** | 24 /** |
24 * An object used to produce occurrences. | 25 * An object used to produce occurrences. |
25 * | 26 * |
26 * Clients may implement this class when implementing plugins. | 27 * Clients may implement this class when implementing plugins. |
27 */ | 28 */ |
28 abstract class OccurrencesContributor { | 29 abstract class OccurrencesContributor { |
29 /** | 30 /** |
30 * Contribute occurrences into the given [collector]. | 31 * Contribute occurrences into the given [collector]. |
31 * The [context] can be used to get analysis results. | 32 * The [context] can be used to get analysis results. |
32 */ | 33 */ |
33 void computeOccurrences( | 34 void computeOccurrences( |
34 OccurrencesCollector collector, AnalysisContext context, Source source); | 35 OccurrencesCollector collector, AnalysisContext context, Source source); |
35 } | 36 } |
OLD | NEW |