Skip to content

[PHP] "Go to Declaration"/"Ctrl + B" improvement #9626

Open

Description

@sysdev34-wq

Apache NetBeans version

Apache NetBeans 31

What happened

When using the "Include Path" option to add "ide-helper" files for autocompletion, some classes end up duplicated on those extra files, it has same clases with PHPDoc annotations.
Everything works fine, but when I use Ctrl + B (or "Go to Declaration") on a class, it takes me to the external helper file instead of the actual class within the project.
Is there a way to ensure that if a class exists within the project, it takes precedence over the classes in the "Include Path" files (which are intended solely for autocompletion)?

Language / Project Type / NetBeans Component

PHP

How to reproduce

File within the project

// App/MyCustomClasss.php
namespace App{
   class MyCustomClasss{}
}

same text on a "Include Path" directory/file

// extra_files/helper.php
namespace App{
  /**
   * @property int $id
   * /
  class MyCustomClasss{}
}

Now, in another file within the project.

$obj = new MyCustomClasss(); 
// here "Go to Declaration" on MyCustomClasss
// it opens `extra_files/helper.php` but `App/MyCustomClasss.php` one should take priority

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows

JDK

latest

Apache NetBeans packaging

Community provided installer

Anything else

I tried using @mixin with a different name for the class, but the class allows for multiple concatenations, and using @mixin causes the reference to the class to be lost after the second level of concatenation.

Are you willing to submit a pull request?

No

Activity

  1. added
    PHP[ci] enable extra PHP tests (php/php.editor)
    on Sep 17, 2026
  2. sysdev34-wq commented on Sep 18, 2026

    @sysdev34-wq
    Author

    @haidubogdan hi, maybe your package replaces or handles laravel-ide-helper?

    I'm using php artisan ide-helper:models --no-write

  3. haidubogdan commented on Sep 21, 2026

    @haidubogdan
    Contributor

    @sysdev34-wq

    I think it's related to how class definition indexing works in the php module of Netbeans.
    Maybe it requires some specific tweaks for ide-helper, but I never used it.
    I hope to have some time to do some research on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PHP[ci] enable extra PHP tests (php/php.editor)kind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions