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

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

Issue 444193002: Add Folder.contains(path) and use it in ContextDirectoryManager. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/lib/file_system/file_system.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) 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:analyzer/file_system/file_system.dart'; 10 import 'package:analyzer/file_system/file_system.dart';
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 return file.exists; 240 return file.exists;
241 } 241 }
242 242
243 /** 243 /**
244 * Returns `true` if the given absolute [path] is in one of the current 244 * Returns `true` if the given absolute [path] is in one of the current
245 * root folders and is not excluded. 245 * root folders and is not excluded.
246 */ 246 */
247 bool isInAnalysisRoot(String path) { 247 bool isInAnalysisRoot(String path) {
248 // TODO(scheglov) check for excluded paths 248 // TODO(scheglov) check for excluded paths
249 for (Folder root in _currentDirectoryInfo.keys) { 249 for (Folder root in _currentDirectoryInfo.keys) {
250 if (path.startsWith(root.path)) { 250 if (root.contains(path)) {
251 return true; 251 return true;
252 } 252 }
253 } 253 }
254 return false; 254 return false;
255 } 255 }
256 256
257 /** 257 /**
258 * Called when a new context needs to be created. 258 * Called when a new context needs to be created.
259 */ 259 */
260 void addContext(Folder folder, Map<String, List<Folder>> packageMap); 260 void addContext(Folder folder, Map<String, List<Folder>> packageMap);
261 261
262 /** 262 /**
263 * Called when the set of files associated with a context have changed (or 263 * Called when the set of files associated with a context have changed (or
264 * some of those files have been modified). [changeSet] is the set of 264 * some of those files have been modified). [changeSet] is the set of
265 * changes that need to be applied to the context. 265 * changes that need to be applied to the context.
266 */ 266 */
267 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet); 267 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet);
268 268
269 /** 269 /**
270 * Remove the context associated with the given [folder]. 270 * Remove the context associated with the given [folder].
271 */ 271 */
272 void removeContext(Folder folder); 272 void removeContext(Folder folder);
273 273
274 /** 274 /**
275 * Called when the package map for a context has changed. 275 * Called when the package map for a context has changed.
276 */ 276 */
277 void updateContextPackageMap(Folder contextFolder, 277 void updateContextPackageMap(Folder contextFolder,
278 Map<String, List<Folder>> packageMap); 278 Map<String, List<Folder>> packageMap);
279 } 279 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/file_system/file_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698