Skip to content

Commit 74ec75e

Browse files
committed
add more test data
1 parent 30b8729 commit 74ec75e

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

convert.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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.
8487
func (p *GoParser) PreserveComments() *GoParser {
8588
p.preserveComments = true
8689
return p

testdata/comments/comments.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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
3144
const Constant = "value" // Constant comment

testdata/comments/comments.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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
2732
export const Constant = "value";
33+
34+
// From comments/comments.go
35+
export interface InheritedCommentedStructure extends CommentedStructure {
36+
}

0 commit comments

Comments
 (0)