@@ -7,7 +7,6 @@ import 'package:analysis_server/src/protocol_server.dart';
77import 'package:analysis_server/src/services/completion/dart/completion_manager.dart' ;
88import 'package:analysis_server/src/services/completion/dart/fuzzy_filter_sort.dart' ;
99import 'package:analysis_server/src/services/completion/dart/suggestion_builder.dart' ;
10- import 'package:analyzer/dart/element/element.dart' show LibraryElement;
1110import 'package:analyzer/dart/element/element2.dart' ;
1211import 'package:analyzer/src/dart/analysis/performance_logger.dart' ;
1312import 'package:analyzer/src/dart/analysis/results.dart' ;
@@ -179,7 +178,7 @@ class CiderCompletionComputer {
179178 .toSet ();
180179 for (var importedLibrary in importedLibraries) {
181180 var importedSuggestions = _importedLibrarySuggestions (
182- element: importedLibrary.asElement ,
181+ element: importedLibrary,
183182 performance: performance,
184183 );
185184 suggestionBuilders.addAll (importedSuggestions);
@@ -191,12 +190,12 @@ class CiderCompletionComputer {
191190 /// Return cached, or compute unprefixed suggestions for all elements
192191 /// exported from the library.
193192 List <CompletionSuggestionBuilder > _importedLibrarySuggestions ({
194- required LibraryElement element,
193+ required LibraryElement2 element,
195194 required OperationPerformanceImpl performance,
196195 }) {
197196 performance.getDataInt ('libraryCount' ).increment ();
198197
199- var path = element.source.fullName;
198+ var path = element.firstFragment.libraryFragment ! . source.fullName;
200199 var signature = _fileResolver.getLibraryLinkedSignature (path);
201200
202201 var cacheEntry = _cache._importedLibraries[path];
@@ -213,20 +212,20 @@ class CiderCompletionComputer {
213212 /// Compute all unprefixed suggestions for all elements exported from
214213 /// the library.
215214 List <CompletionSuggestionBuilder > _librarySuggestions (
216- LibraryElement element,
215+ LibraryElement2 element,
217216 ) {
218217 var suggestionBuilder = SuggestionBuilder (
219218 _dartCompletionRequest,
220219 useFilter: false ,
221220 );
222- suggestionBuilder.libraryUriStr = element.source. uri.toString ();
221+ suggestionBuilder.libraryUriStr = element.uri.toString ();
223222 var visitor = LibraryElementSuggestionBuilder (
224223 _dartCompletionRequest,
225224 suggestionBuilder,
226225 );
227- var exportMap = element.exportNamespace.definedNames ;
226+ var exportMap = element.exportNamespace.definedNames2 ;
228227 for (var definedElement in exportMap.values) {
229- definedElement.asElement2 ? . accept2 (visitor);
228+ definedElement.accept2 (visitor);
230229 }
231230 return suggestionBuilder.suggestions.toList ();
232231 }
0 commit comments