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 269005

Summary: Namespace suggestion for new files
Product: php Reporter: twifty
Component: ProjectAssignee: Tomas Mysik <tmysik>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: Dev   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:

Description twifty 2016-11-16 13:57:53 UTC
Problem:
When using the IDE to add a new php class/interface, the dialogue window has a "Namespace" drop down box. This box is only populated IF namespaced files already exist in the directory. When the directory is empty, no suggestions are available and we have to type the full namespace. Recently this cause me no end of problems when I incorrectly spelled one of the uppers directory names.

Solution:
When adding a new file, check for namespaces available in the parent directory, append the new directory name and offer them as suggestions.
Comment 1 eviweb 2016-11-17 12:34:16 UTC
Hi,

It also would be great, for composer based PHP project, if namespace suggestions could be based on the PSR-0 and PSR-4 mappings of the composer.json autoload setting.

But maybe this should be part of another ticket...

Best regards

Eric