helix icon indicating copy to clipboard operation
helix copied to clipboard

<space>A auto action performing incorrectly

Open dogunbound opened this issue 11 months ago • 1 comments

Summary

A auto action removing unnecessary parenthesis on each value in triple tuple function return causes weird behavior like removing the wrong text etc...

If you do a write between each removal of parenthesis it works as expected. Seems like the lsp doesn't react to the file being modified live. It only reacts on a read.

Reproduction Steps

Repro steps. Make your main file in a rust project look like this:

fn helix_bug() -> ((i32), (i32), (i32)) {
    todo!()
}

fn main() {}
  1. hx main.rs
  2. Ensure you get warnings to remove unnecessary parenthesis around type
  3. Go to the parenthesis and press space-a
  4. The first one should remove correctly and well
  5. DO NOT WRITE TO THE FILE
  6. Then move to the next parenthesis
  7. Try and remove it with space-a as well

I expected this to happen: It removes the parenthesis correctly.

Instead, this happened: It will bug out and remove the wrong text

Video demonstration:

https://github.com/helix-editor/helix/assets/64436119/27dfa20e-b100-407f-b644-65bb9ebec2f0

Helix log

https://www.dropbox.com/scl/fi/7y54mt1so3vcysorm5xzt/helix.log?rlkey=pv8jnwbi9ewhy15hxr8poaerg&dl=0

Platform

Linux archlinux 6.7.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 08 Mar 2024 01:59:01 +0000 x86_64 GNU/Linux

Terminal Emulator

konsole 24.02.0

Installation Method

pacman

Helix Version

helix 23.10

dogunbound avatar Mar 14 '24 15:03 dogunbound

Is this reproducible in another editor? I suspect that this is a rust-analyzer bug

the-mikedavis avatar Mar 16 '24 13:03 the-mikedavis

Is this reproducible in another editor? I suspect that this is a rust-analyzer bug

Sorry for the long reply. I kinda forgot about this bug. Yeah it happens in vscode.

https://github.com/helix-editor/helix/assets/64436119/31516f7b-c28f-4f38-aa1c-e22c3aa861d4

dogunbound avatar Apr 02 '24 03:04 dogunbound

This can be reported upstream instead

the-mikedavis avatar Apr 02 '24 12:04 the-mikedavis