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 257144 - When Source>Format (Alt+Shift+F) is applied on JavaScript, definition of third var in new line not tabbed properly
Summary: When Source>Format (Alt+Shift+F) is applied on JavaScript, definition of thir...
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.1
Hardware: PC Windows 10 x64
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-14 23:32 UTC by jorgejpc
Modified: 2016-07-20 01:51 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 jorgejpc 2015-12-14 23:32:28 UTC
Product Version = NetBeans IDE 8.1 (Build 201510222201)
Operating System = Windows 10 running on amd64
Java; VM; Vendor = 1.8.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.25-b02

Reproducibility: Happens every time

STEPS:
  * Create new JavaScript File
  * Write:
var a=0,
b={ c: 0 },
d=0,
e={ },
f=0,
g={ },
h=0;
  * Apply source formatting (Source menu > Format option, or press Alt+Shift+F)

ACTUAL:
  Alignment of line with text "d=0" keeps the same alignment of the line where var declaration beggins, and it occurs only when the previous var is an object and is not empty. It happens even if there is no 'var' word

EXPECTED:
  Third line should be tabbe
Comment 1 jorgejpc 2015-12-15 18:44:23 UTC
Making a correction to the bug report, it happens to the next var declaration after a non-empty declared object. Test this:

Write:
var a={a:0},
b=0,
c={},
d=0,
e={a:0},
f=0,
g={},
h=0;

Apply source formatting. Lines with texts 'b=0' and 'f=0' are not tabbed/spaced
Comment 2 Petr Hejl 2016-07-18 13:23:32 UTC
Reproducible.
Comment 3 Petr Hejl 2016-07-19 12:45:34 UTC
Fixed in web-main 2e09dac2e92e.
Comment 4 Quality Engineering 2016-07-20 01:51:19 UTC
Integrated into 'main-silver', will be available in build *201607200002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/2e09dac2e92e
User: Petr Hejl <phejl@netbeans.org>
Log: #257144 - When Source>Format (Alt+Shift+F) is applied on JavaScript, definition of third var in new line not tabbed properly