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 225019 - Braces matching empty statement in tooltips
Summary: Braces matching empty statement in tooltips
Status: RESOLVED DUPLICATE of bug 217730
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-17 11:07 UTC by fruit
Modified: 2013-01-21 14:49 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
uninformative tooltip when braces convention is Allman style (19.23 KB, image/png)
2013-01-17 11:07 UTC, fruit
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fruit 2013-01-17 11:07:46 UTC
Created attachment 130324 [details]
uninformative tooltip when braces convention is Allman style

Hi,

I'm satisfied with new brace matching tooltips, but it pointlessly for Allman braces convention ( http://en.wikipedia.org/wiki/Indent_style#Allman_style ).

When highlighting last brace for following block:

        if (isset($work->start_date) && $this->isDateValid($work->start_date))
        {
          $dateFrom = array(
            'year'  => substr($work->start_date, 0, 4),
            'month' => substr($work->start_date, 5, 2),
            'day'   => '01',
          );
        }

I see in tooltip: "    {" (see the attachment)


Environment:
  Product Version: NetBeans IDE Dev (Build 201301170001)
  Java: 1.7.0_10; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
  Runtime: Java(TM) SE Runtime Environment 1.7.0_10-b18
  System: Linux version 3.6.11-1.fc17.x86_64 running on amd64; UTF-8; en_US (nb)
Comment 1 Ondrej Brejla 2013-01-17 11:57:36 UTC
It's not PHP feature. It's handled by whole editor infrastructure. Imho they simply shows a "line" where a matching brace is.
Comment 2 Ondrej Brejla 2013-01-17 12:52:13 UTC
My suggestion is that the infrastructure should check whether there is a non-ws character right before a brace on the brace line and if not, check preceding line in the same manner until first non-ws char is found. Then prepend that line right before the matching brace.
Comment 3 fruit 2013-01-17 13:22:21 UTC
A good suggestion. 

Will the tooltip include the  "// Verbosity is ON" comment too?

    if ($isVerboseMode) // Verbosity is ON
    {
      
    }

What happens in case the statement block is multi-line?

    if (isset($school->concentration)
        && is_array($school->concentration)
        && 0 < count($school->concentration))
    {
      
    }
Comment 4 Svata Dedic 2013-01-21 14:49:40 UTC
Already filed as 217730, please comment there.

*** This bug has been marked as a duplicate of bug 217730 ***