@@ -1478,7 +1478,7 @@ var TypeDoc;
1478
1478
var len = basePath . length ;
1479
1479
1480
1480
while ( basePath != dirname . substr ( 0 , len ) ) {
1481
- if ( len < = dirname . length ) {
1481
+ if ( len > = dirname . length ) {
1482
1482
return ;
1483
1483
}
1484
1484
@@ -1926,6 +1926,7 @@ var TypeDoc;
1926
1926
var parent = state . parentState . reflection ;
1927
1927
var reflection = new TypeDoc . Models . DeclarationReflection ( ) ;
1928
1928
reflection . name = ( state . flattenedName ? state . flattenedName + '.' : '' ) + state . getName ( ) ;
1929
+ reflection . originalName = state . declaration . name ;
1929
1930
reflection . parent = parent ;
1930
1931
1931
1932
state . reflection = reflection ;
@@ -2572,6 +2573,74 @@ var TypeDoc;
2572
2573
var Factories = TypeDoc . Factories ;
2573
2574
} ) ( TypeDoc || ( TypeDoc = { } ) ) ;
2574
2575
var TypeDoc ;
2576
+ ( function ( TypeDoc ) {
2577
+ ( function ( Factories ) {
2578
+ /**
2579
+ * A handler that moves comments with dot syntax to their target.
2580
+ */
2581
+ var DeepCommentHandler = ( function ( _super ) {
2582
+ __extends ( DeepCommentHandler , _super ) ;
2583
+ /**
2584
+ * Create a new CommentHandler instance.
2585
+ *
2586
+ * @param dispatcher The dispatcher this handler should be attached to.
2587
+ */
2588
+ function DeepCommentHandler ( dispatcher ) {
2589
+ _super . call ( this , dispatcher ) ;
2590
+
2591
+ dispatcher . on ( Factories . Dispatcher . EVENT_DECLARATION , this . onDeclaration , this , - 512 ) ;
2592
+ }
2593
+ /**
2594
+ * Triggered when the dispatcher starts processing a declaration.
2595
+ *
2596
+ * @param state The state that describes the current declaration and reflection.
2597
+ */
2598
+ DeepCommentHandler . prototype . onDeclaration = function ( state ) {
2599
+ var reflection = state . reflection ;
2600
+ if ( reflection . comment ) {
2601
+ return ;
2602
+ }
2603
+
2604
+ function push ( reflection ) {
2605
+ var part = reflection . originalName ;
2606
+ if ( reflection . isSignature ) {
2607
+ part = '' ;
2608
+ }
2609
+
2610
+ if ( part && part != '' ) {
2611
+ name = ( name == '' ? part : part + '.' + name ) ;
2612
+ }
2613
+ }
2614
+
2615
+ var name = '' ;
2616
+ var target = reflection . parent ;
2617
+ push ( reflection ) ;
2618
+
2619
+ while ( target instanceof TypeDoc . Models . DeclarationReflection ) {
2620
+ if ( target . comment ) {
2621
+ var tag = target . comment . getTag ( 'param' , name ) ;
2622
+ if ( tag ) {
2623
+ target . comment . tags . splice ( target . comment . tags . indexOf ( tag ) , 1 ) ;
2624
+ reflection . comment = new TypeDoc . Models . Comment ( '' , tag . text ) ;
2625
+ break ;
2626
+ }
2627
+ }
2628
+
2629
+ target = target . parent ;
2630
+ }
2631
+ } ;
2632
+ return DeepCommentHandler ;
2633
+ } ) ( Factories . BaseHandler ) ;
2634
+ Factories . DeepCommentHandler = DeepCommentHandler ;
2635
+
2636
+ /**
2637
+ * Register this handler.
2638
+ */
2639
+ Factories . Dispatcher . HANDLERS . push ( DeepCommentHandler ) ;
2640
+ } ) ( TypeDoc . Factories || ( TypeDoc . Factories = { } ) ) ;
2641
+ var Factories = TypeDoc . Factories ;
2642
+ } ) ( TypeDoc || ( TypeDoc = { } ) ) ;
2643
+ var TypeDoc ;
2575
2644
( function ( TypeDoc ) {
2576
2645
( function ( Factories ) {
2577
2646
/**
@@ -2931,14 +3000,14 @@ var TypeDoc;
2931
3000
function FunctionTypeHandler ( dispatcher ) {
2932
3001
_super . call ( this , dispatcher ) ;
2933
3002
2934
- dispatcher . on ( Factories . Dispatcher . EVENT_DECLARATION , this . onDeclaration , this , - 256 ) ;
3003
+ dispatcher . on ( Factories . Dispatcher . EVENT_END_DECLARATION , this . onEndDeclaration , this ) ;
2935
3004
}
2936
3005
/**
2937
- * Triggered when the dispatcher processes a declaration.
3006
+ * Triggered when the dispatcher has finished processing a declaration.
2938
3007
*
2939
3008
* @param state The state that describes the current declaration and reflection.
2940
3009
*/
2941
- FunctionTypeHandler . prototype . onDeclaration = function ( state ) {
3010
+ FunctionTypeHandler . prototype . onEndDeclaration = function ( state ) {
2942
3011
if ( state . isSignature ) {
2943
3012
return ;
2944
3013
}
@@ -3578,14 +3647,14 @@ var TypeDoc;
3578
3647
function ObjectLiteralHandler ( dispatcher ) {
3579
3648
_super . call ( this , dispatcher ) ;
3580
3649
3581
- dispatcher . on ( Factories . Dispatcher . EVENT_DECLARATION , this . onDeclaration , this , 1024 ) ;
3650
+ dispatcher . on ( Factories . Dispatcher . EVENT_END_DECLARATION , this . onEndDeclaration , this ) ;
3582
3651
}
3583
3652
/**
3584
- * Triggered when the dispatcher starts processing a declaration.
3653
+ * Triggered when the dispatcher has finished processing a declaration.
3585
3654
*
3586
3655
* @param state The state that describes the current declaration and reflection.
3587
3656
*/
3588
- ObjectLiteralHandler . prototype . onDeclaration = function ( state ) {
3657
+ ObjectLiteralHandler . prototype . onEndDeclaration = function ( state ) {
3589
3658
var _this = this ;
3590
3659
var literal = ObjectLiteralHandler . getLiteralDeclaration ( state . declaration ) ;
3591
3660
if ( literal && literal . getChildDecls ( ) . length > 0 ) {
0 commit comments