Requires: AutoItObject.au3
You can download the exe too: Notepad++ with AutoIt User Calltips http://www.mediafire.com/?jaavgngq7io6xmd (MediaFire -- 510 downloads).
To use this:
1. download Notepad++ (check)
2. download AutoItV3 with Scite (check)
3. download this script to any directory (to-do)
4. run the script (to-do)
5. enjoy np++! (ggggggggggggggggggggggggggggoooooooooooooooaaaaaaaaaaaaaaaaaaaaallllllllllllllllllllllllllllllllllL!!!!!!)
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Au3Check_Stop_OnWarning=y #AutoIt3Wrapper_Au3Check_Parameters=-w 1 -w 2 -w 3 -w 4 -w 6 -d #AutoIt3Wrapper_Run_Tidy=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include "AutoItObject.au3" #include <Array.au3> #include <File.au3> #include <Misc.au3> #include <IE.au3> _Singleton(@ScriptName) _IEErrorHandlerRegister() _AutoItObject_Startup() Global $calltip = CallTip() HotKeySet("{ESC}", "_exit") OnAutoItExitRegister("term") $calltip.AU3APItoArray() If @error Then Exit $calltip.DeleteNonFunctions() $calltip.ReplaceXMLKeyWords() $calltip.GetFunctionNames() $calltip.GetFunctionParams() $calltip.GetFunctionDescr() $calltip.OutputXMLDocument() If @error Then Exit Func _exit() Exit EndFunc ;==>_exit Func term() $calltip = '' EndFunc ;==>term #Region UserCallTips Generator Func CallTip() Local $this = _AutoItObject_Create() Local Const $FileInPath = @ProgramFilesDir & "\AutoIt3\SciTE\api\au3.api" Local Const $FileOutPath = @ProgramFilesDir & "\Notepad++\plugins\APIs\autoit.xml" _AutoItObject_AddDestructor($this, "CallTip_Dtor") _AutoItObject_AddProperty($this, "FileInPath", $ELSCOPE_PRIVATE, $FileInPath) _AutoItObject_AddProperty($this, "FileOutPath", $ELSCOPE_PRIVATE, $FileOutPath) _AutoItObject_AddProperty($this, "AU3", $ELSCOPE_PRIVATE, '') _AutoItObject_AddProperty($this, "Descrs", $ELSCOPE_PRIVATE, '') _AutoItObject_AddProperty($this, "Names", $ELSCOPE_PRIVATE, '') _AutoItObject_AddProperty($this, "Params", $ELSCOPE_PRIVATE, '') _AutoItObject_AddMethod($this, "AU3APItoArray", "CallTip_AU3APItoArray") _AutoItObject_AddMethod($this, "DeleteNonFunctions", "CallTip_DeleteNonFunctions") _AutoItObject_AddMethod($this, "GetFunctionDescr", "CallTip_GetFunctionDescr") _AutoItObject_AddMethod($this, "GetFunctionNames", "CallTip_GetFunctionNames") _AutoItObject_AddMethod($this, "GetFunctionParams", "CallTip_GetFunctionParams") _AutoItObject_AddMethod($this, "OutputXMLDocument", "CallTip_OutputXMLDocument") _AutoItObject_AddMethod($this, "ReplaceXMLKeyWords", "CallTip_ReplaceXMLKeyWords") _AutoItObject_AddMethod($this, "FileWriteTab", "CallTip_FileWriteTab", True) _AutoItObject_AddMethod($this, "Write", "CallTip_Write", True) Return $this EndFunc ;==>CallTip Func CallTip_Dtor($this) _AutoItObject_Shutdown() _IEErrorHandlerDeRegister() EndFunc ;==>CallTip_Dtor ; ======================================================================================================================================== Func CallTip_AU3APItoArray($this) Switch FileExists($this.FileInPath) ; check for existence of 'au3.api' Case 1 $this.Write("'au3.api' exists and is within it's proper directory.") Case 0 Local Const $msgBoxTemp = MsgBox(4, "Alert:", "'au3.api' does not seem to be within it's default directory." & @LF & "Would you like to specify the current 'au3.api' directory?") Switch $msgBoxTemp Case 6 ; yes Local Const $result = FileOpenDialog("Browse to 'au3.api'", @DesktopDir, "API (*.api;)", 1 + 2) Switch $result Case '' Return SetError(2, 0, 1) Case Else $this.FileInPath = $result EndSwitch Case 7 ; no Return SetError(1, 0, 1) EndSwitch EndSwitch Local $au3 _FileReadToArray($this.FileInPath, $au3) $this.AU3 = $au3 EndFunc ;==>CallTip_AU3APItoArray ; ======================================================================================================================================== Func CallTip_DeleteNonFunctions($this) Local $au3 = $this.AU3 Local Const $upBound = UBound($au3) - 1 For $i = $upBound To 0 Step -1 If Not StringInStr($au3[$i], "(") Then ; yeah, it's a hack, deal with it _ArrayDelete($au3, $i) EndIf Next $this.AU3 = $au3 EndFunc ;==>CallTip_DeleteNonFunctions ; ======================================================================================================================================== Func CallTip_ReplaceXMLKeyWords($this) ; Replace reserved XML keywords with character entity references Local Const $find[6] = ["&", """", "<", ">", ", [,", "'"] Local Const $replace[6] = ['&', '"', '<', '>', ' [,', '''] Local Const $chars = UBound($find) - 1 Local $au3 = $this.AU3 Local Const $upBound = UBound($au3) - 1 For $i = 0 To $upBound For $j = 0 To $chars $au3[$i] = StringReplace($au3[$i], $find[$j], $replace[$j]) Next Next $this.AU3 = $au3 EndFunc ;==>CallTip_ReplaceXMLKeyWords ; ======================================================================================================================================== Func CallTip_GetFunctionNames($this) Local Const $au3 = $this.AU3 Local Const $upBound = UBound($au3) - 1 Local $names[$upBound + 1] For $i = 0 To $upBound ; extract the name of the function ; EX: "Abs ( expression ) Calculates the absolute value of a number." $names[$i] = StringTrimRight($au3[$i], StringLen($au3[$i]) - ((StringInStr($au3[$i], ' ') - 1))) ; ==> "Abs" Next $this.Names = $names EndFunc ;==>CallTip_GetFunctionNames ; ======================================================================================================================================== Func CallTip_GetFunctionDescr($this) Local Const $au3 = $this.AU3 Local Const $upBound = UBound($au3) - 1 Local $descr[$upBound + 1] For $i = 0 To $upBound ; extract the function description ; EX: "Abs ( expression ) Calculates the absolute value of a number." $descr[$i] = StringTrimLeft($au3[$i], (StringInStr($au3[$i], ')') + 1)) ; ==> "Calculates the absolute value of a number." Next $this.Descrs = $descr EndFunc ;==>CallTip_GetFunctionDescr ; ======================================================================================================================================== Func CallTip_GetFunctionParams($this) Local Const $au3 = $this.AU3 Local Const $upBound = UBound($au3) - 1 Local $params[$upBound + 1] Local $tmp For $i = 0 To $upBound ; extract the function parameters ; EX: "Abs ( expression ) Calculates the absolute value of a number." $tmp = StringTrimRight($au3[$i], StringLen($au3[$i]) - StringInStr($au3[$i], ')') + 1) $params[$i] = StringTrimLeft($tmp, StringInStr($tmp, '(') + 1) ; ==> "expression" Next $this.Params = $params EndFunc ;==>CallTip_GetFunctionParams ; ======================================================================================================================================== Func CallTip_OutputXMLDocument($this) Switch FileOpen($this.FileOutPath, 2) Case -1 $this.Write("There was an error opening:" & @CRLF & $this.FileOutPath) Return SetError(-1, 0, 1) Case Else $this.Write($this.FileOutPath & ": was opened successfully." & @CRLF) Local Const $name = $this.Names Local Const $param = $this.Params Local Const $descr = $this.Descrs Local Const $upper = UBound($name) - 1 Local $tmp ; header $this.FileWriteTab(0, "<?xml version='1.0' encoding='UTF-8' ?>") $this.FileWriteTab(0, "<NotepadPlus>") $this.FileWriteTab(1, "<AutoComplete language='AutoIt'>") $this.FileWriteTab(2, "<Environment ignoreCase='yes' startFunc='(' stopFunc=')' paramSeparator=',' terminal='' />") ; body For $i = 0 To $upper If $name[$i] = '' Then ContinueLoop Else $this.FileWriteTab(2, "<KeyWord name='" & $name[$i] & "' func='yes' >") $tmp = StringSplit($param[$i], ',') ; load the function parameters individually into an array Select Case $tmp[0] >= 1 ; more than one parameter $this.FileWriteTab(3, "<Overload retVal='' descr='" & $descr[$i] & "' >") For $j = 1 To $tmp[0] $this.FileWriteTab(4, "<Param name='" & StringStripWS(StringReplace($tmp[$j], ",", ""), 1 + 2) & "' />") Next $this.FileWriteTab(3, "</Overload>") Case Else ; only one parameter $this.FileWriteTab(3, "<Overload retVal='' descr='" & $descr[$i] & "' />") EndSelect $this.FileWriteTab(2, "</KeyWord>") EndIf Next ; footer $this.FileWriteTab(1, "</AutoComplete>") $this.FileWriteTab(0, "</NotepadPlus>") FileClose(1) EndSwitch EndFunc ;==>CallTip_OutputXMLDocument ; ======================================================================================================================================== Func CallTip_FileWriteTab($this, Const $tabs, Const $data) ; 'FileWrite' with tabs Local $tabString = '' Local Const $upBound = $tabs - 1 If $tabs > 1 Then For $i = 0 To $upBound $tabString &= @TAB Next ElseIf $tabs = 1 Then $tabString = @TAB EndIf FileWrite(1, $tabString & $data & @CRLF) EndFunc ;==>CallTip_FileWriteTab ; ======================================================================================================================================== Func CallTip_Write($this, Const $Message) MsgBox(0, "Calltips XML Generator", $Message, 10) EndFunc ;==>CallTip_Write #EndRegion UserCallTips Generator
Edited by jaberwocky6669, 30 January 2011 - 04:12 AM.






