-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
minor : Deunwrap inline call #15432
minor : Deunwrap inline call #15432
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.
So this I'm not okay with, this change effectively makes this entire assist non-lazy and it runs whenever the cursor is on a function call. Its not particularly cheap
So while I do not claim to understand why the assist became non-lazy after this PR, I applied the requested changes hoping that these also resolve the said problem. |
@@ -218,13 +219,12 @@ pub(crate) fn inline_call(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option< | |||
} | |||
|
|||
let syntax = call_info.node.syntax().clone(); | |||
let replacement = inline(&ctx.sema, file_id, function, &fn_body, ¶ms, &call_info)?; |
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.
So while I do not claim to understand why the assist became non-lazy after this PR
Assists run in two modes: once to determine if they are available, and once to actually apply the changes, if the user picks one. Both modes use mostly the same code paths, but the |builder|
closure actually determines the changes. This means that everything that happens outside that closure is performance-sensitive.
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.
thanks for the explanation
CI probably needs a |
94afbe3
to
38491fc
Compare
@rustbot review |
@bors r+ |
minor : Deunwrap inline call #15398 subtask 4. There is still one instance of unwrap, which I found pretty hard to change.
☀️ Test successful - checks-actions |
👀 Test was successful, but fast-forwarding failed: 422 1 review requesting changes by reviewers with write access. |
@bors r+ |
💡 This pull request was already approved, no need to approve it again.
|
☀️ Test successful - checks-actions |
#15398 subtask 4. There is still one instance of unwrap, which I found pretty hard to change.