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 268825 - Closures autocomplete is not working
Summary: Closures autocomplete is not working
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: Dev
Hardware: All All
: P3 normal with 2 votes (vote)
Assignee: junichi11
URL:
Keywords:
: 246211 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-04 12:22 UTC by Doglexx
Modified: 2017-04-12 05:51 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
step 1 (31.06 KB, image/png)
2017-04-09 12:08 UTC, dylanv
Details
step 2 (117.48 KB, image/png)
2017-04-09 12:08 UTC, dylanv
Details
step 3 (158.52 KB, image/png)
2017-04-09 12:09 UTC, dylanv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Doglexx 2016-11-04 12:22:48 UTC
Autocomplete is not working for class instances passed as parameters for closures.
I set up the Lumen micro-framework and opened one of the migration files.

'Illuminate' and descendant folders are located under the 'Vendor' folder.

So the folders structure is:

/app
/bootstrap
/database/migrations/create_quotes_table.php (this file's listing is below)
...
/vendor/illuminate/database/Schema/Blueprint.php


Please take a look at the example.


<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQuotesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('quotes', function (Blueprint $table) {

            $table-> // autocomplete is not working here
            
            $table->increments('id'); // but here Ctrl+click to navigate to function def works fine.
            $table->timestamps();
        });
    }



If I add /* @var $table Blueprint*/ before $table variable autocomplete works fine. Is there any other workarounds(without code edit) for such situations?
Thank you!
Comment 1 dylanv 2017-04-09 12:08:29 UTC
Created attachment 164053 [details]
step 1
Comment 2 dylanv 2017-04-09 12:08:58 UTC
Created attachment 164054 [details]
step 2
Comment 3 dylanv 2017-04-09 12:09:25 UTC
Created attachment 164055 [details]
step 3
Comment 4 dylanv 2017-04-09 12:10:03 UTC
With regards to the previous three screenshots, see this thread around this problem as discussed in the netbeans php slack channel:

https://netbeans.slack.com/archives/C2SJG5PRR/p1491738149384714
Comment 5 junichi11 2017-04-10 02:02:28 UTC
(In reply to dylanv from comment #4)
> With regards to the previous three screenshots, see this thread around this
> problem as discussed in the netbeans php slack channel:
> 
> https://netbeans.slack.com/archives/C2SJG5PRR/p1491738149384714

You should always write/attach exact information(your steps, screenshots, sample code/project, e.t.c.) to the issue. Because information in the slack may be deleted, and all people cannot look at it soon.
Comment 6 junichi11 2017-04-10 02:23:09 UTC
Sample code:
<?php
class AutoPopup {
    public static function test(string $string, callable $callable) {
    }

    public function something() {
    }
}

class Anon {

    public function test() {
        AutoPopup::test('test', function(AutoPopup $test) {
            $test- // type ">"
        });
    }

}

This occurs in a method. (doesn't occur in a function)

Steps to reproduce:
1. Type ">" after the $test-
2. A popup window for CC is shown (Auto Popup)
3. There is no method

However, if CC is run after it is typed(i.e. $test->[Ctrl] + [Space]), members are shown. I'll look at it.

Thanks.
Comment 7 junichi11 2017-04-10 11:27:19 UTC
Fixed. Please try to test it if possible. Probably, it will be available tomorrow or later.

http://hg.netbeans.org/web-main/rev/e5d87f8b8d86

Thanks.
Comment 8 Quality Engineering 2017-04-11 01:52:22 UTC
Integrated into 'main-silver', will be available in build *201704110002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/e5d87f8b8d86
User: Junichi Yamamoto <junichi11@netbeans.org>
Log: #268825 - Closures autocomplete is not working
Comment 9 junichi11 2017-04-12 05:51:02 UTC
*** Bug 246211 has been marked as a duplicate of this bug. ***