While #498 handles dbg! insertion for "empty line" cases, the original rust-insert-dbg remains unchanged. Though it can handle most cases where there is a valid s-expression ahead of current position, it cannot handle if there isn't, such as:
if let Ok(val) = a {}
____________________^ cursor is here
, where it results in "Containing expression ends prematurely" error, and an incorrect insertion:
if let Ok(val) = a {(}
This patch attempts to fix this issue. And the result would be:
While #498 handles dbg! insertion for "empty line" cases, the original
rust-insert-dbg
remains unchanged. Though it can handle most cases where there is a valid s-expression ahead of current position, it cannot handle if there isn't, such as:, where it results in "Containing expression ends prematurely" error, and an incorrect insertion:
This patch attempts to fix this issue. And the result would be: