@@ -8,12 +8,10 @@ import 'package:analyzer/file_system/file_system.dart';
88import 'package:dartdoc/src/comment_references/parser.dart' ;
99
1010abstract class ModelCommentReference {
11- /// Does the structure of the reference itself imply a possible default
11+ /// Does the structure of the reference itself imply a possible unnamed
1212 /// constructor?
13- // TODO(jcollins-g): rewrite/discard this once default constructor tear-off
14- // design process is complete.
15- bool get allowDefaultConstructor;
16- bool get allowDefaultConstructorParameter;
13+ bool get allowUnnamedConstructor;
14+ bool get allowUnnamedConstructorParameter;
1715 String get codeRef;
1816 bool get hasConstructorHint;
1917 bool get hasCallableHint;
@@ -34,42 +32,45 @@ abstract class ModelCommentReference {
3432/// information needed for Dartdoc. Drops link to the [CommentReference]
3533/// and [ResourceProvider] after construction.
3634class _ModelCommentReferenceImpl implements ModelCommentReference {
37- bool _allowDefaultConstructor ;
35+ bool _allowUnnamedConstructor ;
3836
3937 void _initAllowCache () {
4038 var referencePieces = parsed.whereType <IdentifierNode >().toList ();
41- _allowDefaultConstructor = false ;
42- _allowDefaultConstructorParameter = false ;
39+ _allowUnnamedConstructor = false ;
40+ _allowUnnamedConstructorParameter = false ;
4341 if (referencePieces.length >= 2 ) {
4442 IdentifierNode nodeLast;
4543 for (var f in referencePieces) {
4644 if (f.text == nodeLast? .text) {
4745 if (identical (referencePieces.last, f)) {
48- _allowDefaultConstructor = true ;
46+ _allowUnnamedConstructor = true ;
4947 } else {
50- _allowDefaultConstructorParameter = true ;
48+ _allowUnnamedConstructorParameter = true ;
5149 }
5250 }
5351 nodeLast = f;
5452 }
53+ if (referencePieces.last.text == 'new' ) {
54+ _allowUnnamedConstructor = true ;
55+ }
5556 }
5657 }
5758
5859 @override
59- bool get allowDefaultConstructor {
60- if (_allowDefaultConstructor == null ) {
60+ bool get allowUnnamedConstructor {
61+ if (_allowUnnamedConstructor == null ) {
6162 _initAllowCache ();
6263 }
63- return _allowDefaultConstructor ;
64+ return _allowUnnamedConstructor ;
6465 }
6566
66- bool _allowDefaultConstructorParameter ;
67+ bool _allowUnnamedConstructorParameter ;
6768 @override
68- bool get allowDefaultConstructorParameter {
69- if (_allowDefaultConstructorParameter == null ) {
69+ bool get allowUnnamedConstructorParameter {
70+ if (_allowUnnamedConstructorParameter == null ) {
7071 _initAllowCache ();
7172 }
72- return _allowDefaultConstructorParameter ;
73+ return _allowUnnamedConstructorParameter ;
7374 }
7475
7576 @override
0 commit comments