| 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.analysis.navigation_core; | 5 library analysis_server.analysis.navigation_core; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol.dart' | 7 import 'package:analysis_server/src/protocol.dart' |
| 8 show ElementKind, Location, NavigationRegion, NavigationTarget; | 8 show ElementKind, Location, NavigationRegion, NavigationTarget; |
| 9 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | 9 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; |
| 10 import 'package:analyzer/src/generated/source.dart' show Source; | 10 import 'package:analyzer/src/generated/source.dart' show Source; |
| 11 | 11 |
| 12 /** | 12 /** |
| 13 * An object used to produce navigation regions. | 13 * An object used to produce navigation regions. |
| 14 * | 14 * |
| 15 * Clients are expected to subtype this class when implementing plugins. | 15 * Clients are expected to subtype this class when implementing plugins. |
| 16 */ | 16 */ |
| 17 abstract class NavigationContributor { | 17 abstract class NavigationContributor { |
| 18 /** | 18 /** |
| 19 * Contribute navigation regions for a subset of the content of the given | 19 * Contribute navigation regions for a subset of the content of the given |
| 20 * [source] into the given [collector]. The subset is specified by the | 20 * [source] into the given [collector]. The subset is specified by the |
| 21 * [offset] and [length]. The [context] can be used to access analysis results
. | 21 * [offset] and [length]. The [context] can be used to access analysis results
. |
| 22 */ | 22 */ |
| 23 void computeNavigation(NavigationCollector collector, AnalysisContext context, | 23 void computeNavigation(NavigationCollector collector, AnalysisContext context, |
| 24 Source source, int offset, int length); | 24 Source source, int offset, int length); |
| 25 } | 25 } |
| 26 | 26 |
| 27 /** | 27 /** |
| 28 * An object that [NavigationContributor]s use to record navigation regions | 28 * An object that [NavigationContributor]s use to record navigation regions. |
| 29 * into. | |
| 30 * | 29 * |
| 31 * Clients are not expected to subtype this class. | 30 * Clients are not expected to subtype this class. |
| 32 */ | 31 */ |
| 33 abstract class NavigationCollector { | 32 abstract class NavigationCollector { |
| 34 /** | 33 /** |
| 35 * Record a new navigation region with the given [offset] and [length] that | 34 * Record a new navigation region with the given [offset] and [length] that |
| 36 * should navigate to the given [targetLocation]. | 35 * should navigate to the given [targetLocation]. |
| 37 */ | 36 */ |
| 38 void addRegion( | 37 void addRegion( |
| 39 int offset, int length, ElementKind targetKind, Location targetLocation); | 38 int offset, int length, ElementKind targetKind, Location targetLocation); |
| 40 } | 39 } |
| OLD | NEW |