Skip to content

Commit 67a5106

Browse files
committed
fix crash
1 parent 27e0565 commit 67a5106

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/language-support/src/signatureHelp.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ interface ParsedMethod {
3333
}
3434

3535
function toSignatureHelp(
36-
methodSignatures: Record<string, SignatureInformation>,
36+
methodSignatures: Record<string, SignatureInformation> = {},
3737
parsedMethod: ParsedMethod,
3838
) {
3939
const methodName = parsedMethod.methodName;

packages/language-support/src/tests/signatureHelp.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ describe('Procedures signature help', () => {
219219
63,
220220
);
221221
});
222+
223+
test('Does not crash on missing schema', () => {
224+
testSignatureHelp(`CALL apoc.do.when`, undefined, emptyResult);
225+
testSignatureHelp(`CALL apoc.do.when`, {}, emptyResult);
226+
});
222227
});
223228

224229
describe('Functions signature help', () => {
@@ -391,4 +396,9 @@ describe('Functions signature help', () => {
391396
89,
392397
);
393398
});
399+
400+
test('Does not crash on missing schema', () => {
401+
testSignatureHelp(`CALL apoc.do.when`, undefined, emptyResult);
402+
testSignatureHelp(`CALL apoc.do.when`, {}, emptyResult);
403+
});
394404
});

0 commit comments

Comments
 (0)