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.
If you have package.json that does not contain e.g. name or scripts->start and make changes in project properties that would cause inserting either one of these 2 properties to the JSON file, it is inserted with wrong indentation. Thank you Product Version: NetBeans IDE Dev (Build web-main-1584-on-20141125) 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-37-generic running on amd64; UTF-8; en_US (nb)
We run formatter on newly inserted text but apparently it fails - could you please verify it? Perhaps we should widen the region we format. Thanks.
Yes, it is now enough. If you e.g. create AngularMessages sample, remove the line with "name" : and format file and close it, then if you change project's name in IDE the json file looks like { "version": "1.0.0", "keywords": [ "NetBeans", "node.js", "sample" ], "author": "NetBeans", "dependencies": { "express": "^4.10.1", "body-parser": "^1.4.3", "bower": "~1.3.12" }, "devDependencies": { "gulp": "^3.8.10", "gulp-jshint": "^1.9.0", "jshint-stylish": "^1.0.0" }, "scripts": { "start": "node server/server.js" }, "name": "MessagesAngularA" } Product Version: NetBeans IDE Dev (Build 201504170001) Java: 1.8.0_40; Java HotSpot(TM) Client VM 25.40-b25 Runtime: Java(TM) SE Runtime Environment 1.8.0_40-b25 System: Linux version 3.13.0-35-generic running on i386; UTF-8; en_US (nb)
I just found out that this issue is in fomatter itself. Try to format just the line with "name" key/field (or even with the preceding comma, see attachment): { "scripts": { "start": "node server\/server.js", "postinstall": "node node_modules/bower/bin/bower install" }, "name": "MessagesKnockout" } Thanks.
Created attachment 153764 [details] region to format
Reproducible only in package.json, other *.json files work properly.
Changeset: ef4d7d321ece Author: Roman Svitanic <rsvitanic@netbeans.org> Date: 2015-05-20 15:43 Message: #248906: Project name not formatted properly in package.json file - fixed
Integrated into 'main-silver', will be available in build *201505220001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/ef4d7d321ece User: Roman Svitanic <rsvitanic@netbeans.org> Log: #248906: Project name not formatted properly in package.json file - fixed Task #248906 - Project name not formatted properly in package.json file