OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 analysis_server.src.single_context_manager; | 5 library analysis_server.src.single_context_manager; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:core' hide Resource; | 8 import 'dart:core' hide Resource; |
9 import 'dart:math' as math; | 9 import 'dart:math' as math; |
10 | 10 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 @override | 140 @override |
141 bool isInAnalysisRoot(String path) { | 141 bool isInAnalysisRoot(String path) { |
142 return _isContainedIn(includedPaths, path) && | 142 return _isContainedIn(includedPaths, path) && |
143 !_isContainedIn(excludedPaths, path); | 143 !_isContainedIn(excludedPaths, path); |
144 } | 144 } |
145 | 145 |
146 @override | 146 @override |
147 void refresh(List<Resource> roots) { | 147 void refresh(List<Resource> roots) { |
148 if (context != null) { | 148 if (context != null) { |
149 // TODO(brianwilkerson) Not sure whether this is right. | |
150 callbacks.removeContext(contextFolder, null); | 149 callbacks.removeContext(contextFolder, null); |
151 context.dispose(); | 150 context.dispose(); |
152 context = null; | 151 context = null; |
153 contextFolder = null; | 152 contextFolder = null; |
154 if (watchSubscription != null) { | 153 if (watchSubscription != null) { |
155 watchSubscription.cancel(); | 154 watchSubscription.cancel(); |
156 watchSubscription = null; | 155 watchSubscription = null; |
157 } | 156 } |
158 setRoots(includedPaths, excludedPaths, packageRoots); | 157 setRoots(includedPaths, excludedPaths, packageRoots); |
159 } | 158 } |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 static List<Resource> _getChildrenSafe(Folder folder) { | 473 static List<Resource> _getChildrenSafe(Folder folder) { |
475 try { | 474 try { |
476 return folder.getChildren(); | 475 return folder.getChildren(); |
477 } on FileSystemException { | 476 } on FileSystemException { |
478 // The folder either doesn't exist or cannot be read. | 477 // The folder either doesn't exist or cannot be read. |
479 // Either way, there are no children. | 478 // Either way, there are no children. |
480 return const <Resource>[]; | 479 return const <Resource>[]; |
481 } | 480 } |
482 } | 481 } |
483 } | 482 } |
OLD | NEW |