[php] Not proposing methods, classes and namespaces in code completion from the project
Apache NetBeans version
Apache NetBeans 23
What happened
Expected Behaviour
When typing class names and their namespaces netbeans should propose method names, class names from open project and code templates when typing as in Netbeans 22 and previous versions
Actual Behaviour
In version 23 only method names and class names from standard php platform and code templates are proposed.
I have tried with different versions of Java 11 java-11-openjdk-11.0.24.0.8-2.fc39.x86_64, 17 java-22-openjdk-22.0.2.0.9-1.rolling.fc39.x86_64 and 22 java-22-openjdk-22.0.2.0.9-1.rolling.fc39.x86_64
Language / Project Type / NetBeans Component
PHP Project
How to reproduce
Install Netbeans 23, import settings and plugins and start using project.
Did this work correctly in an earlier version?
Apache NetBeans 22
Operating System
Fedora 39 Workstation Edition
JDK
java-22-openjdk-22.0.2.0.9-1.rolling.fc39.x86_64
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
No response
Are you willing to submit a pull request?
No
Please provide an example code to reproduce it. Thanks.
It the same for all php projects. Would you like me send you a php project?
We may not often reproduce it without an example. So, please always attach an example code(as a comment) or a minimal project(as a zip file) to reproduce it. Thanks.
Did you try to delete your cache directory?(see: Help > About)
Here is a link to a project I'm working on: https://downloads.joomla.org/cms/joomla4/4-4-8/Joomla_4-4-8-Stable-Full_Package.zip?format=zip
I've tried clearing the cache and upgrading to Netbeans 23 again but I still have the same issue. When I downgrade to Netbeans 22 it works correctly again and proposes all the class available in the project.
Thanks. Can you write your exact steps to reproduce it?
- open the project
- edit any php file for example administrator/components/com_users/src/Controller/UsersController.php
- edit line 21 by adding a new 'use' statement to import a Joomla Class for example ComponentHelper
Expected Behaviour Netbeans proposes the path to the ComponentHelper class e.g. Joomla\CMS\Component\ComponentHelper
Actual Behaviour The only classes proposed are php in-built ones.
Should I try disabling my plugins? Is it useful to send you a copy of my options configuration?
I've updated to version 24 from version 22 and for php projects, Netbean only proposes the standard php classes, not the classes as defined in any php project.
Reverting back to version 22 until this is fixed.
I have tried a clean install using both the binary packages and the rpm package but this issue is still present in version 25 when installing on Fedora linux.
Product Version: Apache NetBeans IDE 25 Java: 21.0.6; OpenJDK 64-Bit Server VM 21.0.6+7 Runtime: OpenJDK Runtime Environment 21.0.6+7 System: Linux version 6.13.6-100.fc40.x86_64 running on amd64; UTF-8; en_GB (nb) User directory: /home/james/.netbeans/25 Cache directory: /home/james/.cache/netbeans/25
I have tried installing netbeans 25 using the snap package and I can confirm this issue is NOT present when installed this way.
Product Version: Apache NetBeans IDE 25 Java: 21.0.6; OpenJDK 64-Bit Server VM 21.0.6+7 Runtime: OpenJDK Runtime Environment 21.0.6+7 System: Linux version 6.13.6-100.fc40.x86_64 running on amd64; UTF-8; en_GB (nb) User directory: /home/james/snap/netbeans/127 Cache directory: /home/james/snap/netbeans/common/127
@jameswadsworth I guess that you did not remove the usedir/cachedir/index when switching versions/editions. Please see if removing /home/james/.cache/netbeans/25/index/ or the whole /home/james/.cache/netbeans folder.
@jameswadsworth I cannot reproduce it. As @matthiasblaesing wrote, please try to remove it.
Product Version: Apache NetBeans IDE 25
Java: 19.0.2; OpenJDK 64-Bit Server VM 19.0.2+7-Ubuntu-0ubuntu322.04
Runtime: OpenJDK Runtime Environment 19.0.2+7-Ubuntu-0ubuntu322.04
System: Linux version 6.8.0-52-generic running on amd64; UTF-8;
Deleting the cache folder resolved the problem. Delete the netbeans cache folder. Then I installed version 25 from rpm file, imported the settings from 22 along with the plugins