| Index: pkg/analyzer/lib/src/summary/format.dart
|
| diff --git a/pkg/analyzer/lib/src/summary/format.dart b/pkg/analyzer/lib/src/summary/format.dart
|
| index d78efbc862fbf4b5f58f1612202d22989349fd7e..258bb5e2337eef68979e4e8649b0365b75bade0e 100644
|
| --- a/pkg/analyzer/lib/src/summary/format.dart
|
| +++ b/pkg/analyzer/lib/src/summary/format.dart
|
| @@ -11,6 +11,19 @@ import 'flat_buffers.dart' as fb;
|
| import 'idl.dart' as idl;
|
| import 'dart:convert' as convert;
|
|
|
| +class _IndexElementKindReader extends fb.Reader<idl.IndexElementKind> {
|
| + const _IndexElementKindReader() : super();
|
| +
|
| + @override
|
| + int get size => 1;
|
| +
|
| + @override
|
| + idl.IndexElementKind read(fb.BufferPointer bp) {
|
| + int index = const fb.Uint8Reader().read(bp);
|
| + return idl.IndexElementKind.values[index];
|
| + }
|
| +}
|
| +
|
| class _IndexRelationKindReader extends fb.Reader<idl.IndexRelationKind> {
|
| const _IndexRelationKindReader() : super();
|
|
|
| @@ -1354,6 +1367,7 @@ abstract class _PackageBundleMixin implements idl.PackageBundle {
|
| class PackageIndexBuilder extends Object with _PackageIndexMixin implements idl.PackageIndex {
|
| bool _finished = false;
|
|
|
| + List<idl.IndexElementKind> _elementKinds;
|
| List<int> _elementLibraryUris;
|
| List<int> _elementOffsets;
|
| List<int> _elementUnits;
|
| @@ -1362,6 +1376,18 @@ class PackageIndexBuilder extends Object with _PackageIndexMixin implements idl.
|
| List<String> _uris;
|
|
|
| @override
|
| + List<idl.IndexElementKind> get elementKinds => _elementKinds ??= <idl.IndexElementKind>[];
|
| +
|
| + /**
|
| + * Each item of this list corresponds to a unique referenced element. It is
|
| + * the kind of the element.
|
| + */
|
| + void set elementKinds(List<idl.IndexElementKind> _value) {
|
| + assert(!_finished);
|
| + _elementKinds = _value;
|
| + }
|
| +
|
| + @override
|
| List<int> get elementLibraryUris => _elementLibraryUris ??= <int>[];
|
|
|
| /**
|
| @@ -1438,8 +1464,9 @@ class PackageIndexBuilder extends Object with _PackageIndexMixin implements idl.
|
| _uris = _value;
|
| }
|
|
|
| - PackageIndexBuilder({List<int> elementLibraryUris, List<int> elementOffsets, List<int> elementUnits, List<int> elementUnitUris, List<UnitIndexBuilder> units, List<String> uris})
|
| - : _elementLibraryUris = elementLibraryUris,
|
| + PackageIndexBuilder({List<idl.IndexElementKind> elementKinds, List<int> elementLibraryUris, List<int> elementOffsets, List<int> elementUnits, List<int> elementUnitUris, List<UnitIndexBuilder> units, List<String> uris})
|
| + : _elementKinds = elementKinds,
|
| + _elementLibraryUris = elementLibraryUris,
|
| _elementOffsets = elementOffsets,
|
| _elementUnits = elementUnits,
|
| _elementUnitUris = elementUnitUris,
|
| @@ -1454,12 +1481,16 @@ class PackageIndexBuilder extends Object with _PackageIndexMixin implements idl.
|
| fb.Offset finish(fb.Builder fbBuilder) {
|
| assert(!_finished);
|
| _finished = true;
|
| + fb.Offset offset_elementKinds;
|
| fb.Offset offset_elementLibraryUris;
|
| fb.Offset offset_elementOffsets;
|
| fb.Offset offset_elementUnits;
|
| fb.Offset offset_elementUnitUris;
|
| fb.Offset offset_units;
|
| fb.Offset offset_uris;
|
| + if (!(_elementKinds == null || _elementKinds.isEmpty)) {
|
| + offset_elementKinds = fbBuilder.writeListUint8(_elementKinds.map((b) => b.index).toList());
|
| + }
|
| if (!(_elementLibraryUris == null || _elementLibraryUris.isEmpty)) {
|
| offset_elementLibraryUris = fbBuilder.writeListUint32(_elementLibraryUris);
|
| }
|
| @@ -1479,6 +1510,9 @@ class PackageIndexBuilder extends Object with _PackageIndexMixin implements idl.
|
| offset_uris = fbBuilder.writeList(_uris.map((b) => fbBuilder.writeString(b)).toList());
|
| }
|
| fbBuilder.startTable();
|
| + if (offset_elementKinds != null) {
|
| + fbBuilder.addOffset(6, offset_elementKinds);
|
| + }
|
| if (offset_elementLibraryUris != null) {
|
| fbBuilder.addOffset(2, offset_elementLibraryUris);
|
| }
|
| @@ -1518,6 +1552,7 @@ class _PackageIndexImpl extends Object with _PackageIndexMixin implements idl.Pa
|
|
|
| _PackageIndexImpl(this._bp);
|
|
|
| + List<idl.IndexElementKind> _elementKinds;
|
| List<int> _elementLibraryUris;
|
| List<int> _elementOffsets;
|
| List<int> _elementUnits;
|
| @@ -1526,6 +1561,12 @@ class _PackageIndexImpl extends Object with _PackageIndexMixin implements idl.Pa
|
| List<String> _uris;
|
|
|
| @override
|
| + List<idl.IndexElementKind> get elementKinds {
|
| + _elementKinds ??= const fb.ListReader<idl.IndexElementKind>(const _IndexElementKindReader()).vTableGet(_bp, 6, const <idl.IndexElementKind>[]);
|
| + return _elementKinds;
|
| + }
|
| +
|
| + @override
|
| List<int> get elementLibraryUris {
|
| _elementLibraryUris ??= const fb.Uint32ListReader().vTableGet(_bp, 2, const <int>[]);
|
| return _elementLibraryUris;
|
| @@ -1566,6 +1607,7 @@ abstract class _PackageIndexMixin implements idl.PackageIndex {
|
| @override
|
| Map<String, Object> toJson() {
|
| Map<String, Object> _result = <String, Object>{};
|
| + if (elementKinds.isNotEmpty) _result["elementKinds"] = elementKinds.map((_value) => _value.toString().split('.')[1]).toList();
|
| if (elementLibraryUris.isNotEmpty) _result["elementLibraryUris"] = elementLibraryUris;
|
| if (elementOffsets.isNotEmpty) _result["elementOffsets"] = elementOffsets;
|
| if (elementUnits.isNotEmpty) _result["elementUnits"] = elementUnits;
|
| @@ -1577,6 +1619,7 @@ abstract class _PackageIndexMixin implements idl.PackageIndex {
|
|
|
| @override
|
| Map<String, Object> toMap() => {
|
| + "elementKinds": elementKinds,
|
| "elementLibraryUris": elementLibraryUris,
|
| "elementOffsets": elementOffsets,
|
| "elementUnits": elementUnits,
|
|
|