NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Custom code hints in IDE?


Joined: 10 Sep 2003
Posts: 4
Reply with quote
How do I add custom functions to code hints, since I like to write more twoards oop I would like to be able to define my custom functions, and possibly have them popup in the suggestion list, maybe I am just missing something, but the help didnt help. Question
View user's profileFind all posts by talmageSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
If you want some functions to be added permanently, please open Tools->Settings, switch to Reserved Words and Code Completion tab. Then add whatsoever functions you want. They will be shown in the function list (see Functions window) and in the CodeCompletion hint and popup.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 10 Sep 2003
Posts: 4
Reply with quote
How do I then provide syntax hints for my custom functions, like phped does with common php functions, it lists the parameters that function uses.

Thanks!
View user's profileFind all posts by talmageSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
How how... easily Smile. Hope the image below explains how... This window appears whenever you add a new function or correct existing.



All functions are stored in func.cfg file which is in xml format so you even may implement your own custom way Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 10 Sep 2003
Posts: 4
Reply with quote
I thank you for your patience, and I am trying my best to get this to work.

Was this functionality introduced in 3.2? When I go to tools->settings->code complete and press add, it prompts me for the name, and I select function. When I press ok, the function does not appear in the list. I also did a search of my hd for func.cfg and it was not found.

I am using 3.1, win xp pro.
View user's profileFind all posts by talmageSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
yes, it was added in 3.2.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 12 Jan 2004
Posts: 5
Reply with quote
ddmitrie wrote:
How how... easily Smile.

This can get really tedious. Can't NuSphere automatically detect that we made a new function?

Can NuSphere do code hints for our own classes as well?

Code:

<?php
class MyClass
{
  var $name;
  function MyClass($name)
  {
    $this->name = $name;
  }
  function get_name() {return $this->name;}
  /**
   * @return void
   * @desc Sets the name of the object
   * @param string $name
   */
  function set_name($name) {$this->name = $name;}
}

// create new instance
$my_obj =& new MyClass('test');
$my_obj->set_

from the end of "->set_", the code-hint should popup with the function name, arguments with expected data type, and return. similar to what ZendStudio does. Same with anything else that was include()/require(). Before anyone says it, sometimes copying ideas work and are just plain needed. Look how good the wheel works in our automobiles.
View user's profileFind all posts by zer0fillSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Okay. What shown in the screeshot is for standard functions available with PHP extensions. As with your own defined in PHPDOC style comments, they are fullly supported in PHPED 3.3.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 12 Jan 2004
Posts: 5
Reply with quote
small bug: the object code hint doesn't work with functions that have the same name as built-ins

eg: $smarty->assign()

great work with 3.3, it looks really impressive now that it has obj hints Very Happy
View user's profileFind all posts by zer0fillSend private message
Custom code hints in IDE?
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
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic