netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

[php] Not proposing methods, classes and namespaces in code completion from the project

Open jameswadsworth opened this issue 1 year ago • 6 comments

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 image

Actual Behaviour In version 23 only method names and class names from standard php platform and code templates are proposed. image image

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

jameswadsworth avatar Sep 24 '24 12:09 jameswadsworth

Please provide an example code to reproduce it. Thanks.

junichi11 avatar Sep 26 '24 09:09 junichi11

It the same for all php projects. Would you like me send you a php project?

jameswadsworth avatar Sep 26 '24 13:09 jameswadsworth

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)

junichi11 avatar Sep 27 '24 01:09 junichi11

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.

jameswadsworth avatar Sep 30 '24 20:09 jameswadsworth

Thanks. Can you write your exact steps to reproduce it?

junichi11 avatar Oct 03 '24 11:10 junichi11

  1. open the project
  2. edit any php file for example administrator/components/com_users/src/Controller/UsersController.php
  3. 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?

jameswadsworth avatar Oct 03 '24 18:10 jameswadsworth

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.

jameswadsworth avatar Feb 20 '25 09:02 jameswadsworth

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 avatar Mar 18 '25 16:03 jameswadsworth

@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.

matthiasblaesing avatar Mar 18 '25 18:03 matthiasblaesing

@jameswadsworth I cannot reproduce it. As @matthiasblaesing wrote, please try to remove it.

Image

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;

junichi11 avatar Mar 19 '25 04:03 junichi11

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

Image

Image

jameswadsworth avatar Mar 19 '25 21:03 jameswadsworth