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 251662 - Excessive indentation with method calls on new lines
Summary: Excessive indentation with method calls on new lines
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
: 249559 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-04-05 12:43 UTC by Vladimir Riha
Modified: 2016-05-25 13:00 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2015-04-05 12:43:48 UTC
Please check following snippet:


TripDao.prototype.edit = function (trip) {
    var self = this;
    return new Promise(function (resolve, reject) {
        self
                .get(trip.id)
                .then(function (original) {
                    original.convert(trip, true);
                    return self._save(original);
                })
                .then(resolve, reject);
    });
};


It is formatted with default settings. The "problem" is in
        self
                .get(trip.id)
                .then(function (original) {
                    original.convert(trip, true);
                    return self._save(original);
                })
                .then(resolve, reject);

where the .get(), .then() have a excessive indentation in comparison to the self. Would something like

        self
            .get(trip.id)
            .then(function (original) {
                original.convert(trip, true);
                return self._save(original);
            })
            .then(resolve, reject);

be possible? So that the next line starting with "." would start where the previous line ended?


Thank you


Product Version: NetBeans IDE Dev (Build 201504040001)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Linux version 3.13.0-45-generic running on amd64; UTF-8; en_US (nb)
Comment 1 Vladimir Riha 2015-04-05 12:46:49 UTC
Similar example is with

self.getTripId(tripDay.id)
        .then(tripCtrl.getEditorsId)

while better (I think) would be

self.getTripId(tripDay.id)
    .then(tripCtrl.getEditorsId)
Comment 2 Petr Hejl 2016-04-20 12:05:59 UTC
*** Bug 249559 has been marked as a duplicate of this bug. ***