Files
sdk/pkg/analyzer/lib/dart/analysis/context_locator.dart
T
Konstantin Shcheglov 9f986d2501 Migrate package:analyzer to null safety.
Change-Id: Iffe4370431587e46a141ddc72a86ceec29c163b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176486
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2021-02-01 18:56:04 +00:00

39 lines
1.8 KiB
Dart

// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:analyzer/dart/analysis/context_root.dart';
import 'package:analyzer/file_system/file_system.dart';
import 'package:analyzer/src/dart/analysis/context_locator.dart';
/// Determines the list of analysis contexts that can be used to analyze the
/// files and folders that should be analyzed given a list of included files and
/// folders and a list of excluded files and folders.
///
/// Clients may not extend, implement or mix-in this class.
abstract class ContextLocator {
/// Initialize a newly created context locator. If a [resourceProvider] is
/// supplied, it will be used to access the file system. Otherwise the default
/// resource provider will be used.
factory ContextLocator({ResourceProvider resourceProvider}) =
ContextLocatorImpl;
/// Return a list of the context roots that should be used to analyze the
/// files that are included by the list of [includedPaths] and not excluded by
/// the list of [excludedPaths].
///
/// If an [optionsFile] is specified, then it is assumed to be the path to the
/// `analysis_options.yaml` (or `.analysis_options`) file that should be used
/// in place of the ones that would be found by looking in the directories
/// containing the context roots.
///
/// If a [packagesFile] is specified, then it is assumed to be the path to the
/// `.packages` file that should be used in place of the one that would be
/// found by looking in the directories containing the context roots.
List<ContextRoot> locateRoots(
{required List<String> includedPaths,
List<String>? excludedPaths,
String? optionsFile,
String? packagesFile});
}