@@ -423,12 +423,28 @@ class TypeDefSpec extends @typedefspec, TypeSpec { }
423
423
* Examples:
424
424
*
425
425
* ```go
426
+ * Name string `json:"name"`
426
427
* s string
427
428
* x, y int
429
+ * p *Point
428
430
* Close() error
429
431
* io.Reader
430
432
* ~int | float32
431
433
* ```
434
+ * as in the following code:
435
+ * ```go
436
+ * struct {
437
+ * io.Reader
438
+ * Name string `json:"name"`
439
+ * x, y int
440
+ * }
441
+ * func (p *Point) f(s string) (x, y int) { }
442
+ * type MyInterface interface {
443
+ * Close() error
444
+ * io.Reader
445
+ * ~int32 | float32
446
+ * }
447
+ * ```
432
448
*/
433
449
class FieldBase extends @field, ExprParent {
434
450
/**
@@ -451,6 +467,15 @@ class FieldBase extends @field, ExprParent {
451
467
* Name string `json:"name"`
452
468
* x, y int
453
469
* ```
470
+ *
471
+ * as in the following code:
472
+ *
473
+ * ```go
474
+ * struct {
475
+ * Name string `json:"name"`
476
+ * x, y int
477
+ * }
478
+ * ```
454
479
*/
455
480
class FieldDecl extends FieldBase , Documentable , ExprParent {
456
481
StructTypeExpr st ;
@@ -488,6 +513,14 @@ class FieldDecl extends FieldBase, Documentable, ExprParent {
488
513
* ```go
489
514
* io.Reader
490
515
* ```
516
+ *
517
+ * as in the following code:
518
+ *
519
+ * ```go
520
+ * struct {
521
+ * io.Reader
522
+ * }
523
+ * ```
491
524
*/
492
525
class EmbeddedFieldDecl extends FieldDecl {
493
526
EmbeddedFieldDecl ( ) { not exists ( this .getNameExpr ( _) ) }
@@ -501,9 +534,16 @@ class EmbeddedFieldDecl extends FieldDecl {
501
534
* Examples:
502
535
*
503
536
* ```go
504
- * name string
537
+ * s string
505
538
* x, y int
506
539
* ```
540
+ *
541
+ * as in the following code:
542
+ *
543
+ * ```go
544
+ * func f(s string, x, y int) { }
545
+ * func g() (s string, x, y int){ return }
546
+ * ```
507
547
*/
508
548
class ParameterOrResultDecl extends FieldBase , Documentable , ExprParent {
509
549
int rawIndex ;
@@ -542,9 +582,15 @@ class ParameterOrResultDecl extends FieldBase, Documentable, ExprParent {
542
582
* Examples:
543
583
*
544
584
* ```go
545
- * name string
585
+ * s string
546
586
* x, y int
547
587
* ```
588
+ *
589
+ * as in the following code:
590
+ *
591
+ * ```go
592
+ * func f(s string, x, y int) { }
593
+ * ```
548
594
*/
549
595
class ParameterDecl extends ParameterOrResultDecl {
550
596
ParameterDecl ( ) { rawIndex >= 0 }
@@ -569,6 +615,13 @@ class ParameterDecl extends ParameterOrResultDecl {
569
615
* p *Point
570
616
* r io.Reader
571
617
* ```
618
+ *
619
+ * as in the following code:
620
+ *
621
+ * ```go
622
+ * func (p *Point) f() { }
623
+ * func (r io.Reader) g() { }
624
+ * ```
572
625
*/
573
626
class ReceiverDecl extends FieldBase , Documentable , ExprParent {
574
627
FuncDecl fd ;
@@ -600,6 +653,14 @@ class ReceiverDecl extends FieldBase, Documentable, ExprParent {
600
653
* r io.Reader
601
654
* x, y int
602
655
* ```
656
+ *
657
+ * as in the following code:
658
+ *
659
+ * ```go
660
+ * func f(error) { return nil }
661
+ * func g(r io.Reader) { return nil }
662
+ * func h(x, y int) { return }
663
+ * ```
603
664
*/
604
665
class ResultVariableDecl extends ParameterOrResultDecl {
605
666
ResultVariableDecl ( ) { rawIndex < 0 }
@@ -621,11 +682,18 @@ class ResultVariableDecl extends ParameterOrResultDecl {
621
682
* Examples:
622
683
*
623
684
* ```go
624
- * T any
625
685
* S, T comparable
686
+ * U any
626
687
* K ~int32 | float32
627
688
* _ any
628
689
* ```
690
+ *
691
+ * as in the following code:
692
+ *
693
+ * ```go
694
+ * type GenericStruct[S, T comparable, U any, K ~int32 | float32, _ any] struct { }
695
+ * func GenericFunction[S, T comparable, U any, K ~int32 | float32, _ any]() {}
696
+ * ```
629
697
*/
630
698
class TypeParamDecl extends @typeparamdecl, Documentable , ExprParent {
631
699
TypeParamDecl ( ) { typeparamdecls ( this , _, _) }
@@ -681,10 +749,20 @@ class TypeParamDecl extends @typeparamdecl, Documentable, ExprParent {
681
749
* Examples:
682
750
*
683
751
* ```go
684
- * Read([]byte) (int, error)
752
+ * Close() error
685
753
* io.Reader
686
754
* ~int32 | float32
687
755
* ```
756
+ *
757
+ * as in the following code:
758
+ *
759
+ * ```go
760
+ * type MyInterface interface {
761
+ * Close() error
762
+ * io.Reader
763
+ * ~int32 | float32
764
+ * }
765
+ * ```
688
766
*/
689
767
class InterfaceMemberSpec extends FieldBase , Documentable , ExprParent {
690
768
InterfaceTypeExpr ite ;
@@ -710,7 +788,15 @@ class InterfaceMemberSpec extends FieldBase, Documentable, ExprParent {
710
788
* Examples:
711
789
*
712
790
* ```go
713
- * Read([]byte) (int, error)
791
+ * Close() error
792
+ * ```
793
+ *
794
+ * as in the following code:
795
+ *
796
+ * ```go
797
+ * type MyInterface interface {
798
+ * Close() error
799
+ * }
714
800
* ```
715
801
*/
716
802
class MethodSpec extends InterfaceMemberSpec {
@@ -737,6 +823,15 @@ class MethodSpec extends InterfaceMemberSpec {
737
823
* io.Reader
738
824
* ~int32 | float32
739
825
* ```
826
+ *
827
+ * as in the following code:
828
+ *
829
+ * ```go
830
+ * type MyInterface interface {
831
+ * io.Reader
832
+ * ~int32 | float32
833
+ * }
834
+ * ```
740
835
*/
741
836
class EmbeddingSpec extends InterfaceMemberSpec {
742
837
EmbeddingSpec ( ) { not exists ( this .getChildExpr ( 1 ) ) }
0 commit comments