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

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

Issue 428303004: Breaking changes in 'analyzer' package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rename Source.resolveRelative to resolveRelativeUri, soften version constraints 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
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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 break; 145 break;
146 } 146 }
147 Resource resource = resourceProvider.getResource(event.path); 147 Resource resource = resourceProvider.getResource(event.path);
148 // If the file went away and was replaced by a folder before we 148 // If the file went away and was replaced by a folder before we
149 // had a chance to process the event, resource might be a Folder. In 149 // had a chance to process the event, resource might be a Folder. In
150 // that case don't add it. 150 // that case don't add it.
151 if (resource is File) { 151 if (resource is File) {
152 File file = resource; 152 File file = resource;
153 if (_shouldFileBeAnalyzed(file)) { 153 if (_shouldFileBeAnalyzed(file)) {
154 ChangeSet changeSet = new ChangeSet(); 154 ChangeSet changeSet = new ChangeSet();
155 Source source = file.createSource(UriKind.FILE_URI); 155 Source source = file.createSource();
156 changeSet.addedSource(source); 156 changeSet.addedSource(source);
157 applyChangesToContext(folder, changeSet); 157 applyChangesToContext(folder, changeSet);
158 info.sources[event.path]= source; 158 info.sources[event.path]= source;
159 } 159 }
160 } 160 }
161 break; 161 break;
162 case ChangeType.REMOVE: 162 case ChangeType.REMOVE:
163 Source source = info.sources[event.path]; 163 Source source = info.sources[event.path];
164 if (source != null) { 164 if (source != null) {
165 ChangeSet changeSet = new ChangeSet(); 165 ChangeSet changeSet = new ChangeSet();
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 } 205 }
206 206
207 /** 207 /**
208 * Resursively adds all Dart and HTML files to the [changeSet]. 208 * Resursively adds all Dart and HTML files to the [changeSet].
209 */ 209 */
210 static void _addSourceFiles(ChangeSet changeSet, Folder folder, _ContextDirect oryInfo info) { 210 static void _addSourceFiles(ChangeSet changeSet, Folder folder, _ContextDirect oryInfo info) {
211 List<Resource> children = folder.getChildren(); 211 List<Resource> children = folder.getChildren();
212 for (Resource child in children) { 212 for (Resource child in children) {
213 if (child is File) { 213 if (child is File) {
214 if (_shouldFileBeAnalyzed(child)) { 214 if (_shouldFileBeAnalyzed(child)) {
215 Source source = child.createSource(UriKind.FILE_URI); 215 Source source = child.createSource();
216 changeSet.addedSource(source); 216 changeSet.addedSource(source);
217 info.sources[child.path] = source; 217 info.sources[child.path] = source;
218 } 218 }
219 } else if (child is Folder) { 219 } else if (child is Folder) {
220 if (child.shortName == 'packages') { 220 if (child.shortName == 'packages') {
221 // TODO(paulberry): perhaps we should only skip packages dirs if 221 // TODO(paulberry): perhaps we should only skip packages dirs if
222 // there is a pubspec.yaml? 222 // there is a pubspec.yaml?
223 continue; 223 continue;
224 } 224 }
225 _addSourceFiles(changeSet, child, info); 225 _addSourceFiles(changeSet, child, info);
(...skipping 30 matching lines...) Expand all
256 * Remove the context associated with the given [folder]. 256 * Remove the context associated with the given [folder].
257 */ 257 */
258 void removeContext(Folder folder); 258 void removeContext(Folder folder);
259 259
260 /** 260 /**
261 * Called when the package map for a context has changed. 261 * Called when the package map for a context has changed.
262 */ 262 */
263 void updateContextPackageMap(Folder contextFolder, 263 void updateContextPackageMap(Folder contextFolder,
264 Map<String, List<Folder>> packageMap); 264 Map<String, List<Folder>> packageMap);
265 } 265 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/test/analysis_abstract.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698