Enhancement request: Reformat Code should keep the bookmarks and breakpoints

I use R#'s Reformat Code quite often. What I don't like about it is that it deletes my bookmarks and breakpoints. I hope that R# can be smart enough to readjust the bookmarks and breakpoints to the new locations (line numbers).

5 comments

Hello,

I use R#'s Reformat Code quite often. What I don't like about it is
that it deletes my bookmarks and breakpoints. I hope that R# can be
smart enough to readjust the bookmarks and breakpoints to the new
locations (line numbers).


Reformat Code tries to keep the text markers (including bookmarks and breakpoints)
when the changes are minor. If there're too many atomic changes to be applied,
the whole file text just gets replaced. This was introduced when we encountered
out-of-memory problems on applying atomic changes to "dirty" files with many
things to clean up.

If you're seeing problems with seemingly minor reformats, then there's a
problem in the heuristics. Details are welcome on such cases.


Serge Baltic
JetBrains, Inc — http://www.jetbrains.com
“Develop with pleasure!”


0

Using R# 4.5.1258

I have done dozens of code reformatting and have not seen a single case where the text markers were preserved. Is it all or nothing?

I did a little test to see if they are preserved for simple edits.

I have a class with 3 simple methods (1-2 lines) The last method has no code. I placed a bookmark on the closing brace for the last method. I entered a new line of code at the end of the second method: int i = 0; and moved the open brace for that method from a line by itself to after the method declaration, saved the file and did a code reformat. The bookmark was deleted.

I think this change was pretty simple.

The preservation thing can be very dumb and shouldn't be too smart for it to work. If I put a bookmark on a line that reads: int x = 0; and it's the only line with that code, why can't the reformat code thing know the new line after reformatting? I know R# is probably doing something a lot more complicated than a simple string comparsion but it seems it's trying to be too smart for its own good that it's not working properly.

0

Please sign in to leave a comment.