feat: add onBackspace listener
Explain
This is one of my favorite IntelliJ detailed feature. When the user is on a line with only characters for indentation (spaces or tabs) , pressing the Backspace key deletes the entire line(and if user select a range and press Backspace, it just delete the selected range) and comes to the end of the previous line, user don't need to press Backspace many times to delete all the indentation, which improve development experience a lot.
Implementation
It's relatively simple, implemented only in client's TS code, I also expose a config("rust-analyzer.enableBackspaceListener") to turn off it in case someone don't like it.
Demo
CI / TypeScript failed at Run npm run format:check, but it passed in my local, am I missing something?
Dunno, works for me:
There's also this:
NOTE: run
cargo testlocally and commit the updated files
This seems in no way Rust-specific? :confused: I.e. it could just be its own extension (maybe it even already exists)?
This seems in no way Rust-specific?
yeah it's not rust-specific, much more a editor level feature.
There's also an open issue in VSCode for this: https://github.com/microsoft/vscode/issues/42785 which links an extension that seems to do what you want: https://marketplace.visualstudio.com/items?itemName=jasonlhy.hungry-delete
I agree with flodiebold here, we shouldn't add non specific rust things to r-a. Our extension isn't meant to be a general purpose extension.