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

aiken lsp code action suggests import "Script" from aiken/crypto and not cardano/address. #1042

Open
waalge opened this issue Oct 17, 2024 · 2 comments
Labels
language-server Language Server

Comments

@waalge
Copy link
Contributor

waalge commented Oct 17, 2024

What Git revision are you using?

aiken v1.1.4+79d0e45

What operating system are you using, and which version?

nixos

Describe what the problem is?

aiken lsp code action suggests import "Script" from aiken/crypto and not cardano/address.

If you blindly follow what the code suggestion is, then your at a complete loss as to where you went wrong.

What should be the expected behavior?

LSP be less clever when there is ambiguity on imports/ or LSP give options / or LSP be even cleverer and only ever choose the right one.

@waalge
Copy link
Contributor Author

waalge commented Nov 20, 2024

This seems to be fixed in 1.1.7.
The lsp is distinguishing between the type and the constructor prompting to import the correct one

@waalge waalge closed this as completed Nov 20, 2024
@github-project-automation github-project-automation bot moved this from 🪣 Backlog to ✅ In Next Release in Project Tracking Nov 20, 2024
@waalge
Copy link
Contributor Author

waalge commented Nov 22, 2024

A little unclear why/ what factors are effecting this behaviour.

I previously could not reproduce with Script, as noted above.

But I now have the same error with VerificationKey:

   address == Address(VerificationKey(blake2b_224(return_key)), None),

To which the code action is

   Add new import line: use aiken/crypto.{VerificationKey}

Update : And I have now repeated the behaviour with Script : the only code action is use aiken/crypto.
No clue as to what the difference was between now and the previous time when it seemed to work fine.

@waalge waalge reopened this Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language-server Language Server
Projects
Status: ✅ In Next Release
Development

No branches or pull requests

2 participants