Skip to content

Commit 0b4fc76

Browse files
committed
Update inconsistent support message
1 parent d036e81 commit 0b4fc76

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

extensions/ql-vscode/src/model-editor/consistency-check.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ import { BaseLogger } from "../common/logging";
44

55
interface Notifier {
66
missingMethod(signature: string): void;
7-
inconsistentSupported(
8-
signature: string,
9-
expectedSupported: boolean,
10-
actualSupported: boolean,
11-
): void;
7+
inconsistentSupported(signature: string, expectedSupported: boolean): void;
128
}
139

1410
export function checkConsistency(
@@ -48,11 +44,7 @@ function checkMethodConsistency(
4844
);
4945

5046
if (method.supported !== expectSupported) {
51-
notifier.inconsistentSupported(
52-
method.signature,
53-
expectSupported,
54-
method.supported,
55-
);
47+
notifier.inconsistentSupported(method.signature, expectSupported);
5648
}
5749
}
5850

@@ -65,13 +57,13 @@ export class DefaultNotifier implements Notifier {
6557
);
6658
}
6759

68-
inconsistentSupported(
69-
signature: string,
70-
expectedSupported: boolean,
71-
actualSupported: boolean,
72-
) {
60+
inconsistentSupported(signature: string, expectedSupported: boolean) {
61+
const expectedMessage = expectedSupported
62+
? `Expected method to be supported, but it is not.`
63+
: `Expected method to not be supported, but it is.`;
64+
7365
void this.logger.log(
74-
`Model editor query consistency check: Inconsistent supported flag for method ${signature}. Expected supported: ${expectedSupported}, actual supported: ${actualSupported}.`,
66+
`Model editor query consistency check: Inconsistent supported flag for method ${signature}. ${expectedMessage}`,
7567
);
7668
}
7769
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ describe("checkConsistency", () => {
5252
expect(notifier.inconsistentSupported).toHaveBeenCalledWith(
5353
"Microsoft.CodeAnalysis.CSharp.SyntaxFactory.SeparatedList`1(System.Collections.Generic.IEnumerable<TNode>)",
5454
true,
55-
false,
5655
);
5756
expect(notifier.missingMethod).not.toHaveBeenCalled();
5857
});

0 commit comments

Comments
 (0)