File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ func NewGolangParser() (*GoParser, error) {
8181 }, nil
8282}
8383
84+ // PreserveComments will attempt to preserve any comments associated with
85+ // the golang types. This feature is still a work in progress, and may not
86+ // preserve all comments or match all expectations.
8487func (p * GoParser ) PreserveComments () * GoParser {
8588 p .preserveComments = true
8689 return p
Original file line number Diff line number Diff line change @@ -19,6 +19,18 @@ type CommentedStructure struct {
1919
2020 /* Another leading comment */
2121 Block string
22+
23+ /* Multi
24+ Line
25+ Comment
26+ */
27+ MultiLine string
28+ }
29+
30+ type InheritedCommentedStructure struct {
31+ // CommentedStructure is a commented field, but in typescript it has no place
32+ // since it is covered by an "extend" clause. Not sure where to put it.
33+ CommentedStructure
2234}
2335
2436/*
@@ -28,4 +40,5 @@ type BlockComment struct {
2840}
2941
3042// Constant is just a value
43+ // Constants are not yet supported for comments
3144const Constant = "value" // Constant comment
Original file line number Diff line number Diff line change @@ -21,7 +21,16 @@ export interface CommentedStructure {
2121 readonly All : string ; // Inline comment
2222 // Another leading comment
2323 readonly Block : string ;
24+ /* Multi
25+ Line
26+ Comment
27+ */
28+ readonly MultiLine : string ;
2429}
2530
2631// From comments/comments.go
2732export const Constant = "value" ;
33+
34+ // From comments/comments.go
35+ export interface InheritedCommentedStructure extends CommentedStructure {
36+ }
You can’t perform that action at this time.
0 commit comments