Skip to content

Commit 6d7eb8a

Browse files
committed
Fix issue with signatures not showing up
Signed-off-by: worksofliam <[email protected]>
1 parent 134586b commit 6d7eb8a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/language/providers/hoverProvider.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,10 @@ export const hoverProvider = languages.registerHoverProvider({ language: `sql` }
8383

8484
if (result) {
8585
if ('routine' in result) {
86-
const callableRef = statementAt.getCallableDetail(offset, false);
86+
const routineOffset = ref.tokens[ref.tokens.length-1].range.end+1;
87+
const callableRef = statementAt.getCallableDetail(routineOffset, false);
8788
if (callableRef) {
88-
const { currentCount } = getPositionData(callableRef, offset);
89+
const { currentCount } = getPositionData(callableRef, routineOffset);
8990
const signatures = await DbCache.getCachedSignatures(callableRef.parentRef.object.schema, callableRef.parentRef.object.name);
9091
const possibleSignatures = signatures.filter((s) => s.parms.length >= currentCount).sort((a, b) => a.parms.length - b.parms.length);
9192
const signature = possibleSignatures.find((signature) => currentCount <= signature.parms.length);

src/language/sql/tests/statements.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,6 @@ describe(`Object references`, () => {
10051005

10061006
const refs = statement.getObjectReferences();
10071007

1008-
console.log(refs);
10091008
expect(refs.length).toBe(2);
10101009
expect(refs[0].object.name).toBe(`OBJECT_STATISTICS`);
10111010
expect(refs[0].object.schema).toBe(`QSYS2`);

0 commit comments

Comments
 (0)