AHK v1 version has been temporarily shelved until other advanced features can be implemented. The currently posted version for AHK v1 still works, but has a few more kinks.
Please report errors! Just press CTRL+C when you get an error dialog (click on the dialog first to give it focus) and paste the error in a reply in this thread.
Image
CallTipsForAll.png (14.95 KiB) Viewed 9603 times
================================================== Download on GitHub CallTipsForAll v2 Features List
==================================================
Current Status:
- Taking a break for a bit to actually use this script now. In the process of using it I hope to come up with more ideas for how to improve this script. As usual please post your ideas, comments, bugs, and I'll address them. I'll still be checking the forums of course, and I'll try to stay on top of any code breakage from alpha updates.
==================================================
UPDATES
Update 2020/07/31
found a small issue when parsing classes - the parser seemed to extend beyond the last line of the class for some reason, now it's limited with classArr.Length
Update 2020/07/19
Applied fixes for a117 - nothing major
Update 2020/07/17
updated code for AHK v2-a116
modified auto-complete to show a more complete list
added (o) and (c) to Auto-Complete results for objects and classes
Auto-Complete now filters methods / properties of classes based on class/instance/static or not
fixed a few intuitive issues with Auto-Complete closing when clicking on the scroll bar
Update 2020/07/10
parser completely rewritten
functions moved around to separate parser from call-tip functions
parsing performance drastically improved
Auto-Complete gui improved while typing, no longer creates/destroys every keystroke, reduces errors while typing fast (haven't had one since the update!)
minor work-around for bug addressed in AutoHotkey commit 89337467
Language file format adjusted, check docs if you wish to write your own (warning: ya might need a new parser too)
A few object detections have been lost, mostly objects defined by the format of an expression (mostly for built-in callback functions) - these will be re-added later
Update 2020/07/01
updated lang files for v2-a113
after selecting Auto-Complete, call tip now shows (as intended) for all except properties without params (class properties can have params)
updated a few lines of code for the new commands in a113
Update 2020/06/28
Added WIN32API functions to AHK_H v2
accidental breakage of scanning libs fixed
fixed a missing reset of IncludesList on reload
fixed issue showing call tips for some classes
Known Issue: Extended running of CallTipsForAll sometimes results in errors, mostly related to window focus. Trying to fix these little-by-little as I come across them.
Update 2020/06/26
fixed unintentional breakage of Notepad.exe compatibility
ensured all call tips, auto-complete, and ProcInput() are disabled when Settings dialog is open
fixed string function parameters showing up as *******
added AHK_H v2 commands/functions/objects (as best I could, please post feedback!)
improved editor control detection for more reliability
- using the multi-file search in Notepad++ shouldn't be an issue now
added "Try" in InputHook to avoid errors when trying to detect current window/control
Update 2020/06/24
added user-defined hotkeys in SettingsGUI
found a glitch when typing at the end of a document, one char is truncated, this should be fixed, may need further testing
every captured keypress now checks active window, this allows user to no longer be required to click on the text editor to "activate" the control as long as it has the focus
script detects ALT+Tab and changes .ctlActive to false
fixed a few issues where Auto-Complete was closing as expected but {Enter} suppression was still on
added user-defined hotkeys in SettingsGUI
found a glitch when typing at the end of a document, one char is truncated, this should be fixed, may need further testing
user functions now show up in auto-complete
selecting a user function brings up the call tip for that user-defined function
Update 2020/06/22
inputHook is now global. Found that when the user holds a key down, it ends up making dupe input hooks, and caused performance issues. This is now fixed.
Improved handling of {Enter} and {Tab}. Seems that these keys are properly suppressed and reactivated now when using Auto-Complete.
Improved flexibility of Auto-Complete, word fragment doesn't have to start with selected Auto-Complete entry to function properly now.
User can now use {Tab} to scroll through Auto-Complete. {Tab} will also cycle to the top when selection reaches the bottom.
Update 2020/06/20
fixed issue with displaying call tips for built-in properties
a few more a112 fixes
made MultiClickDetect() into a class, easier to use now
added regex to recognize new keywords as objects: gui, menu, menubar
cleaned up some old code that did nothing
Update 2020/06/16
somehow StrRepeat() function was removed and blanking out comments for capturing classes was also undone, this puts those functions back
fixed settings not loading on first run after filling out settings dialog
fixed a few AHK v2 a111 changes:
array for guiObj.Add()
gui.pos -> gui.GetPos(x,y,w,h)
auto-complete improved with SendMessage() for scintilla
selection in auto-complete now has proper case
auto-complete selection now opens a call tip if selection is a command, function, object, method, or property
fixed background color of auto-complete
Update 2020/06/15
Auto-Complete automatically closes when user finishes typing a word manually
Fixed case-sensitive lookup of objects/classes
several lines of code simplified thanks to toralf
class comments `; hide` and `; show` are temporarily non-functional, now all methods and properties will show up in classes
preparing to implement toralf's parser to get much more diagnostic script info to integrate into the script
updated call tips to a111
updated hotkeys format and JXON lib for a111
Update 2020/06/10
Added Auto-Complete feature
toggle Auto-Complete while typing in Settings window
Auto-Complete will dynamically change depending on if you are typing functions/commands or objects/properties/methods
Update 2020/06/08
improved classes parsing
use ; hide comment to hide methods / properties of all types
use ; show comment after first-line class brace { to hide all elements, and use ; show comment after each element to selectively show elements
Update 2020/06/03/08
functionality / stability update for loading includes
When specifying a "Base File" in Settings the active window is no longer used to load text. I tried to keep that ability before, but now for the sake of accurate loading of #INCLUDES, the active window will not be parsed / loaded when "Base File" is defined. Clear the "Base File" setting in order to re-enable loading of elements in the active window.
Update 2020/06/02
loading includes now supported
made minor changes to regex to identify classes properly
restructured code into libs for easier reading
Update 2020/05/30
Reworked window / text editor detection to be more intuitive
Added GUI to change several user settings (in tray menu)
Changed ; comment support to identify objects to be shorter (check GitHub readme)
Changed hotkeys as follows:
Invoke Call Tip: CTRL+SHIFT+Space or Double-click
Close Call Tip: ESC or Middle button
any text editor that has a scintilla control or edit control as main text editing control is supported
Update 2020/04/19
Added my own version of the WTFPL license. Not sure how popular this script may end up, but also want to prevent some troll from attempting to being a turd of a human.
Update 2020/04/18
Attempt to detect literal `" and \" in strings. This will help with proper string detection, which is needed to not mistake a part of a string for a keyword
AHK v2 Call Tip language update - objects can be designated with comments. Example:
array := MysteryObject["mystery_item"] ; ArrayObject
array is detected as ArrayObject, and call tips can be used with caret on "array"
Update 2020/04/16
Reworked parsing objects, now more efficient and less lag
Now, keywords can have multiple call tips, use UP/DOWN arrows to scroll
Items with multiple object definitions will show all call tips with UP/DOWN (like GuiObj / TreeView obj)
reworked the call tip file format, now user can define multiple custom call tips per keyword
Added ListView / TreeView obj definitions (methods and properties now detected)
Update 2020/04/14
Added AHK v1 copy of the script
Added a few missing functions / commands to the help docs
created AHK v1 call tips
Update 2020/04/13
Moved to GitHub
Fixed objects set by function return value
Click call tip to jump to help page
Update 2020/04/09: lots of changes
Now call tips can detect most objects.
In some cases objects of objects can be detected.
Just extract and run. Works in Notepad++ and regular Notepad
No more version filtering (AHK1/2) but will be re-implemented
==================================================
For info regarding hotkeys, usage, and functionality please see the README.
@Helgef
thanks for the interest! Still continuing development. Trying now to map out the entire document, catalog custom functions, and objects for extra fancy and proper call tips. Custom functions in call tips isn't too hard, but the objects are tricky. Still working that part out.
@kczx3
I didn't know about those functions until you mentioned them. Thanks for the info! My main goal is to make this as compatible as possible for a variety of text editors.
Aside from that, I'm not too sure how to implement these yet. That will take more time.
Added a few missing functions / commands to the help docs
created AHK v1 call tips
Unfortunately the AHK v1 copy of the script lags a bit compared the AHK v2 copy, but it still works. Please let me know now it works. Put issues on GitHub. I'm glad to try and take this project further.
Poll Question above:
Should this script attempt to account for reusing variables / objects as different types?
I make it a point to NOT reuse variable names in my code if I can help it, and if i do, then they are at least the same type. This makes parsing the code faster for call tips. I started coding this script with that mindset (to NOT allow reusing variables), but then started to lean that way a little, though not fully, and it's already taking a performance hit.
I've come up against a cross-road. Trying to get as much functionality as possible, but at what cost? The goal is to create a framework to map out as much of a coding language as possible for call tips and to make the help docs even more accessible.
The more I try to account for reused variables in the code, the more times the script must loop through the document to parse the code again, and again, and figure out what is what. I still haven't mapped out all the objects in the AHK v1 and v2 language files yet for call tips, but the performance hit is noticeable. The further I go, the slower it may get, unless I change the scope of what this script is meant to do. Apart from language files, I'm still working on more features to break down the code further for more intuitive call tips.
So please let me know what you think. I can't say exactly which way I will go despite the poll, but I want your input. Of course I'm using this script too!
Attempt to detect literal `" and \" in strings
This will help with proper string detection, which is needed to not mistake a part of a string for a keyword
AHK v2 Call Tip language update - objects can be designated with comments. Example: array := MysteryObject["mystery_item"] ; ArrayObject
array is detected as ArrayObject, and call tips can be used with caret on "array"
Added my own version of the WTFPL license. Not sure how popular this script may end up, but also want to prevent some troll from attempting to being a turd of a human.
@Helgef
Could you try calling up the call tip in the AHK v2 script? And in the AHK v2 for CallTipsForAll script press F10 / F11 ... those are diagnostic msgobxes to show visible object and function lists.
I am working on a new version also ... should be more intuitive.
If you check the language folder, you should see all the supported objects, so let me know if any others aren't working as desired too ...
Occasionally I'll have issues with the script properly loading the text due to focus issues. I'm still trying to work those issues out myself. I may just make my own text editor with a Scinitilla control and embed the call tips in there.
Edit: I tried your small example and can't recreate the issue. But this is along the lines of having issues with reloading the lists of objects and functions according to which window is active, still working out those kinks. When I start clicking around fast, i tend to get more issues, and occasionally errors.
Are you able to get Gui call tips in the main CallTipsForAll script?
One of the big tests is the ObjectList object ... It's a map, but is only made so by a function, so that is basically one of the more complex detections, getting object type based on return from function.
@Helgef
In regards to supporting classes, I can't think of anything other than listing methods and properties for call tips, and then when focused on the method name, give syntax for the method.