Chromium Code Reviews| Index: pkg/analyzer/lib/src/summary/summarize_elements.dart |
| diff --git a/pkg/analyzer/lib/src/summary/summarize_elements.dart b/pkg/analyzer/lib/src/summary/summarize_elements.dart |
| index 794e5a9e07df04bbbac4cf38ef8991d740b74f57..f4c7595f78e73d675aa1f694bf3de629e17a5748 100644 |
| --- a/pkg/analyzer/lib/src/summary/summarize_elements.dart |
| +++ b/pkg/analyzer/lib/src/summary/summarize_elements.dart |
| @@ -180,7 +180,8 @@ class _CompilationUnitSerializer { |
| names.add(new UnlinkedPublicNameBuilder( |
| kind: ReferenceKind.classOrEnum, |
| name: cls.name, |
| - numTypeParameters: cls.typeParameters.length)); |
| + numTypeParameters: cls.typeParameters.length, |
| + executables: serializePublicStaticMethodsAndConstructors(cls))); |
| } |
| } |
| for (ClassElement enm in compilationUnit.enums) { |
| @@ -567,6 +568,35 @@ class _CompilationUnitSerializer { |
| } |
| /** |
| + * If [cls] is a class, return the list of its public static methods and |
| + * constructors. Otherwise return `null`. |
| + */ |
| + List<UnlinkedPublicNameBuilder> serializePublicStaticMethodsAndConstructors( |
| + ClassElement cls) { |
| + if (cls.kind == ElementKind.CLASS) { |
| + List<UnlinkedPublicNameBuilder> bs = <UnlinkedPublicNameBuilder>[]; |
| + for (MethodElement method in cls.methods) { |
| + if (method.isStatic && method.isPublic) { |
|
Paul Berry
2016/01/25 13:10:04
Do we need to filter out operators or does `method
scheglov
2016/01/25 17:27:09
Operators cannot be static, so we don't have stati
|
| + bs.add(new UnlinkedPublicNameBuilder( |
| + name: method.name, |
| + kind: ReferenceKind.staticMethod, |
| + numTypeParameters: method.typeParameters.length)); |
| + } |
| + } |
| + for (ConstructorElement constructor in cls.constructors) { |
| + if (constructor.isPublic && !constructor.isSynthetic) { |
| + bs.add(new UnlinkedPublicNameBuilder( |
| + name: constructor.name, |
| + kind: ReferenceKind.constructor, |
| + numTypeParameters: 0)); |
| + } |
| + } |
| + return bs; |
| + } |
| + return null; |
| + } |
| + |
| + /** |
| * Compute the reference index which should be stored in a [EntityRef]. |
| * |
| * If [linked] is true, and a new reference has to be created, the reference |