@@ -93,9 +93,7 @@ import 'package:analysis_server/src/services/completion/completion_state.dart';
93
93
import 'package:analysis_server/src/services/execution/execution_context.dart' ;
94
94
import 'package:analysis_server/src/services/flutter/widget_descriptions.dart' ;
95
95
import 'package:analysis_server/src/services/refactoring/legacy/refactoring_manager.dart' ;
96
- import 'package:analysis_server/src/services/user_prompts/dart_fix_prompt_manager.dart' ;
97
96
import 'package:analysis_server/src/utilities/process.dart' ;
98
- import 'package:analysis_server/src/utilities/request_statistics.dart' ;
99
97
import 'package:analyzer/dart/analysis/results.dart' ;
100
98
import 'package:analyzer/dart/analysis/session.dart' ;
101
99
import 'package:analyzer/dart/ast/ast.dart' ;
@@ -167,8 +165,8 @@ class AnalysisServerOptions {
167
165
}
168
166
169
167
/// Instances of the class [LegacyAnalysisServer] implement a server that
170
- /// listens on a [CommunicationChannel ] for analysis requests and processes
171
- /// them.
168
+ /// listens on a [ServerCommunicationChannel ] for analysis requests and
169
+ /// processes them.
172
170
class LegacyAnalysisServer extends AnalysisServer {
173
171
/// A map from the name of a request to a function used to create a request
174
172
/// handler.
@@ -192,19 +190,19 @@ class LegacyAnalysisServer extends AnalysisServer {
192
190
ANALYSIS_REQUEST_SET_SUBSCRIPTIONS : AnalysisSetSubscriptionsHandler .new ,
193
191
ANALYSIS_REQUEST_UPDATE_CONTENT : AnalysisUpdateContentHandler .new ,
194
192
ANALYSIS_REQUEST_UPDATE_OPTIONS : AnalysisUpdateOptionsHandler .new ,
195
- //
193
+
196
194
ANALYTICS_REQUEST_IS_ENABLED : AnalyticsIsEnabledHandler .new ,
197
195
ANALYTICS_REQUEST_ENABLE : AnalyticsEnableHandler .new ,
198
196
ANALYTICS_REQUEST_SEND_EVENT : AnalyticsSendEventHandler .new ,
199
197
ANALYTICS_REQUEST_SEND_TIMING : AnalyticsSendTimingHandler .new ,
200
- //
198
+
201
199
COMPLETION_REQUEST_GET_SUGGESTION_DETAILS2 :
202
200
CompletionGetSuggestionDetails2Handler .new ,
203
201
COMPLETION_REQUEST_GET_SUGGESTIONS2 : CompletionGetSuggestions2Handler .new ,
204
- //
202
+
205
203
DIAGNOSTIC_REQUEST_GET_DIAGNOSTICS : DiagnosticGetDiagnosticsHandler .new ,
206
204
DIAGNOSTIC_REQUEST_GET_SERVER_PORT : DiagnosticGetServerPortHandler .new ,
207
- //
205
+
208
206
EDIT_REQUEST_FORMAT : EditFormatHandler .new ,
209
207
EDIT_REQUEST_FORMAT_IF_ENABLED : EditFormatIfEnabledHandler .new ,
210
208
EDIT_REQUEST_GET_ASSISTS : EditGetAssistsHandler .new ,
@@ -223,19 +221,19 @@ class LegacyAnalysisServer extends AnalysisServer {
223
221
EDIT_REQUEST_GET_POSTFIX_COMPLETION : EditGetPostfixCompletionHandler .new ,
224
222
EDIT_REQUEST_LIST_POSTFIX_COMPLETION_TEMPLATES :
225
223
EditListPostfixCompletionTemplatesHandler .new ,
226
- //
224
+
227
225
EXECUTION_REQUEST_CREATE_CONTEXT : ExecutionCreateContextHandler .new ,
228
226
EXECUTION_REQUEST_DELETE_CONTEXT : ExecutionDeleteContextHandler .new ,
229
227
EXECUTION_REQUEST_GET_SUGGESTIONS : ExecutionGetSuggestionsHandler .new ,
230
228
EXECUTION_REQUEST_MAP_URI : ExecutionMapUriHandler .new ,
231
229
EXECUTION_REQUEST_SET_SUBSCRIPTIONS : ExecutionSetSubscriptionsHandler .new ,
232
- //
230
+
233
231
FLUTTER_REQUEST_GET_WIDGET_DESCRIPTION :
234
232
FlutterGetWidgetDescriptionHandler .new ,
235
233
FLUTTER_REQUEST_SET_WIDGET_PROPERTY_VALUE :
236
234
FlutterSetWidgetPropertyValueHandler .new ,
237
235
FLUTTER_REQUEST_SET_SUBSCRIPTIONS : FlutterSetSubscriptionsHandler .new ,
238
- //
236
+
239
237
SEARCH_REQUEST_FIND_ELEMENT_REFERENCES :
240
238
SearchFindElementReferencesHandler .new ,
241
239
SEARCH_REQUEST_FIND_MEMBER_DECLARATIONS :
@@ -247,15 +245,14 @@ class LegacyAnalysisServer extends AnalysisServer {
247
245
SEARCH_REQUEST_GET_ELEMENT_DECLARATIONS :
248
246
SearchGetElementDeclarationsHandler .new ,
249
247
SEARCH_REQUEST_GET_TYPE_HIERARCHY : SearchGetTypeHierarchyHandler .new ,
250
- //
248
+
251
249
SERVER_REQUEST_CANCEL_REQUEST : ServerCancelRequestHandler .new ,
252
250
SERVER_REQUEST_GET_VERSION : ServerGetVersionHandler .new ,
253
251
SERVER_REQUEST_SET_CLIENT_CAPABILITIES :
254
252
ServerSetClientCapabilitiesHandler .new ,
255
253
SERVER_REQUEST_SET_SUBSCRIPTIONS : ServerSetSubscriptionsHandler .new ,
256
254
SERVER_REQUEST_SHUTDOWN : ServerShutdownHandler .new ,
257
255
258
- //
259
256
LSP_REQUEST_HANDLE : LspOverLegacyHandler .new ,
260
257
};
261
258
@@ -364,11 +361,6 @@ class LegacyAnalysisServer extends AnalysisServer {
364
361
365
362
/// Initialize a newly created server to receive requests from and send
366
363
/// responses to the given [channel] .
367
- ///
368
- /// If [rethrowExceptions] is true, then any exceptions thrown by analysis are
369
- /// propagated up the call stack. The default is true to allow analysis
370
- /// exceptions to show up in unit tests, but it should be set to false when
371
- /// running a full analysis server.
372
364
LegacyAnalysisServer (
373
365
this .channel,
374
366
ResourceProvider baseResourceProvider,
@@ -379,15 +371,14 @@ class LegacyAnalysisServer extends AnalysisServer {
379
371
InstrumentationService instrumentationService, {
380
372
http.Client ? httpClient,
381
373
ProcessRunner ? processRunner,
382
- RequestStatisticsHelper ? requestStatistics,
374
+ super . requestStatistics,
383
375
DiagnosticServer ? diagnosticServer,
384
376
this .detachableFileSystemManager,
385
- // Disable to avoid using this in unit tests.
386
- bool enableBlazeWatcher = false ,
387
- DartFixPromptManager ? dartFixPromptManager,
377
+ super .enableBlazeWatcher,
378
+ super .dartFixPromptManager,
388
379
super .providedByteStore,
389
380
super .pluginManager,
390
- bool retainDataForTesting = false ,
381
+ super . retainDataForTesting,
391
382
}) : lspClientConfiguration = lsp.LspClientConfiguration (
392
383
baseResourceProvider.pathContext,
393
384
),
@@ -402,10 +393,6 @@ class LegacyAnalysisServer extends AnalysisServer {
402
393
httpClient,
403
394
processRunner,
404
395
NotificationManager (channel, baseResourceProvider.pathContext),
405
- requestStatistics: requestStatistics,
406
- enableBlazeWatcher: enableBlazeWatcher,
407
- dartFixPromptManager: dartFixPromptManager,
408
- retainDataForTesting: retainDataForTesting,
409
396
) {
410
397
var contextManagerCallbacks = ServerContextManagerCallbacks (
411
398
this ,
0 commit comments