| Index: pkg/analysis_server/lib/src/single_context_manager.dart
|
| diff --git a/pkg/analysis_server/lib/src/single_context_manager.dart b/pkg/analysis_server/lib/src/single_context_manager.dart
|
| index a38d5fda2cf69b9f701665d22298860e2a8c9f18..511b24cc4dc0fdaa5d0404fe24755f2da23aa480 100644
|
| --- a/pkg/analysis_server/lib/src/single_context_manager.dart
|
| +++ b/pkg/analysis_server/lib/src/single_context_manager.dart
|
| @@ -185,12 +185,14 @@ class SingleContextManager implements ContextManager {
|
| if (_isImplicitlyExcludedResource(resource)) {
|
| return;
|
| }
|
| - // TODO(scheglov) apply pathFilter
|
| - if (_isEqualOrWithinAny(excludedPaths, resource.path)) {
|
| + String path = resource.path;
|
| + if (_isEqualOrWithinAny(excludedPaths, path)) {
|
| return;
|
| }
|
| - if (resource is File && resource.exists) {
|
| - addedFiles.add(resource);
|
| + if (resource is File) {
|
| + if (_matchesAnyAnalyzedFilesGlob(path) && resource.exists) {
|
| + addedFiles.add(resource);
|
| + }
|
| } else if (resource is Folder) {
|
| for (Resource child in _getChildrenSafe(resource)) {
|
| _addFilesInResource(addedFiles, child, excludedPaths);
|
| @@ -241,6 +243,18 @@ class SingleContextManager implements ContextManager {
|
| }
|
|
|
| /**
|
| + * Return `true` if the given [path] matches one of the [analyzedFilesGlobs].
|
| + */
|
| + bool _matchesAnyAnalyzedFilesGlob(String path) {
|
| + for (Glob glob in analyzedFilesGlobs) {
|
| + if (glob.matches(path)) {
|
| + return true;
|
| + }
|
| + }
|
| + return false;
|
| + }
|
| +
|
| + /**
|
| * Normalize all package root sources by mapping them to folders on the
|
| * filesystem. Ignore any package root sources that aren't folders.
|
| */
|
|
|