-
-
Notifications
You must be signed in to change notification settings - Fork 40
Completion fixes #698
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
base: main
Are you sure you want to change the base?
Completion fixes #698
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.
Please fix regression tests.
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
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.
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.
@@ -52,7 +52,15 @@ | |||
CHECK-NEXT: "jsonrpc": "2.0", | |||
CHECK-NEXT: "result": { | |||
CHECK-NEXT: "isIncomplete": false, | |||
CHECK-NEXT: "items": [] | |||
CHECK-NEXT: "items": [ |
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.
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.
@@ -14,7 +14,7 @@ using namespace lspserver; | |||
|
|||
namespace { | |||
|
|||
constexpr int MaxItems = 30; | |||
constexpr int MaxItems = 1000; |
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.
What is the motivation or necessity behind this?
const auto *Desc = AST->descend({Pos, Pos}); | ||
CheckDefault(Desc && Desc->children().empty()); | ||
CheckDefault(Desc); |
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.
This line of code previously protected us from providing code completions within "comments."
fixes #653
networking.net
will also suggestuseNetworkd
.quick video:
nixd.mov