Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Side by Side Diff: pkg/analyzer/lib/src/summary/idl.dart

Issue 1743963002: Index defined top-level and class member names. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * This file is an "idl" style description of the summary format. It 6 * This file is an "idl" style description of the summary format. It
7 * contains abstract classes which declare the interface for reading data from 7 * contains abstract classes which declare the interface for reading data from
8 * summaries. It is parsed and transformed into code that implements the 8 * summaries. It is parsed and transformed into code that implements the
9 * summary format. 9 * summary format.
10 * 10 *
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 /** 142 /**
143 * If this is an instantiation of a generic type or generic executable, the 143 * If this is an instantiation of a generic type or generic executable, the
144 * type arguments used to instantiate it. Trailing type arguments of type 144 * type arguments used to instantiate it. Trailing type arguments of type
145 * `dynamic` are omitted. 145 * `dynamic` are omitted.
146 */ 146 */
147 @Id(1) 147 @Id(1)
148 List<EntityRef> get typeArguments; 148 List<EntityRef> get typeArguments;
149 } 149 }
150 150
151 /** 151 /**
152 * Enum used to indicate the kind of a name in index.
153 */
154 enum IndexNameKind {
155 /**
156 * A top-level element.
157 */
158 topLevel,
159
160 /**
161 * A class member.
162 */
163 classMember
164 }
165
166 /**
152 * Enum used to indicate the kind of an index relation. 167 * Enum used to indicate the kind of an index relation.
153 */ 168 */
154 enum IndexRelationKind { 169 enum IndexRelationKind {
155 /** 170 /**
156 * Left: class. 171 * Left: class.
157 * Is extended by. 172 * Is extended by.
158 * Right: other class declaration. 173 * Right: other class declaration.
159 */ 174 */
160 IS_EXTENDED_BY, 175 IS_EXTENDED_BY,
161 176
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 */ 507 */
493 @TopLevel('Indx') 508 @TopLevel('Indx')
494 abstract class PackageIndex extends base.SummaryClass { 509 abstract class PackageIndex extends base.SummaryClass {
495 factory PackageIndex.fromBuffer(List<int> buffer) => 510 factory PackageIndex.fromBuffer(List<int> buffer) =>
496 generated.readPackageIndex(buffer); 511 generated.readPackageIndex(buffer);
497 512
498 /** 513 /**
499 * Each item of this list corresponds to a unique referenced element. It is 514 * Each item of this list corresponds to a unique referenced element. It is
500 * the kind of the synthetic element. 515 * the kind of the synthetic element.
501 */ 516 */
502 @Id(6) 517 @Id(5)
503 List<IndexSyntheticElementKind> get elementKinds; 518 List<IndexSyntheticElementKind> get elementKinds;
504 519
505 /** 520 /**
506 * Each item of this list corresponds to a unique library URI with an element 521 * Each item of this list corresponds to a unique library URI with an element
507 * referenced in the [PackageIndex]. It is an index into [uris] list. 522 * referenced in the [PackageIndex]. It is an index into [uris] list.
Paul Berry 2016/02/29 20:26:02 I assume this is now an index into the [strings] l
508 */ 523 */
509 @Id(2) 524 @Id(2)
510 List<int> get elementLibraryUris; 525 List<int> get elementLibraryUris;
511 526
512 /** 527 /**
513 * Each item of this list corresponds to a unique referenced element. It is 528 * Each item of this list corresponds to a unique referenced element. It is
514 * the offset of the element name relative to the beginning of the file. The 529 * the offset of the element name relative to the beginning of the file. The
515 * list is sorted in ascending order, so that the client can quickly check 530 * list is sorted in ascending order, so that the client can quickly check
516 * whether an element is referenced in this [PackageIndex]. 531 * whether an element is referenced in this [PackageIndex].
517 */ 532 */
518 @Id(1) 533 @Id(1)
519 List<int> get elementOffsets; 534 List<int> get elementOffsets;
520 535
521 /** 536 /**
522 * Each item of this list corresponds to a unique referenced element. It is 537 * Each item of this list corresponds to a unique referenced element. It is
523 * the index into [elementLibraryUris] and [elementUnitUris] for the library 538 * the index into [elementLibraryUris] and [elementUnitUris] for the library
524 * specific unit where the element is declared. 539 * specific unit where the element is declared.
525 */ 540 */
526 @Id(0) 541 @Id(0)
527 List<int> get elementUnits; 542 List<int> get elementUnits;
528 543
529 /** 544 /**
530 * Each item of this list corresponds to a unique unit URI with an element 545 * Each item of this list corresponds to a unique unit URI with an element
531 * referenced in the [PackageIndex]. It is an index into [uris] list. 546 * referenced in the [PackageIndex]. It is an index into [uris] list.
Paul Berry 2016/02/29 20:26:02 Same question here.
532 */ 547 */
533 @Id(3) 548 @Id(3)
534 List<int> get elementUnitUris; 549 List<int> get elementUnitUris;
535 550
536 /** 551 /**
552 * List of unique element strings used in this [PackageIndex].
553 */
554 @Id(6)
555 List<String> get strings;
556
557 /**
537 * List of units indexed in this [PackageIndex]. 558 * List of units indexed in this [PackageIndex].
538 */ 559 */
539 @Id(5) 560 @Id(4)
540 List<UnitIndex> get units; 561 List<UnitIndex> get units;
541
542 /**
543 * List of unique URIs used in this [PackageIndex].
544 */
545 @Id(4)
546 List<String> get uris;
547 } 562 }
548 563
549 /** 564 /**
550 * Enum used to indicate the kind of entity referred to by a 565 * Enum used to indicate the kind of entity referred to by a
551 * [LinkedReference]. 566 * [LinkedReference].
552 */ 567 */
553 enum ReferenceKind { 568 enum ReferenceKind {
554 /** 569 /**
555 * The entity is a class or enum. 570 * The entity is a class or enum.
556 */ 571 */
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 * The entity being referred to does not exist. 627 * The entity being referred to does not exist.
613 */ 628 */
614 unresolved 629 unresolved
615 } 630 }
616 631
617 /** 632 /**
618 * Index information about a unit in a [PackageIndex]. 633 * Index information about a unit in a [PackageIndex].
619 */ 634 */
620 abstract class UnitIndex extends base.SummaryClass { 635 abstract class UnitIndex extends base.SummaryClass {
621 /** 636 /**
637 * Each item of this list is the kind of an element defined in this unit.
638 */
639 @Id(7)
640 List<IndexNameKind> get definedNameKinds;
641
642 /**
643 * Each item of this list is the name offset of an element defined in this
644 * unit relative to the beginning of the file.
645 */
646 @Id(8)
647 List<int> get definedNameOffsets;
648
649 /**
650 * Each item of this list corresponds to an element defined in this unit. It
651 * is an index into [PackageIndex.strings] list. The list is sorted in
652 * ascending order, so that the client can quickly find name definitions in
653 * this [UnitIndex].
654 */
655 @Id(6)
656 List<int> get definedNames;
657
658 /**
622 * Each item of this list is the index into [PackageIndex.elementUnits] and 659 * Each item of this list is the index into [PackageIndex.elementUnits] and
623 * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so 660 * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so
624 * that the client can quickly find element references in this [UnitIndex]. 661 * that the client can quickly find element references in this [UnitIndex].
625 */ 662 */
626 @Id(4) 663 @Id(4)
627 List<int> get elements; 664 List<int> get elements;
628 665
629 /** 666 /**
630 * Each item of this list is the kind of the element usage. 667 * Each item of this list is the kind of the element usage.
631 */ 668 */
(...skipping 1558 matching lines...) Expand 10 before | Expand all | Expand 10 after
2190 */ 2227 */
2191 @Id(11) 2228 @Id(11)
2192 int get visibleLength; 2229 int get visibleLength;
2193 2230
2194 /** 2231 /**
2195 * If a local variable, the beginning of the visible range; zero otherwise. 2232 * If a local variable, the beginning of the visible range; zero otherwise.
2196 */ 2233 */
2197 @Id(12) 2234 @Id(12)
2198 int get visibleOffset; 2235 int get visibleOffset;
2199 } 2236 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698