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 131379 - GNU style: formatter works wrong with functions if it returns struct
Summary: GNU style: formatter works wrong with functions if it returns struct
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-28 09:19 UTC by soldatov
Modified: 2008-06-04 08:33 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
patch for release61 (47.16 KB, patch)
2008-03-31 15:16 UTC, Alexander Simon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description soldatov 2008-03-28 09:19:14 UTC
Scenario:
- Set 'GNU' style
- Add such code:
tree
decl_shadowed_for_var_lookup (tree from)
{
  return NULL_TREE;
}

void
decl_shadowed_for_var_insert (tree from, tree to)
{
  return;
}

- Press 'Source|Format' menu item
==> I see function name on 9 column

tree
        decl_shadowed_for_var_lookup (tree from)
{
  return NULL_TREE;
}

void
decl_shadowed_for_var_insert (tree from, tree to)
{
  return;
}
Comment 1 soldatov 2008-03-28 09:24:06 UTC
Indentation works wrongly in this case also.

Type in editor:
tree<ENTER>
decl_shadowed_for_var_lookup (tree from)<ENTER>
{<ENTER>
==> I see in editor:
tree
        decl ()
{

}
Comment 2 Alexander Simon 2008-03-28 10:12:25 UTC
fixed
http://hg.netbeans.org/main/rev/f311bebc720c
Comment 3 soldatov 2008-03-29 12:04:09 UTC
Second scenario is not fixed.
And other scenario:
- Set 'GNU' style
- Add such code:
tree decl_shadowed_for_var_lookup (tree from)
{
  return NULL_TREE;
}

void decl_shadowed_for_var_insert (tree from, tree to)
{
  return;
}

- Press 'Source|Format' menu item
==> Function name on old position
tree decl_shadowed_for_var_lookup (tree from)
{
  return NULL_TREE;
}

void
decl_shadowed_for_var_insert (tree from, tree to)
{
  return;
}
Comment 4 Alexander Simon 2008-03-31 15:15:03 UTC
fixed in main
http://hg.netbeans.org/main/rev/1b230feca924
Comment 5 Alexander Simon 2008-03-31 15:16:44 UTC
Created attachment 59412 [details]
patch for release61
Comment 6 Alexander Simon 2008-03-31 17:22:52 UTC
Additional fix in IZ.
http://www.netbeans.org/issues/show_bug.cgi?id=131647
http://hg.netbeans.org/main/rev/3c24eff316d3
I.e. if IZ#131379 will be integrated in release the IZ#131647 should be integrated also.
Comment 7 soldatov 2008-04-01 10:38:24 UTC
verified.

verified in build 200803302302 + patches from IZ#131379 and IZ#131647
Comment 8 rbalada 2008-04-29 15:24:58 UTC
I've transplanted the changeset http://hg.netbeans.org/main/rev/1b230feca924
into release61_fixes repository as http://hg.netbeans.org/release61_fixes/rev/

changeset:   77509:9b539fcb0779
tag:         tip
user:        Alexander Simon <alexvsimon@netbeans.org>
date:        Mon Mar 31 18:06:42 2008 +0400
summary:     fixed IZ#131379:GNU style: formatter works wrong with functions if it returns struct
Comment 9 rbalada 2008-04-29 15:45:37 UTC
Oops, correct URL to release61_fixes changeset is http://hg.netbeans.org/release61_fixes/rev/9b539fcb0779