Skip to content

Commit 6a79fa3

Browse files
authored
feat(tolk): don't show method id for test functions (#229)
1 parent 8a39a65 commit 6a79fa3

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

server/src/e2e/tolk/testcases/inlay-hints/method-id.test

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,26 @@ get fun data(): int {
4747
get/* (0x18762) */ fun data(): int {
4848
return 0
4949
}
50+
51+
========================================================================
52+
Get method id hint for test get method
53+
========================================================================
54+
get fun `test foo`(): int {
55+
return 0
56+
}
57+
get fun `test-foo`(): int {
58+
return 0
59+
}
60+
get fun `test_foo`(): int {
61+
return 0
62+
}
63+
------------------------------------------------------------------------
64+
get fun `test foo`(): int {
65+
return 0
66+
}
67+
get fun `test-foo`(): int {
68+
return 0
69+
}
70+
get fun `test_foo`(): int {
71+
return 0
72+
}

server/src/languages/tolk/inlays/get-method-id.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {GetMethod} from "@server/languages/tolk/psi/Decls"
99

1010
export function getMethodId(n: SyntaxNode, file: TolkFile, result: lsp.InlayHint[]): void {
1111
const func = new GetMethod(n, file)
12-
if (func.hasExplicitMethodId) return
12+
if (func.hasExplicitMethodId || func.isTestFunction()) return
1313

1414
const getKeyword = n.children.find(it => it?.text === "get")
1515
if (!getKeyword) return

0 commit comments

Comments
 (0)