Skip to content
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 ::<>" should trigger signature help #12031

Closed
jonas-schievink opened this issue Apr 19, 2022 · 2 comments · Fixed by #12032
Closed

"Add ::<>" should trigger signature help #12031

jonas-schievink opened this issue Apr 19, 2022 · 2 comments · Fixed by #12032
Assignees
Labels
A-assists C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now

Comments

@jonas-schievink
Copy link
Contributor

fn f() {
    std::mem::size_of$0();
}

The "Add ::<>" assist turns this into std::mem::size_of::<$0>(), but does not trigger the signature help popup.

Unlike completions, assists don't currently have this functionality built in, so some extra work is needed.

@jonas-schievink jonas-schievink added S-actionable Someone could pick this issue up and work on it right now A-assists C-feature Category: feature request labels Apr 19, 2022
@jonas-schievink jonas-schievink self-assigned this Apr 19, 2022
@jonas-schievink
Copy link
Contributor Author

It appears that our non-support here is intentional, but I'm not sure why this isn't a problem for completions:

if !snap.config.code_action_literals() {
// We intentionally don't support command-based actions, as those either
// require either custom client-code or server-initiated edits. Server
// initiated edits break causality, so we avoid those.
return Ok(None);
}

cc @matklad

@jonas-schievink jonas-schievink removed their assignment Apr 19, 2022
@matklad
Copy link
Member

matklad commented Apr 19, 2022

So, originally CodeActions didn't support edit property. To actually apply an edit, code action would ping a server with a command, and the server would than apply the edit. This is the bit we intentionally don't support -- the edit must be specified in the action directly.

But it should be fine to specify an auxiliary command to be applied after edit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-assists C-feature Category: feature request S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants