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

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

Issue 923103004: Return RequestErrorCode.NO_INDEX_GENERATED for search/refactoring requests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:math' show max; 9 import 'dart:math' show max;
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 * be sent. 82 * be sent.
83 */ 83 */
84 final ServerCommunicationChannel channel; 84 final ServerCommunicationChannel channel;
85 85
86 /** 86 /**
87 * The [ResourceProvider] using which paths are converted into [Resource]s. 87 * The [ResourceProvider] using which paths are converted into [Resource]s.
88 */ 88 */
89 final ResourceProvider resourceProvider; 89 final ResourceProvider resourceProvider;
90 90
91 /** 91 /**
92 * The [Index] for this server. 92 * The [Index] for this server, may be `null` if indexing is disabled.
93 */ 93 */
94 final Index index; 94 final Index index;
95 95
96 /** 96 /**
97 * The [SearchEngine] for this server. 97 * The [SearchEngine] for this server, may be `null` if indexing is disabled.
98 */ 98 */
99 SearchEngine searchEngine; 99 final SearchEngine searchEngine;
100 100
101 /** 101 /**
102 * [ContextManager] which handles the mapping from analysis roots 102 * [ContextManager] which handles the mapping from analysis roots
103 * to context directories. 103 * to context directories.
104 */ 104 */
105 ServerContextManager contextDirectoryManager; 105 ServerContextManager contextDirectoryManager;
106 106
107 /** 107 /**
108 * A flag indicating whether the server is running. When false, contexts 108 * A flag indicating whether the server is running. When false, contexts
109 * will no longer be added to [contextWorkQueue], and [performOperation] will 109 * will no longer be added to [contextWorkQueue], and [performOperation] will
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 /** 235 /**
236 * Initialize a newly created server to receive requests from and send 236 * Initialize a newly created server to receive requests from and send
237 * responses to the given [channel]. 237 * responses to the given [channel].
238 * 238 *
239 * If [rethrowExceptions] is true, then any exceptions thrown by analysis are 239 * If [rethrowExceptions] is true, then any exceptions thrown by analysis are
240 * propagated up the call stack. The default is true to allow analysis 240 * propagated up the call stack. The default is true to allow analysis
241 * exceptions to show up in unit tests, but it should be set to false when 241 * exceptions to show up in unit tests, but it should be set to false when
242 * running a full analysis server. 242 * running a full analysis server.
243 */ 243 */
244 AnalysisServer(this.channel, this.resourceProvider, 244 AnalysisServer(this.channel, this.resourceProvider,
245 PackageMapProvider packageMapProvider, this.index, 245 PackageMapProvider packageMapProvider, Index _index,
246 AnalysisServerOptions analysisServerOptions, this.defaultSdk, 246 AnalysisServerOptions analysisServerOptions, this.defaultSdk,
247 this.instrumentationService, {this.rethrowExceptions: true}) { 247 this.instrumentationService, {this.rethrowExceptions: true})
248 : index = _index,
249 searchEngine = _index != null ? createSearchEngine(_index) : null {
248 _performance = performanceDuringStartup; 250 _performance = performanceDuringStartup;
249 searchEngine = createSearchEngine(index);
250 operationQueue = new ServerOperationQueue(); 251 operationQueue = new ServerOperationQueue();
251 contextDirectoryManager = 252 contextDirectoryManager =
252 new ServerContextManager(this, resourceProvider, packageMapProvider); 253 new ServerContextManager(this, resourceProvider, packageMapProvider);
253 contextDirectoryManager.defaultOptions.incremental = true; 254 contextDirectoryManager.defaultOptions.incremental = true;
254 contextDirectoryManager.defaultOptions.incrementalApi = 255 contextDirectoryManager.defaultOptions.incrementalApi =
255 analysisServerOptions.enableIncrementalResolutionApi; 256 analysisServerOptions.enableIncrementalResolutionApi;
256 contextDirectoryManager.defaultOptions.incrementalValidation = 257 contextDirectoryManager.defaultOptions.incrementalValidation =
257 analysisServerOptions.enableIncrementalResolutionValidation; 258 analysisServerOptions.enableIncrementalResolutionValidation;
258 _noErrorNotification = analysisServerOptions.noErrorNotification; 259 _noErrorNotification = analysisServerOptions.noErrorNotification;
259 AnalysisEngine.instance.logger = new AnalysisLogger(); 260 AnalysisEngine.instance.logger = new AnalysisLogger();
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 } 1097 }
1097 performOperationPending = true; 1098 performOperationPending = true;
1098 } 1099 }
1099 } 1100 }
1100 1101
1101 1102
1102 class AnalysisServerOptions { 1103 class AnalysisServerOptions {
1103 bool enableIncrementalResolutionApi = false; 1104 bool enableIncrementalResolutionApi = false;
1104 bool enableIncrementalResolutionValidation = false; 1105 bool enableIncrementalResolutionValidation = false;
1105 bool noErrorNotification = false; 1106 bool noErrorNotification = false;
1107 bool noIndex = false;
1106 String fileReadMode = 'as-is'; 1108 String fileReadMode = 'as-is';
1107 } 1109 }
1108 1110
1109 /** 1111 /**
1110 * A [ContextsChangedEvent] indicate what contexts were added or removed. 1112 * A [ContextsChangedEvent] indicate what contexts were added or removed.
1111 * 1113 *
1112 * No context should be added to the event more than once. It does not make 1114 * No context should be added to the event more than once. It does not make
1113 * sense, for example, for a context to be both added and removed. 1115 * sense, for example, for a context to be both added and removed.
1114 */ 1116 */
1115 class ContextsChangedEvent { 1117 class ContextsChangedEvent {
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 new DateTime.now().millisecondsSinceEpoch - 1327 new DateTime.now().millisecondsSinceEpoch -
1326 request.clientRequestTime; 1328 request.clientRequestTime;
1327 requestLatency += latency; 1329 requestLatency += latency;
1328 maxLatency = max(maxLatency, latency); 1330 maxLatency = max(maxLatency, latency);
1329 if (latency > 150) { 1331 if (latency > 150) {
1330 ++slowRequestCount; 1332 ++slowRequestCount;
1331 } 1333 }
1332 } 1334 }
1333 } 1335 }
1334 } 1336 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/edit/edit_domain.dart » ('j') | pkg/analysis_server/lib/src/edit/edit_domain.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698