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

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

Issue 315183004: Remove unused analysis contexts (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 analysis.server; 5 library analysis.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_logger.dart'; 9 import 'package:analysis_server/src/analysis_logger.dart';
10 import 'package:analysis_server/src/channel.dart'; 10 import 'package:analysis_server/src/channel.dart';
(...skipping 20 matching lines...) Expand all
31 * [AnalysisServer] instances to improve performance. 31 * [AnalysisServer] instances to improve performance.
32 */ 32 */
33 final DirectoryBasedDartSdk SHARED_SDK = DirectoryBasedDartSdk.defaultSdk; 33 final DirectoryBasedDartSdk SHARED_SDK = DirectoryBasedDartSdk.defaultSdk;
34 34
35 class AnalysisServerContextDirectoryManager extends ContextDirectoryManager { 35 class AnalysisServerContextDirectoryManager extends ContextDirectoryManager {
36 final AnalysisServer analysisServer; 36 final AnalysisServer analysisServer;
37 37
38 AnalysisServerContextDirectoryManager(this.analysisServer, ResourceProvider re sourceProvider) 38 AnalysisServerContextDirectoryManager(this.analysisServer, ResourceProvider re sourceProvider)
39 : super(resourceProvider); 39 : super(resourceProvider);
40 40
41 @override
41 void addContext(Folder folder, File pubspecFile) { 42 void addContext(Folder folder, File pubspecFile) {
42 ContextDirectory contextDirectory = new ContextDirectory( 43 ContextDirectory contextDirectory = new ContextDirectory(
43 analysisServer.defaultSdk, folder, pubspecFile); 44 analysisServer.defaultSdk, folder, pubspecFile);
44 analysisServer.folderMap[folder] = contextDirectory; 45 analysisServer.folderMap[folder] = contextDirectory;
45 analysisServer.schedulePerformAnalysisOperation(contextDirectory.context); 46 analysisServer.schedulePerformAnalysisOperation(contextDirectory.context);
46 } 47 }
47 48
49 @override
48 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) { 50 void applyChangesToContext(Folder contextFolder, ChangeSet changeSet) {
49 analysisServer.folderMap[contextFolder].context.applyChanges(changeSet); 51 analysisServer.folderMap[contextFolder].context.applyChanges(changeSet);
50 } 52 }
53
54 @override
55 void removeContext(Folder folder) {
56 analysisServer.folderMap.remove(folder);
57 }
51 } 58 }
52 59
53 /** 60 /**
54 * Instances of the class [AnalysisServer] implement a server that listens on a 61 * Instances of the class [AnalysisServer] implement a server that listens on a
55 * [CommunicationChannel] for analysis requests and process them. 62 * [CommunicationChannel] for analysis requests and process them.
56 */ 63 */
57 class AnalysisServer { 64 class AnalysisServer {
58 /** 65 /**
59 * The channel from which requests are received and to which responses should 66 * The channel from which requests are received and to which responses should
60 * be sent. 67 * be sent.
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 /** 486 /**
480 * An enumeration of the services provided by the server domain. 487 * An enumeration of the services provided by the server domain.
481 */ 488 */
482 class ServerService extends Enum2<ServerService> { 489 class ServerService extends Enum2<ServerService> {
483 static const ServerService STATUS = const ServerService('STATUS', 0); 490 static const ServerService STATUS = const ServerService('STATUS', 0);
484 491
485 static const List<ServerService> VALUES = const [STATUS]; 492 static const List<ServerService> VALUES = const [STATUS];
486 493
487 const ServerService(String name, int ordinal) : super(name, ordinal); 494 const ServerService(String name, int ordinal) : super(name, ordinal);
488 } 495 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698