Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: pkg/analysis_server/lib/src/context_manager.dart

Issue 1372173004: Ignore added files in hidden directories. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | pkg/analysis_server/test/context_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698