Skip to content

Commit bb405b7

Browse files
committed
add a number of additional languages and their comment styles
1 parent 0216748 commit bb405b7

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

pkg/comments/comments.go

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,21 @@ type Language string
4343

4444
// LanguageParseOptions keeps track of source languages and their corresponding comment options
4545
var LanguageParseOptions map[Language]*lege.ParseOptions = map[Language]*lege.ParseOptions{
46-
"Go": CStyleCommentOptions,
47-
"Java": CStyleCommentOptions,
48-
"C": CStyleCommentOptions,
49-
"C++": CStyleCommentOptions,
50-
"C#": CStyleCommentOptions,
51-
"JavaScript": CStyleCommentOptions,
52-
"Python": HashStyleCommentOptions,
53-
"Ruby": HashStyleCommentOptions,
54-
"PHP": CStyleCommentOptions,
46+
"Go": CStyleCommentOptions,
47+
"Java": CStyleCommentOptions,
48+
"C": CStyleCommentOptions,
49+
"C++": CStyleCommentOptions,
50+
"C#": CStyleCommentOptions,
51+
"JavaScript": CStyleCommentOptions,
52+
"Python": HashStyleCommentOptions,
53+
"Ruby": HashStyleCommentOptions,
54+
"PHP": CStyleCommentOptions,
55+
"Shell": HashStyleCommentOptions,
56+
"Visual Basic": &lege.ParseOptions{Boundaries: []lege.Boundary{lege.Boundary{Start: "'", End: "\n"}}},
57+
"TypeScript": CStyleCommentOptions,
58+
"Objective-C": CStyleCommentOptions,
59+
"Groovy": CStyleCommentOptions,
60+
"Swift": CStyleCommentOptions,
5561
}
5662

5763
// Comments is a list of comments

0 commit comments

Comments
 (0)