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

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

Issue 800913002: Report pub status (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 6 years 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 | « pkg/analysis_server/doc/api.html ('k') | pkg/analysis_server/lib/src/context_manager.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 analysis.server; 5 library analysis.server;
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_logger.dart'; 10 import 'package:analysis_server/src/analysis_logger.dart';
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 @override 1017 @override
1018 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) { 1018 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) {
1019 AnalysisContext context = analysisServer.folderMap[contextFolder]; 1019 AnalysisContext context = analysisServer.folderMap[contextFolder];
1020 if (context != null) { 1020 if (context != null) {
1021 context.applyChanges(changeSet); 1021 context.applyChanges(changeSet);
1022 analysisServer.schedulePerformAnalysisOperation(context); 1022 analysisServer.schedulePerformAnalysisOperation(context);
1023 } 1023 }
1024 } 1024 }
1025 1025
1026 @override 1026 @override
1027 void beginComputePackageMap() {
1028 _computingPackageMap(true);
1029 }
1030
1031 @override
1032 void endComputePackageMap() {
1033 _computingPackageMap(false);
1034 }
1035
1036 @override
1027 void removeContext(Folder folder) { 1037 void removeContext(Folder folder) {
1028 AnalysisContext context = analysisServer.folderMap.remove(folder); 1038 AnalysisContext context = analysisServer.folderMap.remove(folder);
1029 if (analysisServer.index != null) { 1039 if (analysisServer.index != null) {
1030 analysisServer.index.removeContext(context); 1040 analysisServer.index.removeContext(context);
1031 } 1041 }
1032 _onContextsChangedController.add( 1042 _onContextsChangedController.add(
1033 new ContextsChangedEvent(removed: [context])); 1043 new ContextsChangedEvent(removed: [context]));
1034 analysisServer.sendContextAnalysisDoneNotifications( 1044 analysisServer.sendContextAnalysisDoneNotifications(
1035 context, 1045 context,
1036 AnalysisDoneReason.CONTEXT_REMOVED); 1046 AnalysisDoneReason.CONTEXT_REMOVED);
1037 } 1047 }
1038 1048
1039 @override 1049 @override
1040 void updateContextPackageUriResolver(Folder contextFolder, 1050 void updateContextPackageUriResolver(Folder contextFolder,
1041 UriResolver packageUriResolver) { 1051 UriResolver packageUriResolver) {
1042 AnalysisContext context = analysisServer.folderMap[contextFolder]; 1052 AnalysisContext context = analysisServer.folderMap[contextFolder];
1043 context.sourceFactory = _createSourceFactory(packageUriResolver); 1053 context.sourceFactory = _createSourceFactory(packageUriResolver);
1044 _onContextsChangedController.add( 1054 _onContextsChangedController.add(
1045 new ContextsChangedEvent(changed: [context])); 1055 new ContextsChangedEvent(changed: [context]));
1046 analysisServer.schedulePerformAnalysisOperation(context); 1056 analysisServer.schedulePerformAnalysisOperation(context);
1047 } 1057 }
1048 1058
1059 void _computingPackageMap(bool computing) {
1060 PubStatus pubStatus = new PubStatus(computing);
1061 ServerStatusParams params = new ServerStatusParams(pub: pubStatus);
1062 analysisServer.sendNotification(params.toNotification());
1063 }
1064
1049 /** 1065 /**
1050 * Set up a [SourceFactory] that resolves packages using the given 1066 * Set up a [SourceFactory] that resolves packages using the given
1051 * [packageUriResolver]. 1067 * [packageUriResolver].
1052 */ 1068 */
1053 SourceFactory _createSourceFactory(UriResolver packageUriResolver) { 1069 SourceFactory _createSourceFactory(UriResolver packageUriResolver) {
1054 List<UriResolver> resolvers = <UriResolver>[ 1070 List<UriResolver> resolvers = <UriResolver>[
1055 new DartUriResolver(analysisServer.defaultSdk), 1071 new DartUriResolver(analysisServer.defaultSdk),
1056 new ResourceUriResolver(resourceProvider), 1072 new ResourceUriResolver(resourceProvider),
1057 packageUriResolver]; 1073 packageUriResolver];
1058 return new SourceFactory(resolvers); 1074 return new SourceFactory(resolvers);
1059 } 1075 }
1060 } 1076 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/doc/api.html ('k') | pkg/analysis_server/lib/src/context_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698