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 216525 - Fix formatting of .js and .html files created by RESTful JavaScript Client wizard
Summary: Fix formatting of .js and .html files created by RESTful JavaScript Client wi...
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: Web Services Client (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Denis Anisimov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-08 11:47 UTC by Jiri Skrivanek
Modified: 2012-09-10 13:19 UTC (History)
1 user (show)

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 Jiri Skrivanek 2012-08-08 11:47:09 UTC
Formatting of .js and .html files created by RESTful JavaScript Client wizard is not accurate:

- file should not contain leading comment "To change this template, ..."
- one line comments should be aligned with next line

        initialize: function() {
// displayName property is used to render item in the list
            this.set('displayName', this.get('name'));
        },
Comment 1 Denis Anisimov 2012-08-31 12:43:47 UTC
(In reply to comment #0)
> Formatting of .js and .html files created by RESTful JavaScript Client wizard
> is not accurate:
> 
> - file should not contain leading comment "To change this template, ..."
Why it shouldn't contain this comment ?
The generated JS file is based on the template. The latter template could be customized by user. This comment presents for any resource generated using template.
> - one line comments should be aligned with next line
> 
>         initialize: function() {
> // displayName property is used to render item in the list
>             this.set('displayName', this.get('name'));
>         },

Indentation is done on the JS editor functionality side.
It should be done automatically on JS "createFromTemplate" method implementation:
file is generated via templateDO.createFromTemplate(dataFolder, 
                targetName ,map);
where templateDO is JS template data object and map contains parameters for freemarker script engine.

I reassign the issue to the JS functionality considering the first request as invalid.
Comment 2 Petr Hejl 2012-09-03 07:59:43 UTC
(In reply to comment #0)
> - one line comments should be aligned with next line
> 
>         initialize: function() {
> // displayName property is used to render item in the list
>             this.set('displayName', this.get('name'));
>         },
I don't think so. If one line comments start at the beginning of the line before formatting it should stay this way. Otherwise comment/uncomment won't work. Java behaves the same way.
Comment 3 Jiri Skrivanek 2012-09-07 10:31:36 UTC
Right. I've just added leading space in front of //.
main#f7a83ef0dfe3
Comment 4 Quality Engineering 2012-09-08 02:08:20 UTC
Integrated into 'main-golden', will be available in build *201209080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/f7a83ef0dfe3
User: Jiri Skrivanek <jskrivanek@netbeans.org>
Log: #216525 - Add leading space in front of // to be properly formatted.