Index: pkg/analysis_server/lib/src/context_manager.dart |
diff --git a/pkg/analysis_server/lib/src/context_manager.dart b/pkg/analysis_server/lib/src/context_manager.dart |
index f67cfd00b09851d30a55e2b25f077e899dc72d43..f81f5b8eb4b76a95d907dabd6e9211eda5a77e1b 100644 |
--- a/pkg/analysis_server/lib/src/context_manager.dart |
+++ b/pkg/analysis_server/lib/src/context_manager.dart |
@@ -1010,7 +1010,7 @@ class ContextManagerImpl implements ContextManager { |
_recomputeFolderDisposition(info); |
} |
// maybe excluded globally |
- if (_isExcluded(path)) { |
+ if (_isExcluded(path) || _isContainedInDotFolder(info.folder.path, path)) { |
return; |
} |
// maybe excluded from the context, so other context will handle it |
@@ -1146,6 +1146,23 @@ class ContextManagerImpl implements ContextManager { |
} |
/** |
+ * Determine whether the given [path], when interpreted relative to the |
+ * context root [root], contains a folder whose name starts with '.'. |
+ */ |
+ bool _isContainedInDotFolder(String root, String path) { |
+ String relativePath = |
+ pathContext.relative(pathContext.dirname(path), from: root); |
+ for (String pathComponent in pathContext.split(relativePath)) { |
+ if (pathComponent.startsWith('.') && |
+ pathComponent != '.' && |
+ pathComponent != '..') { |
+ return true; |
+ } |
+ } |
+ return false; |
+ } |
+ |
+ /** |
* Returns `true` if the given [path] is excluded by [excludedPaths]. |
*/ |
bool _isExcluded(String path) => _isExcludedBy(excludedPaths, path); |