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

feat: trait autocompletion #1592

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

usagi32
Copy link

@usagi32 usagi32 commented Oct 25, 2024

addresses #600 and #796

what this pr does:

  • Introduces autocompletion and auto import of traits and aliases. When typing '<' where a type is expected, a list of available trait aliases should be visible and on selecting one the corresponding (use-trait...) syntax would be auto imported on the top or if there is already a section with use trait imports.

  • Autocompletion on principal when " ' " is typed and their corresponding contracts and traits suggestions on further typing '.'.

  • Trait identidfier suggestions in (impl-trait ...) and if some methods of the selected trait are not implemented before their signatures will also be auto implemented.

Some refactoring can be done.

I was not able to test this because of a dependency in stacks-core/clarity. Nevertheless, I included some manual tests because of that.

@usagi32
Copy link
Author

usagi32 commented Oct 25, 2024

There is a dependency that needs to be merged in the clarity-vm here.

@hugocaillard
Copy link
Collaborator

Thanks for this great PR @usagi32 🙌
At first glance it looks nice, let's wait on the clarity-vm PR to move this one forward.

If you plan on working on other clarinet issue, can you please comment on the related issue (or open one if missing). I'll try to do same, I've been working on some lsp improvements as well lately (showing variable and functions types on hover)

@hugocaillard hugocaillard self-requested a review October 25, 2024 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In Progress
Development

Successfully merging this pull request may close these issues.

2 participants