Skip to content

Commit ba86b99

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Remove V1 UriReferencedElement.
Change-Id: I3590bde0ffb50ae3e85c71d436201294c5390dfd Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423072 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 34a97d2 commit ba86b99

File tree

7 files changed

+2
-98
lines changed

7 files changed

+2
-98
lines changed

pkg/analyzer/api.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3134,16 +3134,6 @@ package:analyzer/dart/element/element.dart:
31343134
shownNames (getter: List<String>)
31353135
UndefinedElement (class extends Object implements Element, deprecated):
31363136
new (constructor: UndefinedElement Function())
3137-
UriReferencedElement (class extends Object implements _ExistingElement, deprecated):
3138-
new (constructor: UriReferencedElement Function())
3139-
uri (getter: String?)
3140-
uriEnd (getter: int)
3141-
uriOffset (getter: int)
3142-
_ExistingElement (class extends Object implements Element, deprecated):
3143-
new (constructor: _ExistingElement Function())
3144-
declaration (getter: Element, deprecated)
3145-
librarySource (getter: Source)
3146-
source (getter: Source)
31473137
package:analyzer/dart/element/element2.dart:
31483138
Annotatable (class extends Object):
31493139
new (constructor: Annotatable Function())

pkg/analyzer/lib/dart/element/element.dart

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
/// represented by an element.
3737
library;
3838

39-
import 'package:_fe_analyzer_shared/src/base/analyzer_public_api.dart';
4039
import 'package:analyzer/dart/analysis/session.dart';
4140
import 'package:analyzer/dart/constant/value.dart';
4241
import 'package:analyzer/dart/element/element2.dart';
@@ -747,37 +746,3 @@ abstract class ShowElementCombinator implements NamespaceCombinator {
747746
/// Clients may not extend, implement or mix-in this class.
748747
@Deprecated('Not used anymore')
749748
abstract class UndefinedElement implements Element {}
750-
751-
/// An element included into a library using some URI.
752-
///
753-
/// Clients may not extend, implement or mix-in this class.
754-
@Deprecated('Use Element2 instead')
755-
abstract class UriReferencedElement implements _ExistingElement {
756-
/// The URI that is used to include this element into the enclosing library,
757-
/// or `null` if this is the defining compilation unit of a library.
758-
String? get uri;
759-
760-
/// The offset of the character immediately following the last character of
761-
/// this node's URI, or `-1` for synthetic import.
762-
int get uriEnd;
763-
764-
/// The offset of the URI in the file, or `-1` if this element is synthetic.
765-
int get uriOffset;
766-
}
767-
768-
/// This class exists to provide non-nullable overrides for existing elements,
769-
/// as opposite to artificial "multiply defined" element.
770-
@Deprecated('Use Element2 instead')
771-
@AnalyzerPublicApi(
772-
message: 'Exposed because it is implemented by various elements')
773-
abstract class _ExistingElement implements Element {
774-
@Deprecated(elementModelDeprecationMsg)
775-
@override
776-
Element get declaration;
777-
778-
@override
779-
Source get librarySource;
780-
781-
@override
782-
Source get source;
783-
}

pkg/analyzer/lib/src/dart/analysis/driver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ import 'package:meta/meta.dart';
100100
// TODO(scheglov): Clean up the list of implicitly analyzed files.
101101
class AnalysisDriver {
102102
/// The version of data format, should be incremented on every format change.
103-
static const int DATA_VERSION = 454;
103+
static const int DATA_VERSION = 455;
104104

105105
/// The number of exception contexts allowed to write. Once this field is
106106
/// zero, we stop writing any new exception contexts in this process.

pkg/analyzer/lib/src/dart/element/element.dart

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ abstract class ClassOrMixinElementImpl extends InterfaceElementImpl {
687687
}
688688

689689
/// A concrete implementation of [LibraryFragment].
690-
class CompilationUnitElementImpl extends UriReferencedElementImpl
690+
class CompilationUnitElementImpl extends _ExistingElementImpl
691691
implements LibraryFragment {
692692
/// The source that corresponds to this compilation unit.
693693
@override
@@ -10796,54 +10796,6 @@ mixin TypeParameterizedElementMixin on ElementImpl
1079610796
}
1079710797
}
1079810798

10799-
abstract class UriReferencedElementImpl extends _ExistingElementImpl
10800-
implements
10801-
// ignore:deprecated_member_use_from_same_package,analyzer_use_new_elements
10802-
UriReferencedElement {
10803-
/// The offset of the URI in the file, or `-1` if this node is synthetic.
10804-
int _uriOffset = -1;
10805-
10806-
/// The offset of the character immediately following the last character of
10807-
/// this node's URI, or `-1` if this node is synthetic.
10808-
int _uriEnd = -1;
10809-
10810-
/// The URI that is specified by this directive.
10811-
String? _uri;
10812-
10813-
/// Initialize a newly created import element to have the given [name] and
10814-
/// [offset]. The offset may be `-1` if the element is synthetic.
10815-
UriReferencedElementImpl(super.name, super.offset);
10816-
10817-
/// Return the URI that is specified by this directive.
10818-
@override
10819-
String? get uri => _uri;
10820-
10821-
/// Set the URI that is specified by this directive to be the given [uri].
10822-
set uri(String? uri) {
10823-
_uri = uri;
10824-
}
10825-
10826-
/// Return the offset of the character immediately following the last
10827-
/// character of this node's URI, or `-1` if this node is synthetic.
10828-
@override
10829-
int get uriEnd => _uriEnd;
10830-
10831-
/// Set the offset of the character immediately following the last character
10832-
/// of this node's URI to the given [offset].
10833-
set uriEnd(int offset) {
10834-
_uriEnd = offset;
10835-
}
10836-
10837-
/// Return the offset of the URI in the file, or `-1` if this node is
10838-
/// synthetic.
10839-
@override
10840-
int get uriOffset => _uriOffset;
10841-
10842-
/// Set the offset of the URI in the file to the given [offset].
10843-
set uriOffset(int offset) {
10844-
_uriOffset = offset;
10845-
}
10846-
}
1084710799

1084810800
/// Common base class for all analyzer-internal classes that implement
1084910801
/// `VariableElement2`.

pkg/analyzer/lib/src/summary2/bundle_reader.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,6 @@ class LibraryReader {
17551755
),
17561756
);
17571757

1758-
unitElement.uri = _reader.readOptionalStringReference();
17591758
unitElement.isSynthetic = _reader.readBool();
17601759

17611760
unitElement.libraryImports = _reader.readTypedList(() {

pkg/analyzer/lib/src/summary2/bundle_writer.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,6 @@ class BundleWriter {
629629
void _writeUnitElement(CompilationUnitElementImpl unitElement) {
630630
_sink.writeUInt30(_resolutionSink.offset);
631631

632-
_sink._writeOptionalStringReference(unitElement.uri);
633632
_sink.writeBool(unitElement.isSynthetic);
634633

635634
_writeList(unitElement.libraryImports, _writeImportElement);

pkg/analyzer/lib/src/summary2/library_builder.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,6 @@ class LibraryBuilder {
629629
);
630630
partUnitNode.declaredFragment = unitElement;
631631
unitElement.isSynthetic = !partFile.exists;
632-
unitElement.uri = partFile.uriStr;
633632
unitElement.setCodeRange(0, partUnitNode.length);
634633

635634
var unitReference =

0 commit comments

Comments
 (0)