This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
#192: As I am used from java editor, i often press CTRL+SHIFT+F in order to potentially reformat code, but in ruby editor, it simply deleted all my indention.. If you don't plan to spend time with implementation of code formating in ruby in near future, please, disable the reformat action for now, thanks.
Ugh. Sorry about that. Hopefully Undo got your indentation back? The reason it is that way right now is that the smart-indent feature (indenting when you hit Return) relies on the same hooks as reformat. I had hoped that Reformat would simply have the same effect as doing a reindent on every line; indeed that -is- what is happening, but the context passed in differs which ends up confusing the reindentation code (it doesn't see the previous line's indentation because it hasn't been reflected in the Document yet. I need to redo this in terms of a token stream rather than raw Document computations, which I've planned to do shortly along with similar changes to the pair-matching of braces, quotes, etc.)
This is now integrated. Since the APIs for the indentation engines are not lexer based yet, I implemented this (temporarily) by iterating over the document, using the lexer token hierarchy to look for tokens related to indentation, and then building up a reformatted string builder on the fly, which I finally use to replace the document contents. The reformatting seems to work well; I reformatted some large Ruby library files (imap.rb, irb.rb) with expected results. (There is a problem with heredocs with embedded ruby which I am fixing separately.) Anyway, both smart indentation and full source reformatting should be ok now.
*** Issue 95883 has been marked as a duplicate of this issue. ***
verified.
Reassigning this issue to newly created 'ruby' component.
Changing target milestone of all resolved Ruby issues from TBD to 6.0 Beta 1 build.