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

fix: cursor column after accepting completion with additionalTextEdits #975

Closed

Conversation

ohogb
Copy link
Contributor

@ohogb ohogb commented Jan 9, 2025

pub fn funcname(a: &mut i32) { ... }
let mut a = 0;
funcname(|)
// accept completion `&mut a`

// before:
funcname(&|mut a)

// after:
funcname(&mut a|)

Please Note:

  • This doesn't fix cursor row
  • I have only tested this briefly with rust-analyzer, so please do more testing before merging (might very well break other stuff)

Related f0ab5e5, ab75cad
Somewhat related #223

@Saghen Saghen closed this in cc34be8 Feb 1, 2025
@Saghen
Copy link
Owner

Saghen commented Feb 1, 2025

This was super tricky to get working well, but I think I have something that works for both auto imports and the &mut a case. Lmk if you run into any issues with it. Thanks for the patch! Made it easier to figure this out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants