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.
Summary: | Code-format makes package.json unreadable | ||
---|---|---|---|
Product: | javascript | Reporter: | _ gtzabari <gtzabari> |
Component: | Formatting & Indentation | Assignee: | arusinha |
Status: | REOPENED --- | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 8.2 | ||
Hardware: | PC | ||
OS: | Windows 10 x64 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
_ gtzabari
2016-12-23 03:34:57 UTC
I just noticed that if I hit SHIFT+ALT+F (code-format) over and over again, the code alternates from formatting all the text on a single line (bug) to proper formatting. So it looks like Netbeans *does* know how to format the code properly, but code-format is broken every second time it is run. If you have "On save -> Code-format" enabled, Netbeans will always save the file in the wrong format so this functionality is unusable. If you change package.json to: { "name": "requirements.js", "version": "1.0.0", "keywords": ["util", "functional", "server", "client", "browser"], "description": "A fluent API for enforcing design contracts with automatic message generation.", "author": "Gili", "contributors": [ ], "dependencies": { }, "devDependencies": { "gulp": "^3.9.1" } } then it never formats correctly, no matter how many times it is invoked. All the text before "dependencies" is missing newlines. Everything from "dependencies" onward seems to be fine. Code formatting(alt+Shft+F) is happening properly in .json files. Tested in NetBeans IDE Dev (Build 20170315-aebe3408a1cd) Closing the bug as it is non existent now Hello, I'm reopening this bug since it still happens with netbeans 8.2. It is not that netbeans doesn't know how to properly format JSON text, but specifically with package.json files if you include "description" it will not format it accordingly. I've tested with other json files, including "description" as a key has no effect, but very oddly it does with package.json files, perhaps netbeans is doing something with this file that prevents correct formatting? emerino, Please try the latest nightly build. If the bug is fixed there, please close this issue as RESOLVED - FIXED. |