@@ -302,72 +302,6 @@ class LibraryFragmentScope implements Scope {
302
302
}
303
303
}
304
304
305
- class LibraryOrAugmentationScope extends EnclosedScope {
306
- final LibraryOrAugmentationElementImpl _container;
307
- List <ExtensionElement > extensions = [];
308
-
309
- factory LibraryOrAugmentationScope (
310
- LibraryOrAugmentationElementImpl container,
311
- ) {
312
- var importScope = _LibraryOrAugmentationImportScope (container);
313
- return LibraryOrAugmentationScope ._(container, importScope);
314
- }
315
-
316
- LibraryOrAugmentationScope ._(
317
- this ._container,
318
- _LibraryOrAugmentationImportScope importScope,
319
- ) : super (importScope) {
320
- extensions.addAll (importScope.extensions);
321
-
322
- for (var prefix in _container.prefixes) {
323
- if (! prefix.isWildcardVariable) {
324
- _addGetter (prefix);
325
- }
326
- }
327
- _container.library.units.forEach (_addUnitElements);
328
-
329
- // Add implicit 'dart:core' declarations.
330
- if ('${_container .source .uri }' == 'dart:core' ) {
331
- _addGetter (DynamicElementImpl .instance);
332
- _addGetter (NeverElementImpl .instance);
333
- }
334
-
335
- extensions = extensions.toFixedList ();
336
- }
337
-
338
- void _addExtension (ExtensionElement element) {
339
- if (element.isAugmentation) {
340
- return ;
341
- }
342
-
343
- _addGetter (element);
344
- if (! extensions.contains (element)) {
345
- extensions.add (element);
346
- }
347
- }
348
-
349
- void _addUnitElements (CompilationUnitElement compilationUnit) {
350
- for (var element in compilationUnit.accessors) {
351
- if (element.augmentation == null ) {
352
- _addPropertyAccessor (element);
353
- }
354
- }
355
-
356
- for (var element in compilationUnit.functions) {
357
- if (element.augmentation == null ) {
358
- _addGetter (element);
359
- }
360
- }
361
-
362
- compilationUnit.enums.forEach (_addGetter);
363
- compilationUnit.extensions.forEach (_addExtension);
364
- compilationUnit.extensionTypes.forEach (_addGetter);
365
- compilationUnit.typeAliases.forEach (_addGetter);
366
- compilationUnit.mixins.forEach (_addGetter);
367
- compilationUnit.classes.forEach (_addGetter);
368
- }
369
- }
370
-
371
305
class LocalScope extends EnclosedScope {
372
306
LocalScope (super .parent);
373
307
@@ -646,31 +580,3 @@ mixin _GettersAndSetters {
646
580
}
647
581
}
648
582
}
649
-
650
- class _LibraryOrAugmentationImportScope implements Scope {
651
- final LibraryOrAugmentationElementImpl _container;
652
- final PrefixScope _nullPrefixScope;
653
- List <ExtensionElement >? _extensions;
654
-
655
- _LibraryOrAugmentationImportScope (LibraryOrAugmentationElementImpl container)
656
- : _container = container,
657
- _nullPrefixScope = PrefixScope (
658
- libraryElement: container.library,
659
- parent: null ,
660
- libraryImports: container.libraryImports,
661
- prefix: null ,
662
- );
663
-
664
- List <ExtensionElement > get extensions {
665
- return _extensions ?? = {
666
- ..._nullPrefixScope._extensions,
667
- for (var prefix in _container.prefixes)
668
- ...(prefix.scope as PrefixScope )._extensions,
669
- }.toFixedList ();
670
- }
671
-
672
- @override
673
- ScopeLookupResult lookup (String id) {
674
- return _nullPrefixScope.lookup (id);
675
- }
676
- }
0 commit comments