Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

lsp panic on bad field #954

Open
waalge opened this issue Jun 7, 2024 · 4 comments
Open

lsp panic on bad field #954

waalge opened this issue Jun 7, 2024 · 4 comments

Comments

@waalge
Copy link
Contributor

waalge commented Jun 7, 2024

What Git revision are you using?

aiken v1.0.28-alpha+c9a1519

What operating system are you using, and which version?

nixos

Describe what the problem is?

Transaction { withdraws, .. } = transaction

causes lsp to error

I tripped over some unknown labels in a pattern or function.

What should be the expected behavior?

Lsp doesn't error and instead reports issue. Eg `withdraw` is not a field of `transaction`


This has been around for a long time. I suspect this is a duplicate issue, but a brief browse didn't find it.

@rvcas
Copy link
Member

rvcas commented Jun 7, 2024

can you should me the panic message?

@waalge
Copy link
Contributor Author

waalge commented Jun 7, 2024

 Error 02:24:24 PM lsp.message LSP Message (aiken) I tripped over some unknown labels in a pattern or function.

@Riley-Kilgore
Copy link
Member

Riley-Kilgore commented Aug 12, 2024

This is because withdraws is not a field of transaction and you should use the label withdrawals instead.

https://github.com/aiken-lang/stdlib/blob/d8f3e57bf0688dfc5e5ce9a8819109ef67e7da62/lib/aiken/transaction.ak#L62

The LSP functionality in general does not work if a contract will not compile, or at least that is my understanding.

@waalge
Copy link
Contributor Author

waalge commented Aug 12, 2024

This was just an example. The error on compilation is more specific than what was coming through on the LSP. The LSP could say "the problem is here ... ->" rather then "something somewhere is wrong" .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🪣 Backlog
Development

No branches or pull requests

3 participants