| View previous topic :: View next topic |
| Author |
Message |
darrenm
Joined: 25 Aug 2009 Posts: 2
|
Posted: Tue Aug 25, 2009 12:00 pm Post subject: Autocomplete problem |
|
|
hi
I'm trying to setup netbeans to auto complete the core classes of my CMS (Expression Engine). As it does not include classes in a way the NB could detect, I've made some cusom includes as follows:
- Added the directory containing all core classes to Include Path
- Added a directoty containing a helper file to Include Path. The helper file looks like this:
| Code: |
<?php
$DB = new DB();
$FNS = new Functions();
$EMAIL = new EEmail();
$SESS = new Session();
$REGX = new Regex();
?>
|
So far so good. When I start a new PHP file I get the expected auto complete when I type $REGX->
The problem is when I'm within a class or function. This CMS works by passing the core classes around with a global scope. To my mind, NB should recognise my global declarations and autocomplete as expected. However, this doesn't happen. See example of another PHP file:
| Code: |
<?php
$REGX-> // AUTO COMPLETE WORKS HERE
function helper_function() {
global $REGX;
$REGX-> // AUTO COMPLETE FAILS HERE
}
class class_name {
function __construct() {
}
function myMethod() {
global $REGX;
$REGX-> // AUTO COMPLETE FAILS HERE
}
}
?>
|
Can anyone help? Is it a limitation of NB or can I workaround with a different approach?
many thanks |
|
| Back to top |
|
 |
Tomas Mysik Posted via mailing list.
|
Posted: Tue Aug 25, 2009 3:14 pm Post subject: Autocomplete problem |
|
|
Hi,
Dne úterý 25 srpna 2009 14:01:07 darrenm napsal(a):
| Quote: | Can anyone help? Is it a limitation of NB or can I workaround with a
different approach?
|
which NetBeans version do you use? I tried it now in [1] and it works for me.
Feel free to file an issue [2] (component php, subcomponent editor) with
example file/project if possible, or at least exact steps to reproduce.
Thanks a lot,
Tomas
[1] Product Version: NetBeans IDE Dev (Build 090814)
[2] http://www.netbeans.org/community/issues
--
Tomas Mysik
address-removed |
|
| Back to top |
|
 |
darrenm
Joined: 25 Aug 2009 Posts: 2
|
|
| Back to top |
|
 |
viking
Joined: 29 Jun 2009 Posts: 3
|
Posted: Wed Aug 26, 2009 4:50 am Post subject: |
|
|
| I don't want to create new topic because my question is very similar. How can I enable autocomplete for some built-in classes like imagick? |
|
| Back to top |
|
 |
Tomas Mysik Posted via mailing list.
|
Posted: Wed Aug 26, 2009 12:08 pm Post subject: Autocomplete problem |
|
|
Hi,
Dne středa 26 srpna 2009 06:50:21 viking napsal(a):
| Quote: | I don't want to create new topic because my question is very similar. How
can I enable autocomplete for some built-in classes like imagick?
|
imagick - it's extension which has to be enabled - right? If the code
completion for it is not present, you have 2 options:
- submit a bug against php/code [1]
- create a stub php file with all imagick method/constants/etc. signatures [2]
and put it on the Global PHP Include Path (Tools > Option > PHP)
HTH,
Tomas
[1] http://www.netbeans.org/community/issues
[2] Something like:
<?php
class Imagick {
/**
* TODO: Add valid PHPDoc in order to have code completion.
*/
public static function adaptiveBlurImage(...) {}
}
?>
--
Tomas Mysik
address-removed |
|
| Back to top |
|
 |
viking
Joined: 29 Jun 2009 Posts: 3
|
Posted: Wed Aug 26, 2009 12:22 pm Post subject: |
|
|
| I'll sumit a bug report because this extension has really lot of constants/methods http://pl.php.net/manual/en/book.imagick.php (and that is why autocomplete would be nice). |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|
|