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 244916

Summary: angularjs project. jshint complains about the indentation provided by the editor, (for instance) Expected '}' to have an indentation at 3 instead of 9.
Product: javascript Reporter: douglasv <douglasv>
Component: Formatting & IndentationAssignee: Petr Pisl <ppisl>
Status: REOPENED ---    
Severity: normal CC: vriha
Priority: P3    
Version: 8.0   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: IDE log

Description douglasv 2014-06-05 14:25:58 UTC
Product Version = NetBeans IDE 8.0 (Build 201403101706)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.8.0
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.0-b70
Comment 1 douglasv 2014-06-05 14:26:01 UTC
Created attachment 147585 [details]
IDE log
Comment 2 Vladimir Riha 2014-06-06 06:54:34 UTC
Could you please provide some sample code? What "}" do you mean? Thank you
Comment 3 Vladimir Riha 2014-06-06 14:09:11 UTC
According to reporter general problem with JS formatting. I tried JSlint with some code formatted by NetBeans and it shows errors. For instance:

var angular = {};
angular.module('myApp.controllers', [])
        .controller('MyCtrl1', ['$scope', function($scope) {
        'use strict';
        return 'neco';
    }])
        .controller('MyCtrl2', ['$scope', function($scope) {
        'use strict';
        return 'neco';
    }]);

NetBeans formats to

var angular = {};
angular.module('myApp.controllers', [])
        .controller('MyCtrl1', ['$scope', function($scope) {
                'use strict';
                return 'neco';
            }])
        .controller('MyCtrl2', ['$scope', function($scope) {
                'use strict';
                return 'neco';
            }]);
Comment 4 Petr Hejl 2014-06-10 10:10:27 UTC
What should be the suggested result?
Comment 5 douglasv 2014-06-10 10:25:14 UTC
the question about the } seems to be in need of an English speaker
the statement stands