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.
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).
Could you provide an reproducible case? Or a file where I can reproduce it? Thanks
Created attachment 112381 [details] File that reproduces the problem Here's one of the files where I'm seeing this issue.
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.
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.
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
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