Completion fixes#698
Open
oandrew wants to merge 3 commits into
Open
Conversation
Display all available completion options within the current attrset even if it's empty or there is no text under the cursor.
c34567c to
4cd9d17
Compare
inclyc
reviewed
Jun 25, 2025
inclyc
left a comment
Member
There was a problem hiding this comment.
Overall, I think:
- The current approach also provides completion suggestions within comment content, which I believe is undesirable.
- We should develop a parser that preserves the position of comments, so that we can check whether the location of the "completion" is inside a comment when performing it.
| CHECK-NEXT: "result": { | ||
| CHECK-NEXT: "isIncomplete": false, | ||
| CHECK-NEXT: "items": [] | ||
| CHECK-NEXT: "items": [ |
Member
There was a problem hiding this comment.
I think the previous version gave more accurate results because the current "completion" feature is essentially providing completions within the "comments," which might confuse users.
| namespace { | ||
|
|
||
| constexpr int MaxItems = 30; | ||
| constexpr int MaxItems = 1000; |
Member
There was a problem hiding this comment.
What is the motivation or necessity behind this?
|
|
||
| const auto *Desc = AST->descend({Pos, Pos}); | ||
| CheckDefault(Desc && Desc->children().empty()); | ||
| CheckDefault(Desc); |
Member
There was a problem hiding this comment.
This line of code previously protected us from providing code completions within "comments."
|
Very nice |
|
@oandrew friendly ping 🙂 |
ed5029e to
6707401
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #653
networking.netwill also suggestuseNetworkd.quick video:
nixd.mov