| OLD | NEW |
| 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'package:analyzer/dart/analysis/results.dart'; | 5 import 'package:analyzer/dart/analysis/results.dart'; |
| 6 import 'package:analyzer/file_system/file_system.dart'; | 6 import 'package:analyzer/file_system/file_system.dart'; |
| 7 import 'package:analyzer/src/generated/source.dart'; |
| 7 import 'package:analyzer_plugin/protocol/protocol.dart'; | 8 import 'package:analyzer_plugin/protocol/protocol.dart'; |
| 8 import 'package:analyzer_plugin/protocol/protocol_common.dart' | 9 import 'package:analyzer_plugin/protocol/protocol_common.dart' |
| 9 show ElementKind, Location; | 10 show ElementKind, Location; |
| 10 import 'package:analyzer_plugin/protocol/protocol_generated.dart'; | 11 import 'package:analyzer_plugin/protocol/protocol_generated.dart'; |
| 11 import 'package:analyzer_plugin/src/utilities/navigation/navigation.dart'; | 12 import 'package:analyzer_plugin/src/utilities/navigation/navigation.dart'; |
| 12 import 'package:analyzer_plugin/utilities/generator.dart'; | 13 import 'package:analyzer_plugin/utilities/generator.dart'; |
| 13 | 14 |
| 14 /** | 15 /** |
| 15 * The information about a requested set of navigation information when | 16 * The information about a requested set of navigation information when |
| 16 * computing navigation information in a `.dart` file. | 17 * computing navigation information in a `.dart` file. |
| 17 * | 18 * |
| 18 * Clients may not extend, implement or mix-in this class. | 19 * Clients may not extend, implement or mix-in this class. |
| 19 */ | 20 */ |
| 20 abstract class DartNavigationRequest implements NavigationRequest { | 21 abstract class DartNavigationRequest implements NavigationRequest { |
| 21 /** | 22 /** |
| 22 * The analysis result for the file in which the navigation regions are being | 23 * The analysis result for the file in which the navigation regions are being |
| 23 * requested. | 24 * requested. |
| 24 */ | 25 */ |
| 25 ResolveResult get result; | 26 ResolveResult get result; |
| 26 } | 27 } |
| 27 | 28 |
| 28 /** | 29 /** |
| 29 * An object that [NavigationContributor]s use to record navigation regions. | 30 * An object that [NavigationContributor]s use to record navigation regions. |
| 30 * | 31 * |
| 31 * Clients may not extend, implement or mix-in this class. | 32 * Clients may not extend, implement or mix-in this class. |
| 32 */ | 33 */ |
| 33 abstract class NavigationCollector { | 34 abstract class NavigationCollector { |
| 34 /** | 35 /** |
| 36 * Record a new navigation region corresponding to the given [range] that |
| 37 * should navigate to the given [targetLocation]. |
| 38 */ |
| 39 void addRange( |
| 40 SourceRange range, ElementKind targetKind, Location targetLocation); |
| 41 |
| 42 /** |
| 35 * Record a new navigation region with the given [offset] and [length] that | 43 * Record a new navigation region with the given [offset] and [length] that |
| 36 * should navigate to the given [targetLocation]. | 44 * should navigate to the given [targetLocation]. |
| 37 */ | 45 */ |
| 38 void addRegion( | 46 void addRegion( |
| 39 int offset, int length, ElementKind targetKind, Location targetLocation); | 47 int offset, int length, ElementKind targetKind, Location targetLocation); |
| 40 } | 48 } |
| 41 | 49 |
| 42 /** | 50 /** |
| 43 * An object used to produce navigation regions. | 51 * An object used to produce navigation regions. |
| 44 * | 52 * |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 /** | 147 /** |
| 140 * Return the path of the file in which navigation regions are being requested
. | 148 * Return the path of the file in which navigation regions are being requested
. |
| 141 */ | 149 */ |
| 142 String get path; | 150 String get path; |
| 143 | 151 |
| 144 /** | 152 /** |
| 145 * Return the resource provider associated with this request. | 153 * Return the resource provider associated with this request. |
| 146 */ | 154 */ |
| 147 ResourceProvider get resourceProvider; | 155 ResourceProvider get resourceProvider; |
| 148 } | 156 } |
| OLD | NEW |