Skip to content

Commit 6c5f160

Browse files
committed
Update model editor C# query to return method parameters with parentheses
1 parent 93652fc commit 6c5f160

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

extensions/ql-vscode/src/model-editor/bqrs.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ export function decodeBqrsToMethods(
5151
classification = CallClassification.Unknown;
5252
}
5353

54-
if (!methodParameters.startsWith("(")) {
55-
// There's a difference in how the Java and C# queries return method parameters. In the C# query, the method
56-
// parameters are returned without parentheses. In the Java query, the method parameters are returned with
57-
// parentheses. Therefore, we'll just add them if we don't see them.
58-
methodParameters = `(${methodParameters})`;
59-
}
60-
6154
const signature = `${packageName}.${typeName}#${methodName}${methodParameters}`;
6255

6356
// For Java, we'll always get back a .jar file, and the library version may be bad because not all library authors

extensions/ql-vscode/src/model-editor/queries/csharp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class Endpoint extends Callable {
146146
* Gets the parameter types of this endpoint.
147147
*/
148148
bindingset[this]
149-
string getParameterTypes() { result = parameterQualifiedTypeNamesToString(this) }
149+
string getParameterTypes() { result = "(" + parameterQualifiedTypeNamesToString(this) + ")" }
150150
151151
private string getDllName() { result = this.getLocation().(Assembly).getName() }
152152

extensions/ql-vscode/test/unit-tests/model-editor/bqrs.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ describe("decodeBqrsToMethods", () => {
583583
"System.Reflection",
584584
"RuntimeReflectionExtensions",
585585
"GetMethodInfo",
586-
"System.Delegate",
586+
"(System.Delegate)",
587587
true,
588588
"mscorlib",
589589
"4.0.0.0",
@@ -651,7 +651,7 @@ describe("decodeBqrsToMethods", () => {
651651
"Moq",
652652
"Times",
653653
"Validate",
654-
"System.Int32",
654+
"(System.Int32)",
655655
false,
656656
"Times.cs",
657657
"",

0 commit comments

Comments
 (0)