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 204076 - PHP variables and functions aren't highlighted throughout code when selected
Summary: PHP variables and functions aren't highlighted throughout code when selected
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: CSL (API & infrastructure) (show other bugs)
Version: 7.1
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Milutin Kristofic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-21 17:16 UTC by TheTechFan
Modified: 2011-11-12 16:28 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
File that reproduces the problem (15.96 KB, application/octet-stream)
2011-10-24 18:47 UTC, TheTechFan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TheTechFan 2011-10-21 17:16:46 UTC
Product Version = NetBeans IDE Dev (Build 201110200600)
Operating System = Windows 7 version 6.1 running on x86
Java; VM; Vendor = 1.6.0_29
Runtime = Java HotSpot(TM) Client VM 20.4-b02

It seems to happen when I combine JavaScript, CSS, and PHP in the same file.  The highlighting works in the JavaScript and CSS, but when I click a PHP variable, the highlighting remains on the previously selected CSS or JavaScript item.  This bug occurred in the 7.1 beta as well. I noticed it after upgrading Java to 1.6.0.29 (from 1.6.0.26, I think).
Comment 1 Petr Pisl 2011-10-24 15:14:00 UTC
Could you provide an reproducible case? Or a file where I can reproduce it?
Thanks
Comment 2 TheTechFan 2011-10-24 18:47:21 UTC
Created attachment 112381 [details]
File that reproduces the problem

Here's one of the files where I'm seeing this issue.
Comment 3 Petr Pisl 2011-10-24 21:03:36 UTC
I can now reproduce it with the attached file. It looks like that the occurrences are highlighted, but then repaint and the highlighting is lost.
Comment 4 Petr Pisl 2011-10-26 14:44:12 UTC
The occurrences are counted in the PHP correctly. The problem is in CSL infrastructure. When there are more languages in one file, then for every language is created MarkOccurrencesHighlighter. This hihglighter extends ParseResultTask and is independent from other languages. The problem is that the languages (MarkOccurrencesHighlighters) paint result in editor, which delete the previous higlights.

I will try to explain on the attached file. The problem is not reproducible always, it depends in what order MarkOccurrencesHighlighter is called. Open the attached file and place caret on $contact variable in line 265. 

The PHP highlighter returns 32 occurrences always. If the php highlighter is run as last one, everything is ok. But when is run as first one, the css highlighter returns 0 occurrences and the result from php highlighter is repainted with 0 occurrences in css, which means that the occurrences are not visible. 

IMHO the infrastructure should findout, the right language and call the highlighter only for the language and if the language is not the same as was before, the occurrences from the previous (where the caret was before) language should be deleted.
Comment 5 Svata Dedic 2011-11-11 10:05:58 UTC
Changeset: 56c52f5902e4
Author:    Svata Dedic <sdedic@netbeans.org>
Date:      2011-11-11 11:05
Message:   #204076: only language embedding which owns the caret position is asked to highlight symbols.
Issue #204076 - PHP variables and functions aren't highlighted throughout code when selected: fixed
Comment 6 Quality Engineering 2011-11-12 16:28:27 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/56c52f5902e4
User: Svata Dedic <sdedic@netbeans.org>
Log: #204076: only language embedding which owns the caret position is asked to highlight symbols.
Issue #204076 - PHP variables and functions aren't highlighted throughout code when selected: fixed