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 269672 - Wrong highlighting on used variable in anonymous functions
Summary: Wrong highlighting on used variable in anonymous functions
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: junichi11
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-28 14:57 UTC by BeliverUfa
Modified: 2017-03-31 04:59 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
example (130.99 KB, image/png)
2017-01-28 14:57 UTC, BeliverUfa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BeliverUfa 2017-01-28 14:57:33 UTC
Created attachment 163495 [details]
example

Pleae see attached screenshot.

If i use variable in anonymus function from "use" directive. this variable are not highlighted by Netbeans.
Comment 1 Tomas Mysik 2017-03-24 14:08:28 UTC
Not a P1, sorry.

Thanks for reporting.
Comment 2 junichi11 2017-03-30 11:12:21 UTC
Fixed. 

http://hg.netbeans.org/web-main/rev/8874c372dc24

I also fixed another problem: Sometimes GotoDeclaration behavior was different.
e.g. $^tests[1] goes to "&$^tests" or "$^tests = [];" 

<?php
$tests = [];
$anon = function() use (&$tests) {
    $tests[1] = [1, 2, 3];    
};

Thanks.
Comment 3 Quality Engineering 2017-03-31 01:50:19 UTC
Integrated into 'main-silver', will be available in build *201703310002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/8874c372dc24
User: Junichi Yamamoto <junichi11@netbeans.org>
Log: #269672 - Wrong highlighting on used variable in anonymous functions
Comment 4 Tomas Mysik 2017-03-31 04:41:43 UTC
Thank you, Junichi!
Comment 5 junichi11 2017-03-31 04:59:47 UTC
You are welcome :)