Code Completion for Namespaces - part I

This is brief overview how to use code completion for namespaced elements in NetBeans 6.8.
Namespaced elements are resolved according  name resolution rules.

See examples for namespace name definitions that are important for resolution rules:

// Fully qualified name
$c = new \\my\\name\\ExampleClass();

// Qualified name
$c = new name\\ExampleClass();

// Unqualified name
$c = new ExampleClass();

Now we have 3 ways how to create new instance of class ExampleClass. Let's look how to harness code completion to generate all of them.

Fully qualified name

Simply begin with a namespace separator after new keyword (e.g. new \\Exam), choose from the list of proposals and press enter. 

fully qualified name proposals

As a result:

fully qualified name result

Unqualified name

 The same as for fully qualified name - just omit namespace separator at the beginning (e.g. new Exam).

qualified name proposal

As a result:

qulified name result

Qualified name

Begin with a sub-namespace name (whereas code completion can be used here also ) followed with namespace separator after new keyword (e.g. new name\\Exam), choose from the list of proposals and press enter. 

qualified name proposal

As a result:

qualified name result

As mentioned above, for sub-namespace name can be used code completion too.

namespace name proposal

For e.g. new name\\test\\Exam can be used code completion 3 times: name, test, Exam.

Comments:

DO we have any other version of NetBeans. this NetBeans 6.8 is getting trouble often.

Regards,
stutalk.com

Posted by blostutalk on August 10, 2009 at 05:46 AM CEST #

to blostutalk:

NetBeans 6.8 is in development phase, relase is planned for Fall 2009, but using it and reporting bug is very helpful for us and help us make the IDE better.

Latest stable version is 6.7.1:
http://www.netbeans.org/downloads/index.html

Posted by radek on August 10, 2009 at 05:58 AM CEST #

to blostutalk:

BTW: could you report the mentioned problems, thanks

Posted by guest on August 10, 2009 at 06:02 AM CEST #

Diky! Nice work

Posted by Vitex on August 10, 2009 at 10:04 AM CEST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2015
SunMonTueWedThuFriSat
   
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
  
       
Today