7

After enabling "Function parameters hint on input" in Preferences->Backup/Auto-Completion, I get helpful tips for native PHP functions like this:

string|false substr (string str, int start, [int length])

Is there a plugin or something that would make Notepad++ do this for my own functions, much like Dreamweaver does?

hamburgerly
  • 161
  • 2
  • 5
  • 1
    Any reason not to use an IDE like Netbeans, PhpStorm, Code Lobster, Aptana Studio, Eclipse, or Komodo? They can show you function parameters, definitions, debugging, and so much more. – donutdan4114 Sep 18 '12 at 01:57
  • 1
    I don't know if Notepad++ supports this, but have you tried documenting your functions in PHPDoc style? Netbeans and other IDEs use this (in part) for parameter hinting http://en.wikipedia.org/wiki/PHPDoc – John Carter Sep 18 '12 at 01:59

3 Answers3

7

Settings -> Preferences -> Backup/Auto-Completion -> Function parameters hint on input [CHECK]

Is this what you're talking about? Works for me.

Devin Burke
  • 13,642
  • 12
  • 55
  • 82
Paul Statezny
  • 133
  • 1
  • 7
4

I have accomplished this by doing the following:

  1. Edit API XML file used by Notepad++ for the desired language.
  2. Add custom names in Settings > Style Configurator to get highlighting you desire.

Editing the API XML file

The API XML files are located in your installation directory \plugins\APIs. I believe there is a file for each language that has a parser. That parser will determine which pieces of the XML file are required or ignored.

These files are very fragile so here are some tips:

  • All entries MUST be in alphabetically order by KeyWord or it will silently fail.
  • Watch out for text that makes your XML invalid in descriptions. From what I can tell Notepad++ doesn't have a schema to tell it that attributes are of type string so all kinds of characters will break the XML and your tips.
  • Any problems with the XML file will silently fail the tips.

I have used this technique to support a custom API used by a game engine I am working with and it works great. I have an excel spreadsheet to manage entries and create properly formatted XML to be pasted into the correct section of the file, but obviously there are many ways that managing that could be done.

I figured all this out based on these sources:

  1. http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Editing_Configuration_Files#API_files
  2. http://retroaffect.com/blog/190/A_Lua_Language_File_for_Notepad__/#b
    • (The API file here you can download has the Environment tag in the wrong place, it should be within the AutoComplete tag instead, but it helped me understand the usage.)

Editing the Style Configurator

Screen adding new key word: myNewKeyword

Screen adding new key word: myNewKeyword

Final result after adding math.tanh with highlighting

Screen showing tool tip and highlighting for math.tanh in lua

Brooke Jackson
  • 113
  • 1
  • 7
1

I'm not too familiar with Notepad++, however I think unless there is some sort of IDE plugin it would not be possible.

In my opinion, you should use Aptana Studio, it's based off of the Eclipse IDE, and is specifically made for web development/PHP. Although there are plenty of other IDEs out there, here's a few.

Here's a link to Aptana: http://www.aptana.com

Darren
  • 1,774
  • 4
  • 21
  • 32
  • 1
    Notepad++ is nice and light, but Aptana blows it out of the water. – wesside Sep 18 '12 at 02:19
  • Thanks. I'll check out Aptana once I'm on a better connection. – hamburgerly Sep 18 '12 at 02:22
  • There are plenty of other IDE's out there if you don't like it, but from my personal experience, it's the best. If you still just want a regular text editor, check out http://www.sublimetext.com/ – Darren Sep 18 '12 at 02:23