@@ -52,7 +52,6 @@ import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin;
5252import 'package:collection/collection.dart' ;
5353import 'package:http/http.dart' as http;
5454import 'package:meta/meta.dart' ;
55- import 'package:process/process.dart' ;
5655import 'package:watcher/watcher.dart' ;
5756
5857/// Instances of the class [LspAnalysisServer] implement an LSP-based server
@@ -127,7 +126,6 @@ class LspAnalysisServer extends AbstractAnalysisServer {
127126 CrashReportingAttachmentsBuilder crashReportingAttachmentsBuilder,
128127 InstrumentationService instrumentationService, {
129128 http.Client ? httpClient,
130- ProcessManager ? processManager,
131129 DiagnosticServer ? diagnosticServer,
132130 // Disable to avoid using this in unit tests.
133131 bool enableBazelWatcher = false ,
@@ -139,7 +137,6 @@ class LspAnalysisServer extends AbstractAnalysisServer {
139137 baseResourceProvider,
140138 instrumentationService,
141139 httpClient,
142- processManager,
143140 LspNotificationManager (channel, baseResourceProvider.pathContext),
144141 enableBazelWatcher: enableBazelWatcher,
145142 ) {
@@ -187,10 +184,10 @@ class LspAnalysisServer extends AbstractAnalysisServer {
187184 RefactoringWorkspace (driverMap.values, searchEngine);
188185
189186 void addPriorityFile (String filePath) {
190- // When pubspecs are opened, trigger pre-loading of pub package names and
191- // versions.
192- if ( file_paths.isPubspecYaml (resourceProvider.pathContext, filePath)) {
193- pubPackageService.beginCachePreloads ([filePath] );
187+ // When a pubspec is opened, trigger package name caching for completion.
188+ if ( ! pubPackageService.isRunning &&
189+ file_paths.isPubspecYaml (resourceProvider.pathContext, filePath)) {
190+ pubPackageService.beginPackageNamePreload ( );
194191 }
195192
196193 final didAdd = priorityFiles.add (filePath);
@@ -854,18 +851,6 @@ class LspServerContextManagerCallbacks extends ContextManagerCallbacks {
854851 analysisDriver.priorityFiles = analysisServer.priorityFiles.toList ();
855852 }
856853
857- @override
858- void pubspecChanged (String pubspecPath) {
859- analysisServer.pubPackageService.fetchPackageVersionsViaPubOutdated (
860- pubspecPath,
861- pubspecWasModified: true );
862- }
863-
864- @override
865- void pubspecRemoved (String pubspecPath) {
866- analysisServer.pubPackageService.flushPackageCaches (pubspecPath);
867- }
868-
869854 @override
870855 void recordAnalysisErrors (String path, List <protocol.AnalysisError > errors) {
871856 final errorsToSend = errors.where (_shouldSendError).toList ();
0 commit comments