| Index: pkg/analyzer/lib/context/context_root.dart
|
| diff --git a/pkg/analyzer/lib/context/context_root.dart b/pkg/analyzer/lib/context/context_root.dart
|
| index f871ab1c0a8993bd93aa8895d26917d86bddc601..cfc47ff8f99c2c0ebbadbf3ed75c5cbb49422994 100644
|
| --- a/pkg/analyzer/lib/context/context_root.dart
|
| +++ b/pkg/analyzer/lib/context/context_root.dart
|
| @@ -3,6 +3,7 @@
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| import 'package:analyzer/src/generated/utilities_general.dart';
|
| +import 'package:path/path.dart' as path;
|
|
|
| /**
|
| * Information about the root directory associated with an analysis context.
|
| @@ -45,6 +46,24 @@ class ContextRoot {
|
| }
|
|
|
| /**
|
| + * Return `true` if the file with the given [filePath] is contained within
|
| + * this context root. A file contained in a context root if it is within the
|
| + * context [root] neither explicitly excluded or within one of the excluded
|
| + * directories.
|
| + */
|
| + bool containsFile(String filePath) {
|
| + if (!path.isWithin(root, filePath)) {
|
| + return false;
|
| + }
|
| + for (String excluded in exclude) {
|
| + if (filePath == excluded || path.isWithin(excluded, filePath)) {
|
| + return false;
|
| + }
|
| + }
|
| + return true;
|
| + }
|
| +
|
| + /**
|
| * Compare the lists [listA] and [listB], using [itemEqual] to compare
|
| * list elements.
|
| */
|
|
|