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.

Bug 132827 - Automatic code formatting does not work very well
Summary: Automatic code formatting does not work very well
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Rastislav Komara
URL:
Keywords:
Depends on: 132764
Blocks:
  Show dependency tree
 
Reported: 2008-04-15 01:26 UTC by Martin Brehovsky
Modified: 2009-07-17 08:00 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Brehovsky 2008-04-15 01:26:31 UTC
The automatic code formatting does not work very well - this is what I get from today's (081414) build (please note the
ending brace positions):
    private attribute ty:Number on replace {
        if (node <> null) {
            node.translateY = ty;
            }
        }
Comment 1 Rastislav Komara 2008-04-15 09:20:54 UTC
I know.
Comment 2 Rastislav Komara 2008-04-16 14:53:22 UTC
The issue with indentation has been solved, but better results will be after implementation of reformat code.
Comment 3 Rastislav Komara 2008-04-22 17:02:11 UTC
update schedule.
Comment 4 Lark Fitzgerald 2008-06-19 15:08:41 UTC
This works better now.  If I start with:

import javafx.gui.*;
import javafx.gui.component.*;

var node : Node;

class test {
private attribute ty:Number on replace {
if (node <> null) {
node.translateY = ty;
}
}
}

And reformat, I end up with:

import javafx.gui.*;
import javafx.gui.component.*;

var node : Node;

class test {
    private attribute ty:Number on replace {
        if (node <> null) {
            node.translateY = ty;
        }
}
}

Notice the second to last } is off.  There are no AST errors so this does not appear to be a compiler issue.
Comment 5 Rastislav Komara 2008-06-20 14:47:30 UTC
Fixed.
Comment 6 Lark Fitzgerald 2008-06-20 19:10:46 UTC
Verified using:
Product Version: NetBeans IDE 6.1 (Build 200804211638)
Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11
System: Windows Vista version 6.0 running on x86; Cp1252; en_US (nb)
fx NB61 nighly plugin: 271

I had to modify the sample to import javafx.gui.swing.* instead of javafx.gui.component.* due to recent changes.