CallTipsForAll v2 - 2020/07/31 - a121

Share the finished AutoHotkey v2 Scripts and libraries you made here. Please put the current version of AutoHotkey v2 you used in Square Brackets at the start of the topic title.
User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

CallTipsForAll v2 - 2020/07/31 - a121

Post by TheArkive » 14 Mar 2020, 05:29

CallTipsForAll v2 - for AHK v2 (and maybe AHK v1)

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.
CallTipsForAll.png
Image
CallTipsForAll.png (14.95 KiB) Viewed 2880 times
==================================================
Download on GitHub :arrow: 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
==================================================
For info regarding hotkeys, usage, and functionality please see the README.

Check Language_CallTip_Design_Help.txt for instructions to modify/make language call tip files.

==================================================
Project Contributors
==================================================

notepad.exe will be sustained, but my focus is mostly on scintilla. If you find I am neglecting Notepad support please speak up :-)

I am researching ways to hopefully add compatibility to other text editors like VSCode and Sublime.
Last edited by TheArkive on 11 Aug 2020, 15:09, edited 75 times in total.

Helgef
Posts: 4459
Joined: 17 Jul 2016, 01:02
Contact:

Re: CallTipsForAll v1 - 2020/03/14

Post by Helgef » 31 Mar 2020, 10:14

Really great job :thumbup: :clap:. I look forward to see the continuation of this.

Thanks for sharing, cheers.

User avatar
kczx3
Posts: 1141
Joined: 06 Oct 2015, 21:39

Re: CallTipsForAll v1 - 2020/03/14

Post by kczx3 » 31 Mar 2020, 19:52

For Scintilla, why not use WordStartPosition and WordEndPosition?

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v1 - 2020/03/14

Post by TheArkive » 02 Apr 2020, 05:43

@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.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/09

Post by TheArkive » 09 Apr 2020, 07:55

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

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/13

Post by TheArkive » 13 Apr 2020, 13:20

Update 2020/04/13
  • Moved to GitHub
  • Fixed objects set by function return value
  • Click call tip to jump to help page
I'll post a release to GitHub soon, for now just download the master.zip

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/13

Post by TheArkive » 14 Apr 2020, 10:59

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
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.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Poll - Feedback Request

Post by TheArkive » 14 Apr 2020, 16:46

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!

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/16 - For AHK v1 / v2

Post by TheArkive » 16 Apr 2020, 07:31

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)

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by TheArkive » 18 Apr 2020, 05:37

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"

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by TheArkive » 19 Apr 2020, 04:37

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
Posts: 4459
Joined: 17 Jul 2016, 01:02
Contact:

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by Helgef » 29 May 2020, 06:06

Hi
I can't see any calltips for any object other than ArrayObject. eg,

Code: Select all

x := MyStuff.New() ; MyStuff
x.MyMethod ; Shows calltips for ArrayObject
Thank you for your continued work on this, cheers.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by TheArkive » 29 May 2020, 06:15

Helgef wrote:
29 May 2020, 06:06
Hi
I can't see any calltips for any object other than ArrayObject. eg,

Code: Select all

x := MyStuff.New() ; MyStuff
x.MyMethod ; Shows calltips for ArrayObject
Thank you for your continued work on this, cheers.
Script version AHK v1 or 2? And what language are you trying to use call tips for?

EDIT: I know that generally speaking classes aren't supported yet, that's part of the issue ...

Helgef
Posts: 4459
Joined: 17 Jul 2016, 01:02
Contact:

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by Helgef » 29 May 2020, 06:18

v2/v2 ofc ;). I see, it didn't work with ; Map either.

Cheers.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by TheArkive » 29 May 2020, 06:35

@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.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by TheArkive » 29 May 2020, 07:04

As for getting call tips with ; comments ... the following are currently supported:

ArrayObject
BufferObject
FileObject
FunctionObject
GuiControlObject
GuiObject
InputHookObject
ListViewObject
MapObject
MenuObject
Object
RegExMatchObject
StatusBarObject
TreeViewObject

I guess I need to do some better documenting ...

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
Posts: 4459
Joined: 17 Jul 2016, 01:02
Contact:

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by Helgef » 29 May 2020, 08:12

I will try this later

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by TheArkive » 30 May 2020, 01:28

@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.

Did you have any other kind of behavior in mind?

Helgef
Posts: 4459
Joined: 17 Jul 2016, 01:02
Contact:

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by Helgef » 30 May 2020, 01:41

No. Can it give tips when carret is behind method or function?

Cheers.

User avatar
TheArkive
Posts: 330
Joined: 05 Aug 2016, 08:06
GitHub: TheArkive

Re: CallTipsForAll v2 - 2020/04/18 - For AHK v1 / v2

Post by TheArkive » 30 May 2020, 02:07

Helgef wrote:
30 May 2020, 01:41
No. Can it give tips when carret is behind method or function?

Cheers.
Indeed it should. Does it not do that currently?

EDIT: For current supported calltips i mean...

Post Reply

Return to “AutoHotkey v2 Scripts and Functions”