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

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

Issue 987663002: Fix for subscribing for notifications for files in packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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:analysis_server/src/analysis_server.dart'; 10 import 'package:analysis_server/src/analysis_server.dart';
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 * Create and return a source representing the given [file] within the given 605 * Create and return a source representing the given [file] within the given
606 * [context]. 606 * [context].
607 */ 607 */
608 static Source createSourceInContext(AnalysisContext context, File file) { 608 static Source createSourceInContext(AnalysisContext context, File file) {
609 // TODO(brianwilkerson) Optimize this, by allowing support for source 609 // TODO(brianwilkerson) Optimize this, by allowing support for source
610 // factories to restore URI's from a file path rather than a source. 610 // factories to restore URI's from a file path rather than a source.
611 Source source = file.createSource(); 611 Source source = file.createSource();
612 if (context == null) { 612 if (context == null) {
613 return source; 613 return source;
614 } 614 }
615 if (context.sourceFactory == null) {
Brian Wilkerson 2015/03/06 15:04:27 This should never happen. We should minimally writ
scheglov 2015/03/06 22:10:34 Done. You're right, it shouldn't. I found it runn
616 return null;
617 }
615 Uri uri = context.sourceFactory.restoreUri(source); 618 Uri uri = context.sourceFactory.restoreUri(source);
616 return file.createSource(uri); 619 return file.createSource(uri);
617 } 620 }
618 621
619 static bool _shouldFileBeAnalyzed(File file) { 622 static bool _shouldFileBeAnalyzed(File file) {
620 if (!(AnalysisEngine.isDartFileName(file.path) || 623 if (!(AnalysisEngine.isDartFileName(file.path) ||
621 AnalysisEngine.isHtmlFileName(file.path))) { 624 AnalysisEngine.isHtmlFileName(file.path))) {
622 return false; 625 return false;
623 } 626 }
624 // Emacs creates dummy links to track the fact that a file is open for 627 // Emacs creates dummy links to track the fact that a file is open for
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 return excludes(resource.path); 713 return excludes(resource.path);
711 } 714 }
712 715
713 /** 716 /**
714 * Returns `true` if [path] is the pubspec file of this context. 717 * Returns `true` if [path] is the pubspec file of this context.
715 */ 718 */
716 bool isPubspec(String path) { 719 bool isPubspec(String path) {
717 return path == pubspecPath; 720 return path == pubspecPath;
718 } 721 }
719 } 722 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698