-
Notifications
You must be signed in to change notification settings - Fork 132
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
Add support for autocomplete based on a prefix #119
Conversation
e3a9295
to
a9cee59
Compare
Agreed - I missed that one, thank you for spotting and fixing it 👍
yep - I can work on that and push it to your branch, or in a separate PR
That's a good question, I left a comment inline about that - I think we should indeed do it before.
Me and @paultyng also tested it in VSCode ourselves and it works well except for one edge case, which is completion in the middle of an incomplete label, e.g. resource "aws_<HERE>" "name" {
} I will look into this ^ |
That previously discussed refactoring is now ready for review in #125 - that should make it easier to access tokens and implement |
#125 was merged, so this PR now may need rebasing. Let me know if you need any further help here. |
cdbdfec
to
2e8c2ce
Compare
2e8c2ce
to
23ca687
Compare
@radeksimko to filter candidates before putting into the candidate list, I have done a little refactor of the codes, Could you please have a look ? |
Should we remove this check now? As it stands, I can't "recomplete" an attribute if I chose the wrong name from the middle or an existing line, just a blank line: |
23ca687
to
e96b87e
Compare
Thank you for the recent changes. I've done some further refactoring as this functionality proved that the original interface/abstraction with pure tokens wasn't really sufficient. The main motivation behind the refactoring here was to reduce and simplify the top layer (handler), decouple some generic HCL parsing logic and finally to keep I also put back some tests which were removed, as I think there's still value in keeping them and testing the new behaviour (error). |
This also helps keeping CompletionCandidate immutable and allows passing around already "trimmed" candidates as opposed to letting the lsp package handle the trimming.
e96b87e
to
4e441e8
Compare
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.
btw. I modified the original comment to avoid closing #12 as that issue actually isn't addressed by this PR yet, but it should be much easier to address after we merge this PR.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Related: #12
Line: 2, Column: 5
, the Byte should be21
but not20
TokenAtPosition