-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement doc comments for enum value because inheriting from symbol …
…base is not desired
- Loading branch information
Curtis Keller
committed
Mar 29, 2024
1 parent
502b90e
commit e02dfaf
Showing
7 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
NTypewriter.CodeModel.Tests/EnumValue/DocComments/expectedResult.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
One | ||
Two | ||
Three | ||
This is the number four. (4)Four | ||
This is the number five. (5)Five |
25 changes: 25 additions & 0 deletions
25
NTypewriter.CodeModel.Tests/EnumValue/DocComments/inputCode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.ComponentModel; | ||
|
||
namespace NTypewriter.Tests.CodeModel | ||
{ | ||
enum EnumWithDocComments | ||
{ | ||
One = 1, | ||
Two = 2, | ||
Three = 3, | ||
/// <summary> | ||
/// This is the number four. (4) | ||
/// </summary> | ||
Four = 4, | ||
/// <summary> | ||
/// This is the number five. (5) | ||
/// </summary> | ||
Five = 5, | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
NTypewriter.CodeModel.Tests/EnumValue/DocComments/inputTemplate.tsnt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- capture captured | ||
for enum in data.Enums | Symbols.WhereNamespaceStartsWith "NTypewriter.Tests.CodeModel" | ||
for enumValue in enum.Values }} | ||
{{- if enumValue.DocComment && enumValue.DocComment.Summary }} | ||
{{- enumValue.DocComment.Summary }} | ||
{{- end }} | ||
{{- enumValue.Name }} | ||
{{ end | ||
end | ||
end | ||
Save captured "result" }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters