Update model editor C# query to return method parameters with parentheses

This commit is contained in:
Koen Vlaswinkel
2023-09-28 12:17:06 +02:00
parent 93652fc75f
commit 6c5f160eee
3 changed files with 3 additions and 10 deletions

View File

@@ -51,13 +51,6 @@ export function decodeBqrsToMethods(
classification = CallClassification.Unknown;
}
if (!methodParameters.startsWith("(")) {
// There's a difference in how the Java and C# queries return method parameters. In the C# query, the method
// parameters are returned without parentheses. In the Java query, the method parameters are returned with
// parentheses. Therefore, we'll just add them if we don't see them.
methodParameters = `(${methodParameters})`;
}
const signature = `${packageName}.${typeName}#${methodName}${methodParameters}`;
// For Java, we'll always get back a .jar file, and the library version may be bad because not all library authors

View File

@@ -146,7 +146,7 @@ class Endpoint extends Callable {
* Gets the parameter types of this endpoint.
*/
bindingset[this]
string getParameterTypes() { result = parameterQualifiedTypeNamesToString(this) }
string getParameterTypes() { result = "(" + parameterQualifiedTypeNamesToString(this) + ")" }
private string getDllName() { result = this.getLocation().(Assembly).getName() }

View File

@@ -583,7 +583,7 @@ describe("decodeBqrsToMethods", () => {
"System.Reflection",
"RuntimeReflectionExtensions",
"GetMethodInfo",
"System.Delegate",
"(System.Delegate)",
true,
"mscorlib",
"4.0.0.0",
@@ -651,7 +651,7 @@ describe("decodeBqrsToMethods", () => {
"Moq",
"Times",
"Validate",
"System.Int32",
"(System.Int32)",
false,
"Times.cs",
"",