Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

test: Add tests for signatureHelp #253

Merged
merged 10 commits into from
Feb 17, 2025
Merged

test: Add tests for signatureHelp #253

merged 10 commits into from
Feb 17, 2025

Conversation

xpyctumo
Copy link
Contributor

@xpyctumo xpyctumo commented Feb 17, 2025

Resolves #211

Summary:

@xpyctumo xpyctumo added tests All related to testing of the project lsp: signatureHelp `textDocument/` Signature Help Request labels Feb 17, 2025
primitive Int;

contract Foo {
fun sum(a: Int, b: Int = 10, c: Int = 20): Int {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tact doesn't support this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

fun configure(a: Int, b: Int, c: Int)

========================================================================
Chained Function Calls
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nested :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Updated

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's call it signatureHelp.test.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Renamed

@xpyctumo
Copy link
Contributor Author

It's weird behavior on windows. It doesn't work for first request, but fine for the next.

I tried adding timeouts before the signatureHelp request in VSCode, tried saving the file (it's even worse - better not to do that), but it didn't work.

test(`Signature: ${testCase.name}`, async () => {
const signature = await this.getSignature(testCase.input)
console.log("signature")
console.log(JSON.stringify(signature))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's remove debug statements

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, of course.

It was just to see why tests were failing CI on Windows. Already removed because the tests are fixed.

fun globalFunc(map: Map)

========================================================================
Global function with String
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But function takes Int 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added also for Int 🤖

Copy link
Collaborator

@i582 i582 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thank you!

@i582 i582 merged commit 0f9673d into master Feb 17, 2025
4 checks passed
@i582 i582 deleted the signature_help_tests branch February 17, 2025 23:41
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
lsp: signatureHelp `textDocument/` Signature Help Request tests All related to testing of the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add tests for Signature help
2 participants