-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Implement crate name autocompletion #120
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! There are still a few things to iron out, but I really like where this is going.
Lot's of good things pointed out. Unfortunately I've used up my free time for the time being but next week i'll try and iron out what i can, some of these issues are definitely gonna be harder than others |
`cfg.crate_completion` has also been moved to `cfg.completion.crates`
When writing the dependencies in `[dependency.name]` format, the version row below will now be filled in after the completion is accepted. Completions that include the version will also have it as a snippet instead now.
Okay decided to work on this a bit more, this should fix all of these issues. Had to dig into the lsp spec a little bit to get completions to include the version in tables, but i managed to improve a few other things whilst doing so so that worked out great |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The completion rarely works for me. I've found a few things that could be the source of that, buf there seems to be some other issue that I haven't found yet.
Okay as well as fixing the line counts and such, i redid the polling for crates on completions and now it's working loads more reliably! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the one comment, I think this is ready to merge.
I can think of two more things to improve crate search completion, but I think those can wait for another PR. The first thing would be a searching virtual text like the loading indicator when fetching crates. The other is an unfinished crate table declaration (without the right ]
) not being completed:
[dependencies.abc
But let's first get this merged!
Virtual text whilst searching is definitely best left for a later date, i've never worked with virtual text before so it's not something I could add in quickly and I'm not sure yet how best to do it. But fixing |
Thank you very much for this useful addition. ship it 🚀 |
The saecki/crates.nvim#120 updated `src` option to `completion`.
The saecki/crates.nvim#120 updated `src` option to `completion`.
The saecki/crates.nvim#120 updated `src` option to `completion`.
It's not quite perfect just yet, but here's my 1-day implementation of crate name autocompletion as talked about in #115.
You can see it in action here
2024-05-11.18-22-31.mp4