Skip to content

Commit 29fbd41

Browse files
authored
Add xml comments (#98)
1 parent 02b94ba commit 29fbd41

File tree

6 files changed

+37
-16
lines changed

6 files changed

+37
-16
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
namespace GraphQLParser.AST
1+
namespace GraphQLParser.AST
22
{
33
public class GraphQLListType : GraphQLType
44
{
55
public override ASTNodeKind Kind => ASTNodeKind.ListType;
66

77
public GraphQLType? Type { get; set; }
88

9+
/// <inheritdoc/>
910
public override string ToString() => $"[{Type}]";
1011
}
11-
}
12+
}

src/GraphQLParser/AST/GraphQLListValue.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public GraphQLListValue(ASTNodeKind kind)
1717

1818
public List<GraphQLValue>? Values { get; set; }
1919

20+
/// <inheritdoc/>
2021
public override string ToString() => AstValue!;
2122
}
2223
}

src/GraphQLParser/AST/GraphQLLocation.cs

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33

44
namespace GraphQLParser.AST
55
{
6+
/// <summary>
7+
/// Provides information regarding the location of a node within a document's original query text.
8+
/// </summary>
69
[DebuggerDisplay("(Start={Start}, End={End})")]
710
public readonly struct GraphQLLocation : IEquatable<GraphQLLocation>
811
{
12+
/// <summary>
13+
/// Initializes a new instance with the specified parameters.
14+
/// </summary>
915
public GraphQLLocation(int start, int end)
1016
{
1117
Start = start;
@@ -14,28 +20,38 @@ public GraphQLLocation(int start, int end)
1420

1521
/// <summary>
1622
/// The index for the start of the node in the source (i.e. it's inclusive).
17-
///
18-
/// For example,
19-
/// { field { subfield } }
20-
/// ^ field.Location.Start = 2
23+
/// <br/>
24+
/// For example:
25+
/// <code>
26+
/// { field { subfield } }
27+
/// <br/>
28+
/// --^ field.Location.Start = 2
29+
/// </code>
2130
/// </summary>
2231
public int Start { get; }
2332

2433
/// <summary>
2534
/// The index for the character immediately after the node in the source (i.e. it's exclusive).
26-
///
27-
/// For example,
28-
/// { field { subfield } }
29-
/// ^ field.Location.End = 20
35+
/// <br/>
36+
/// For example:
37+
/// <code>
38+
/// { field { subfield } }
39+
/// <br/>
40+
/// --------------------^ field.Location.End = 20
41+
/// </code>
3042
/// </summary>
3143
public int End { get; }
3244

45+
/// <inheritdoc/>
3346
public bool Equals(GraphQLLocation other) => Start == other.Start && End == other.End;
3447

48+
/// <inheritdoc/>
3549
public override bool Equals(object obj) => obj is GraphQLLocation l && Equals(l);
3650

51+
/// <inheritdoc/>
3752
public override int GetHashCode() => (Start, End).GetHashCode();
3853

54+
/// <inheritdoc/>
3955
public override string ToString() => $"({Start},{End})";
4056
}
4157
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
namespace GraphQLParser.AST
1+
namespace GraphQLParser.AST
22
{
33
public class GraphQLNamedType : GraphQLType, INamedNode
44
{
55
public override ASTNodeKind Kind => ASTNodeKind.NamedType;
66

77
public GraphQLName? Name { get; set; }
88

9+
/// <inheritdoc/>
910
public override string ToString() => Name?.Value!;
1011
}
11-
}
12+
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
namespace GraphQLParser.AST
1+
namespace GraphQLParser.AST
22
{
33
public class GraphQLNonNullType : GraphQLType
44
{
55
public override ASTNodeKind Kind => ASTNodeKind.NonNullType;
66

77
public GraphQLType? Type { get; set; }
88

9+
/// <inheritdoc/>
910
public override string ToString() => Type + "!";
1011
}
11-
}
12+
}

src/GraphQLParser/Token.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace GraphQLParser
1+
namespace GraphQLParser
22
{
33
public readonly struct Token
44
{
@@ -42,11 +42,12 @@ public Token(TokenKind kind, string? value, int start, int end)
4242
_ => string.Empty
4343
};
4444

45+
/// <inheritdoc/>
4546
public override string ToString()
4647
{
4748
return Value != null
4849
? $"{GetTokenKindDescription(Kind)} \"{Value}\""
4950
: GetTokenKindDescription(Kind);
5051
}
5152
}
52-
}
53+
}

0 commit comments

Comments
 (0)