Skip to content

Commit e85b2eb

Browse files
committed
C#: Replace stub member comment with file level comment.
1 parent c8f7304 commit e85b2eb

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

csharp/ql/src/Stubs/Stubs.qll

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,6 @@ abstract private class GeneratedType extends Type, GeneratedElement {
120120
else result = ""
121121
}
122122

123-
private string stubComment() {
124-
exists(string qualifier, string name |
125-
this.hasQualifiedName(qualifier, name) and
126-
result =
127-
"// Generated from `" + getQualifiedName(qualifier, name) + "` in `" +
128-
concat(this.getALocation().toString(), "; ") + "`\n"
129-
)
130-
}
131-
132123
/** Gets the entire C# stub code for this type. */
133124
pragma[nomagic]
134125
final string getStub(Assembly assembly) {
@@ -141,17 +132,16 @@ abstract private class GeneratedType extends Type, GeneratedElement {
141132
else (
142133
not this instanceof DelegateType and
143134
result =
144-
this.stubComment() + this.stubAttributes() + stubAccessibility(this) +
145-
this.stubAbstractModifier() + this.stubStaticModifier() + this.stubPartialModifier() +
146-
this.stubKeyword() + " " + this.getUndecoratedName() + stubGenericArguments(this) +
147-
this.stubBaseTypesString() + stubTypeParametersConstraints(this) + "\n{\n" +
148-
this.stubPrivateConstructor() + this.stubMembers(assembly) + "}\n\n"
135+
this.stubAttributes() + stubAccessibility(this) + this.stubAbstractModifier() +
136+
this.stubStaticModifier() + this.stubPartialModifier() + this.stubKeyword() + " " +
137+
this.getUndecoratedName() + stubGenericArguments(this) + this.stubBaseTypesString() +
138+
stubTypeParametersConstraints(this) + "\n{\n" + this.stubPrivateConstructor() +
139+
this.stubMembers(assembly) + "}\n\n"
149140
or
150141
result =
151-
this.stubComment() + this.stubAttributes() + stubUnsafe(this) + stubAccessibility(this) +
152-
this.stubKeyword() + " " + stubClassName(this.(DelegateType).getReturnType()) + " " +
153-
this.getUndecoratedName() + stubGenericArguments(this) + "(" + stubParameters(this) +
154-
");\n\n"
142+
this.stubAttributes() + stubUnsafe(this) + stubAccessibility(this) + this.stubKeyword() +
143+
" " + stubClassName(this.(DelegateType).getReturnType()) + " " + this.getUndecoratedName()
144+
+ stubGenericArguments(this) + "(" + stubParameters(this) + ");\n\n"
155145
)
156146
}
157147

@@ -968,6 +958,8 @@ private string stubSemmleExtractorOptions() {
968958
/** Gets the generated C# code. */
969959
string generatedCode(Assembly assembly) {
970960
result =
971-
"// This file contains auto-generated code.\n" + stubSemmleExtractorOptions() + "\n" +
972-
any(GeneratedNamespace ns | ns.isGlobalNamespace()).getStubs(assembly)
961+
"// This file contains auto-generated code.\n" //
962+
+ "// Generated from `" + assembly.getFullName() + "`.\n" //
963+
+ stubSemmleExtractorOptions() + "\n" //
964+
+ any(GeneratedNamespace ns | ns.isGlobalNamespace()).getStubs(assembly)
973965
}

0 commit comments

Comments
 (0)