+32
-4
lines changedFilter options
+32
-4
lines changed Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
1
1
<Project>
2
2
3
3
<PropertyGroup>
4
-
<VersionPrefix>9.0.2-preview</VersionPrefix>
4
+
<VersionPrefix>9.1.0-preview</VersionPrefix>
5
5
<LangVersion>latest</LangVersion>
6
6
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
7
7
<NoWarn>$(NoWarn);CA1707</NoWarn>
Original file line number Diff line number Diff line change
@@ -909,6 +909,7 @@ namespace GraphQLParser.Visitors
909
909
{
910
910
public SDLPrinterOptions() { }
911
911
public int IndentSize { get; set; }
912
+
public bool PrintDescriptions { get; set; }
912
913
public bool EachDirectiveLocationOnNewLine { get; init; }
913
914
public bool EachUnionMemberOnNewLine { get; init; }
914
915
public bool PrintComments { get; init; }
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@ ... on CustomerType {
123
123
@"directive @skip(if: Boolean!) on
124
124
| FIELD
125
125
| FRAGMENT_SPREAD
126
-
| INLINE_FRAGMENT", false, true)]
126
+
| INLINE_FRAGMENT", false, true, true)]
127
127
[InlineData(8,
128
128
@"directive @twoArgs
129
129
(a: Int, b:
@@ -488,7 +488,7 @@ union Unity
488
488
| B
489
489
490
490
extend union Unity =
491
-
| C", true, false, true)]
491
+
| C", true, true, false, true)]
492
492
[InlineData(38,
493
493
@"enum Color
494
494
#comment
@@ -574,7 +574,7 @@ directive @skip(
574
574
mutation: M
575
575
subscription: S
576
576
}
577
-
""", true, false, false, 5)]
577
+
""", true, true, false, false, 5)]
578
578
[InlineData(45,
579
579
"""
580
580
"A component contains the parametric details of a PCB part."
@@ -834,18 +834,32 @@ implements Entity &
834
834
name: String
835
835
}
836
836
""")]
837
+
[InlineData(58,
838
+
""""
839
+
"description"
840
+
type Person {
841
+
"""description"""
842
+
name: String }
843
+
"""",
844
+
"""
845
+
type Person {
846
+
name: String
847
+
}
848
+
""", false, false)]
837
849
public async Task SDLPrinter_Should_Print_Document(
838
850
int number,
839
851
string text,
840
852
string expected,
841
853
bool writeComments = true,
854
+
bool writeDescriptions = true,
842
855
bool eachDirectiveLocationOnNewLine = false,
843
856
bool eachUnionMemberOnNewLine = false,
844
857
int indentSize = 2)
845
858
{
846
859
var printer = new SDLPrinter(new SDLPrinterOptions
847
860
{
848
861
PrintComments = writeComments,
862
+
PrintDescriptions = writeDescriptions,
849
863
EachDirectiveLocationOnNewLine = eachDirectiveLocationOnNewLine,
850
864
EachUnionMemberOnNewLine = eachUnionMemberOnNewLine,
851
865
IndentSize = indentSize,
Original file line number Diff line number Diff line change
@@ -132,6 +132,9 @@ async ValueTask WriteMultilineBlockString()
132
132
133
133
ValueTask WriteString() => WriteEncodedStringAsync(context, description.Value);
134
134
135
+
if (!Options.PrintDescriptions)
136
+
return default;
137
+
135
138
// http://spec.graphql.org/October2021/#StringValue
136
139
return ShouldBeMultilineBlockString()
137
140
? WriteMultilineBlockString()
@@ -1111,21 +1114,31 @@ public class SDLPrinterOptions
1111
1114
{
1112
1115
/// <summary>
1113
1116
/// Print comments into the output.
1117
+
/// By default <see langword="false"/>.
1114
1118
/// </summary>
1115
1119
public bool PrintComments { get; init; }
1116
1120
1121
+
/// <summary>
1122
+
/// Print descriptions into the output.
1123
+
/// By default <see langword="true"/>.
1124
+
/// </summary>
1125
+
public bool PrintDescriptions { get; set; } = true;
1126
+
1117
1127
/// <summary>
1118
1128
/// Whether to print each directive location on its own line.
1129
+
/// By default <see langword="false"/>.
1119
1130
/// </summary>
1120
1131
public bool EachDirectiveLocationOnNewLine { get; init; }
1121
1132
1122
1133
/// <summary>
1123
1134
/// Whether to print each union member on its own line.
1135
+
/// By default <see langword="false"/>.
1124
1136
/// </summary>
1125
1137
public bool EachUnionMemberOnNewLine { get; init; }
1126
1138
1127
1139
/// <summary>
1128
1140
/// The size of the horizontal indentation in spaces.
1141
+
/// By default 2.
1129
1142
/// </summary>
1130
1143
public int IndentSize { get; set; } = 2;
1131
1144
}
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4