| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library context.directory.manager; | 5 library context.directory.manager; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analysis_server/src/analysis_server.dart'; | 10 import 'package:analysis_server/src/analysis_server.dart'; |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 | 296 |
| 297 /** | 297 /** |
| 298 * Resursively adds all Dart and HTML files to the [changeSet]. | 298 * Resursively adds all Dart and HTML files to the [changeSet]. |
| 299 */ | 299 */ |
| 300 void _addSourceFiles(ChangeSet changeSet, Folder folder, _ContextInfo info) { | 300 void _addSourceFiles(ChangeSet changeSet, Folder folder, _ContextInfo info) { |
| 301 if (info.excludesResource(folder) || folder.shortName.startsWith('.')) { | 301 if (info.excludesResource(folder) || folder.shortName.startsWith('.')) { |
| 302 return; | 302 return; |
| 303 } | 303 } |
| 304 List<Resource> children = folder.getChildren(); | 304 List<Resource> children = null; |
| 305 try { |
| 306 children = folder.getChildren(); |
| 307 } on FileSystemException { |
| 308 // The directory either doesn't exist or cannot be read. Either way, there |
| 309 // are no children that need to be added. |
| 310 return; |
| 311 } |
| 305 for (Resource child in children) { | 312 for (Resource child in children) { |
| 306 String path = child.path; | 313 String path = child.path; |
| 307 // ignore excluded files or folders | 314 // ignore excluded files or folders |
| 308 if (_isExcluded(path)) { | 315 if (_isExcluded(path)) { |
| 309 continue; | 316 continue; |
| 310 } | 317 } |
| 311 // add files, recurse into folders | 318 // add files, recurse into folders |
| 312 if (child is File) { | 319 if (child is File) { |
| 313 if (_shouldFileBeAnalyzed(child)) { | 320 if (_shouldFileBeAnalyzed(child)) { |
| 314 Source source = createSourceInContext(info.context, child); | 321 Source source = createSourceInContext(info.context, child); |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 return excludes(resource.path); | 725 return excludes(resource.path); |
| 719 } | 726 } |
| 720 | 727 |
| 721 /** | 728 /** |
| 722 * Returns `true` if [path] is the pubspec file of this context. | 729 * Returns `true` if [path] is the pubspec file of this context. |
| 723 */ | 730 */ |
| 724 bool isPubspec(String path) { | 731 bool isPubspec(String path) { |
| 725 return path == pubspecPath; | 732 return path == pubspecPath; |
| 726 } | 733 } |
| 727 } | 734 } |
| OLD | NEW |