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

applySnippetWorkspaceEdit selects wrong token #272

Closed
TimoFreiberg opened this issue Jun 4, 2020 · 1 comment
Closed

applySnippetWorkspaceEdit selects wrong token #272

TimoFreiberg opened this issue Jun 4, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@TimoFreiberg
Copy link
Contributor

TimoFreiberg commented Jun 4, 2020

Tracking for the bug described in #252 by @oblitum
Opening a bug here because I don't see this behaviour in the VS Code plugin.

When triggering the "Add function" codeaction in this file without an empty line at the end:

fn main() {
    foo<|>();
}

The following is generated:

fn main() {
    println!("Hello, world!");
    foo();
}
fn foo() {
    todo!()
[}]

with the closing brace of the generated function being selected (highlighted with [] brackets).

When triggering the codeaction in the same file with an empty line at the end (which rustfmt removes for me 😅 ), the todo!() is correctly selected

The logic of applySnippetWorkspaceEdit looks equivalent to the one in the VS code plugin (compare coc-rust-analyzer with VS Code, so maybe this is a coc.nvim bug?

@fannheyward fannheyward added the bug Something isn't working label Jun 4, 2020
@fannheyward
Copy link
Owner

closed by neoclide/coc.nvim#2154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants