getNavigationRequest method

  1. @override
Future<NavigationRequest> getNavigationRequest(
  1. AnalysisGetNavigationParams parameters
)
override

Return the navigation request that should be passes to the contributors returned from getNavigationContributors.

Throw a RequestFailure if the request could not be created.

Implementation

@override
Future<NavigationRequest> getNavigationRequest(
    AnalysisGetNavigationParams parameters) async {
  var path = parameters.file;
  var result = await getResolvedUnitResult(path);
  var offset = parameters.offset;
  var length = parameters.length;
  if (offset < 0 && length < 0) {
    offset = 0;
    length = result.content.length;
  }
  return DartNavigationRequestImpl(resourceProvider, offset, length, result);
}