@@ -93,9 +93,7 @@ import 'package:analysis_server/src/services/completion/completion_state.dart';
9393import 'package:analysis_server/src/services/execution/execution_context.dart' ;
9494import 'package:analysis_server/src/services/flutter/widget_descriptions.dart' ;
9595import 'package:analysis_server/src/services/refactoring/legacy/refactoring_manager.dart' ;
96- import 'package:analysis_server/src/services/user_prompts/dart_fix_prompt_manager.dart' ;
9796import 'package:analysis_server/src/utilities/process.dart' ;
98- import 'package:analysis_server/src/utilities/request_statistics.dart' ;
9997import 'package:analyzer/dart/analysis/results.dart' ;
10098import 'package:analyzer/dart/analysis/session.dart' ;
10199import 'package:analyzer/dart/ast/ast.dart' ;
@@ -167,8 +165,8 @@ class AnalysisServerOptions {
167165}
168166
169167/// 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.
172170class LegacyAnalysisServer extends AnalysisServer {
173171 /// A map from the name of a request to a function used to create a request
174172 /// handler.
@@ -192,19 +190,19 @@ class LegacyAnalysisServer extends AnalysisServer {
192190 ANALYSIS_REQUEST_SET_SUBSCRIPTIONS : AnalysisSetSubscriptionsHandler .new ,
193191 ANALYSIS_REQUEST_UPDATE_CONTENT : AnalysisUpdateContentHandler .new ,
194192 ANALYSIS_REQUEST_UPDATE_OPTIONS : AnalysisUpdateOptionsHandler .new ,
195- //
193+
196194 ANALYTICS_REQUEST_IS_ENABLED : AnalyticsIsEnabledHandler .new ,
197195 ANALYTICS_REQUEST_ENABLE : AnalyticsEnableHandler .new ,
198196 ANALYTICS_REQUEST_SEND_EVENT : AnalyticsSendEventHandler .new ,
199197 ANALYTICS_REQUEST_SEND_TIMING : AnalyticsSendTimingHandler .new ,
200- //
198+
201199 COMPLETION_REQUEST_GET_SUGGESTION_DETAILS2 :
202200 CompletionGetSuggestionDetails2Handler .new ,
203201 COMPLETION_REQUEST_GET_SUGGESTIONS2 : CompletionGetSuggestions2Handler .new ,
204- //
202+
205203 DIAGNOSTIC_REQUEST_GET_DIAGNOSTICS : DiagnosticGetDiagnosticsHandler .new ,
206204 DIAGNOSTIC_REQUEST_GET_SERVER_PORT : DiagnosticGetServerPortHandler .new ,
207- //
205+
208206 EDIT_REQUEST_FORMAT : EditFormatHandler .new ,
209207 EDIT_REQUEST_FORMAT_IF_ENABLED : EditFormatIfEnabledHandler .new ,
210208 EDIT_REQUEST_GET_ASSISTS : EditGetAssistsHandler .new ,
@@ -223,19 +221,19 @@ class LegacyAnalysisServer extends AnalysisServer {
223221 EDIT_REQUEST_GET_POSTFIX_COMPLETION : EditGetPostfixCompletionHandler .new ,
224222 EDIT_REQUEST_LIST_POSTFIX_COMPLETION_TEMPLATES :
225223 EditListPostfixCompletionTemplatesHandler .new ,
226- //
224+
227225 EXECUTION_REQUEST_CREATE_CONTEXT : ExecutionCreateContextHandler .new ,
228226 EXECUTION_REQUEST_DELETE_CONTEXT : ExecutionDeleteContextHandler .new ,
229227 EXECUTION_REQUEST_GET_SUGGESTIONS : ExecutionGetSuggestionsHandler .new ,
230228 EXECUTION_REQUEST_MAP_URI : ExecutionMapUriHandler .new ,
231229 EXECUTION_REQUEST_SET_SUBSCRIPTIONS : ExecutionSetSubscriptionsHandler .new ,
232- //
230+
233231 FLUTTER_REQUEST_GET_WIDGET_DESCRIPTION :
234232 FlutterGetWidgetDescriptionHandler .new ,
235233 FLUTTER_REQUEST_SET_WIDGET_PROPERTY_VALUE :
236234 FlutterSetWidgetPropertyValueHandler .new ,
237235 FLUTTER_REQUEST_SET_SUBSCRIPTIONS : FlutterSetSubscriptionsHandler .new ,
238- //
236+
239237 SEARCH_REQUEST_FIND_ELEMENT_REFERENCES :
240238 SearchFindElementReferencesHandler .new ,
241239 SEARCH_REQUEST_FIND_MEMBER_DECLARATIONS :
@@ -247,15 +245,14 @@ class LegacyAnalysisServer extends AnalysisServer {
247245 SEARCH_REQUEST_GET_ELEMENT_DECLARATIONS :
248246 SearchGetElementDeclarationsHandler .new ,
249247 SEARCH_REQUEST_GET_TYPE_HIERARCHY : SearchGetTypeHierarchyHandler .new ,
250- //
248+
251249 SERVER_REQUEST_CANCEL_REQUEST : ServerCancelRequestHandler .new ,
252250 SERVER_REQUEST_GET_VERSION : ServerGetVersionHandler .new ,
253251 SERVER_REQUEST_SET_CLIENT_CAPABILITIES :
254252 ServerSetClientCapabilitiesHandler .new ,
255253 SERVER_REQUEST_SET_SUBSCRIPTIONS : ServerSetSubscriptionsHandler .new ,
256254 SERVER_REQUEST_SHUTDOWN : ServerShutdownHandler .new ,
257255
258- //
259256 LSP_REQUEST_HANDLE : LspOverLegacyHandler .new ,
260257 };
261258
@@ -364,11 +361,6 @@ class LegacyAnalysisServer extends AnalysisServer {
364361
365362 /// Initialize a newly created server to receive requests from and send
366363 /// 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.
372364 LegacyAnalysisServer (
373365 this .channel,
374366 ResourceProvider baseResourceProvider,
@@ -379,15 +371,14 @@ class LegacyAnalysisServer extends AnalysisServer {
379371 InstrumentationService instrumentationService, {
380372 http.Client ? httpClient,
381373 ProcessRunner ? processRunner,
382- RequestStatisticsHelper ? requestStatistics,
374+ super . requestStatistics,
383375 DiagnosticServer ? diagnosticServer,
384376 this .detachableFileSystemManager,
385- // Disable to avoid using this in unit tests.
386- bool enableBlazeWatcher = false ,
387- DartFixPromptManager ? dartFixPromptManager,
377+ super .enableBlazeWatcher,
378+ super .dartFixPromptManager,
388379 super .providedByteStore,
389380 super .pluginManager,
390- bool retainDataForTesting = false ,
381+ super . retainDataForTesting,
391382 }) : lspClientConfiguration = lsp.LspClientConfiguration (
392383 baseResourceProvider.pathContext,
393384 ),
@@ -402,10 +393,6 @@ class LegacyAnalysisServer extends AnalysisServer {
402393 httpClient,
403394 processRunner,
404395 NotificationManager (channel, baseResourceProvider.pathContext),
405- requestStatistics: requestStatistics,
406- enableBlazeWatcher: enableBlazeWatcher,
407- dartFixPromptManager: dartFixPromptManager,
408- retainDataForTesting: retainDataForTesting,
409396 ) {
410397 var contextManagerCallbacks = ServerContextManagerCallbacks (
411398 this ,
0 commit comments