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

Side by Side Diff: pkg/analysis_server/lib/src/single_context_manager.dart

Issue 1922743002: Add test for 'refresh()' and clean up other tests. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/single_context_manager_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/single_context_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698