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 258858 - Reformatting ES6 object deletes empty rows
Summary: Reformatting ES6 object deletes empty rows
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks: 242387
  Show dependency tree
 
Reported: 2016-04-15 15:15 UTC by dusty
Modified: 2016-04-28 14:34 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 dusty 2016-04-15 15:15:49 UTC
If I have a code similar to this one:

export default Ember.Route.extend({

  x1: Ember.inject.service('myserv'),
  x2: "noname",

  redirect (mode, transition) {
    this.transitionTo("console.dashboard")
  },

  actions: {

    gotoDbStats() {
      this.transitionTo("console.global-stats")
    },

    getMydata1() {
      this.get('cm').getOpenSessions().then( x => {
        // Do something
        return x
      })
    },

    signOut() {
      const cm = this.get('cm')
      cm.walletClose().then( () =>
        window.location.replace('/')
      )
    }
  }

get reformatted this way, deleting all empty rows:

export default Ember.Route.extend({
  x1: Ember.inject.service('myserv'),
  x2: "noname",
  redirect(mode, transition) {
    this.transitionTo("console.dashboard")
  },
  actions: {
    gotoDbStats() {
      this.transitionTo("console.global-stats")
    },
    getMydata1() {
      this.get('cm').getOpenSessions().then(x => {
        // Do something
        return x
      })
    },
    signOut() {
      const cm = this.get('cm')
      cm.walletClose().then(() =>
              window.location.replace('/')
              )
    }
  }
}
Comment 1 dusty 2016-04-15 15:16:17 UTC
also, the indenting of signOut is less then optimal IMHO
Comment 2 Petr Hejl 2016-04-18 08:33:14 UTC
Except the arrow function formatting this does not seem to be ES6 specific.
Comment 3 dusty 2016-04-18 08:43:15 UTC
There are also the function definitions in ES6 style.

But you are right: the problem is there also when editing old JS code, I didn't notice before.
Comment 4 Petr Hejl 2016-04-28 14:34:55 UTC
Empty row preservation is now configurable - web-main a16756d7232a.