Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 library analysis_server.analysis.navigation.navigation_core; | |
| 6 | |
| 7 import 'package:analysis_server/src/protocol.dart' | |
| 8 show ElementKind, Location, NavigationRegion, NavigationTarget; | |
| 9 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext; | |
| 10 import 'package:analyzer/src/generated/source.dart' show Source; | |
| 11 | |
| 12 /** | |
| 13 * An object used to produce navigation regions. | |
| 14 * | |
| 15 * Clients are expected to subtype this class when implementing plugins. | |
| 16 */ | |
| 17 abstract class NavigationContributor { | |
| 18 /** | |
| 19 * Contribute navigation regions for a part of the given [source] into the | |
| 20 * given [holder]. The part is specified by the [offset] and [length]. | |
| 21 * The [context] can be used to get analysis results. | |
| 22 */ | |
| 23 void computeNavigation(NavigationHolder holder, AnalysisContext context, | |
| 24 Source source, int offset, int length); | |
| 25 } | |
| 26 | |
| 27 /** | |
| 28 * An object that [NavigationContributor]s use to record navigation regions | |
| 29 * into. | |
| 30 * | |
| 31 * Clients are not expected to subtype this class. | |
| 32 */ | |
| 33 abstract class NavigationHolder { | |
|
Brian Wilkerson
2015/09/01 14:55:42
I don't think clients need the getters, so I'd lik
scheglov
2015/09/01 20:06:14
Done.
| |
| 34 /** | |
| 35 * All the unique files referenced by [targets]. | |
| 36 */ | |
| 37 List<String> get files; | |
| 38 | |
| 39 /** | |
| 40 * A list of navigation regions. | |
| 41 */ | |
| 42 List<NavigationRegion> get regions; | |
| 43 | |
| 44 /** | |
| 45 * All the unique targets referenced by [regions]. | |
| 46 */ | |
| 47 List<NavigationTarget> get targets; | |
| 48 | |
| 49 /** | |
| 50 * Record a new navigation region with the given [offset] and [length] that | |
| 51 * should navigation to the given [targetLocation]. | |
| 52 */ | |
| 53 void addRegion( | |
| 54 int offset, int length, ElementKind targetKind, Location targetLocation); | |
| 55 } | |
| OLD | NEW |