Skip to content

Commit 23191b1

Browse files
committed
C#: rename XmlComment to XmlCommentLine to avoid naming conflict
1 parent 69353bb commit 23191b1

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

csharp/ql/lib/semmle/code/csharp/Comments.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Location
1111
/**
1212
* A single line of comment.
1313
*
14-
* Either a single line comment (`SinglelineComment`), an XML comment (`XmlComment`),
14+
* Either a single line comment (`SinglelineComment`), an XML comment (`XmlCommentLine`),
1515
* or a line in a multi-line comment (`MultilineComment`).
1616
*/
1717
class CommentLine extends @commentline {
@@ -66,7 +66,7 @@ class MultilineComment extends CommentLine, @multilinecomment {
6666
* /// </summary>
6767
* ```
6868
*/
69-
class XmlComment extends CommentLine, @xmldoccomment {
69+
class XmlCommentLine extends CommentLine, @xmldoccomment {
7070
override string toString() { result = "/// ..." }
7171

7272
private string xmlAttributeRegex() {
@@ -196,7 +196,7 @@ class CommentBlock extends @commentblock {
196196

197197
/** Holds if this block consists entirely of XML comments. */
198198
predicate isXmlCommentBlock() {
199-
forall(CommentLine l | l = getAChild() | l instanceof XmlComment)
199+
forall(CommentLine l | l = getAChild() | l instanceof XmlCommentLine)
200200
}
201201

202202
/** Gets a `CommentLine` containing text. */

csharp/ql/src/Documentation/Documentation.qll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class SourceMethodOrConstructor extends SourceDeclaration, Callable {
2626
}
2727

2828
/** Gets an XML comment bound to this declaration. */
29-
XmlComment getADeclarationXmlComment(Declaration d) {
29+
XmlCommentLine getADeclarationXmlComment(Declaration d) {
3030
result = getADeclarationCommentBlock(d).getAChild()
3131
}
3232

@@ -58,7 +58,7 @@ predicate isDocumentationNeeded(Modifiable decl) {
5858
}
5959

6060
/** An XML comment containing a `<returns>` tag. */
61-
class ReturnsXmlComment extends XmlComment {
61+
class ReturnsXmlComment extends XmlCommentLine {
6262
ReturnsXmlComment() { this.getOpenTag(_) = "returns" }
6363

6464
/** Holds if the element in this comment has a body at offset `offset`. */
@@ -72,7 +72,7 @@ class ReturnsXmlComment extends XmlComment {
7272
}
7373

7474
/** An XML comment containing an `<exception>` tag. */
75-
class ExceptionXmlComment extends XmlComment {
75+
class ExceptionXmlComment extends XmlCommentLine {
7676
ExceptionXmlComment() { this.getOpenTag(_) = "exception" }
7777

7878
/** Gets a `cref` attribute at offset `offset`, if any. */
@@ -83,7 +83,7 @@ class ExceptionXmlComment extends XmlComment {
8383
}
8484

8585
/** An XML comment containing a `<param>` tag. */
86-
class ParamXmlComment extends XmlComment {
86+
class ParamXmlComment extends XmlCommentLine {
8787
ParamXmlComment() { this.getOpenTag(_) = "param" }
8888

8989
/** Gets the name of this parameter at offset `offset`. */
@@ -94,7 +94,7 @@ class ParamXmlComment extends XmlComment {
9494
}
9595

9696
/** An XML comment containing a `<typeparam>` tag. */
97-
class TypeparamXmlComment extends XmlComment {
97+
class TypeparamXmlComment extends XmlCommentLine {
9898
TypeparamXmlComment() { this.getOpenTag(_) = "typeparam" }
9999

100100
/** Gets the `name` attribute of this element at offset `offset`. */
@@ -105,7 +105,7 @@ class TypeparamXmlComment extends XmlComment {
105105
}
106106

107107
/** An XML comment containing a `<summary>` tag. */
108-
class SummaryXmlComment extends XmlComment {
108+
class SummaryXmlComment extends XmlCommentLine {
109109
SummaryXmlComment() { this.getOpenTag(_) = "summary" }
110110

111111
/** Holds if the element in this comment has a body at offset `offset`. */
@@ -119,6 +119,6 @@ class SummaryXmlComment extends XmlComment {
119119
}
120120

121121
/** An XML comment containing an `<inheritdoc>` tag. */
122-
class InheritDocXmlComment extends XmlComment {
122+
class InheritDocXmlComment extends XmlCommentLine {
123123
InheritDocXmlComment() { this.getOpenTag(_) = "inheritdoc" }
124124
}

csharp/ql/test/library-tests/comments/Comments.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ query predicate multilineComment(
2121
commentLine(c, l, numLines, text, rawText)
2222
}
2323

24-
query predicate xmlComment(CommentBlock c, XmlComment l, int numLines, string text, string rawText) {
24+
query predicate xmlComment(
25+
CommentBlock c, XmlCommentLine l, int numLines, string text, string rawText
26+
) {
2527
commentLine(c, l, numLines, text, rawText)
2628
}

0 commit comments

Comments
 (0)