GroggyOtter / ahkv2_definition_rewrite

Full update of the definition file for THQBY's AHKv2 support addon.
67 stars 7 forks source link

Full Definition Upgrade and Enhancement for THQBY's AutoHotkey v2 VS Code Support Addon

This is a full update for the definition file ahk2.d.ahk and the directive/flow control/variable file ahk2.json for THQBY's AHKv2 support addon.


Contents

Why use this update

[Return to Contents]

This is a full rewrite from the ground up. It adds many things to the definition that it's currently missing.
All parameters are included, all functions and methods have return values, the text of the calltips are now formatted and more aesthetically pleasing, hyperlinks are added, all options are accounted for, the structure of the definition file has been expanded and updated, autocomplete features have been added for directives and flow control, and much more.

To put things in perspective, the current definition file is ~4,200 lines long and ~185,000 characters.
The updated definition file is ~24,000 lines long and ~1,510,000 characters.
The information difference is substantial and borderline palpable.
In all fairness, a chunk of this character increase comes from the numerous hyperlinks, markdown formatting, and individual GUI controls added coupled with them now having individualized methods and properties.

Please see the In-depth Showcase section to see a large listing of the numerous changes I've implemented to these files.
There are pictures and videos for almost every topic covered.


Installation

[Return to Contents]
Installation is simple and there are multiple ways to accomplish it.

Install option 1: Updater Script

Download the definition_updater.v2.ahk and run it.
It's that simple.

Install option 2: Addon Path

After requesting this feature, THQBY added it to the addon. A path to the custom defintion files can now be provided.
This path is remembered by the addon so you do not need to reapply the definition files.
However, please be aware that the addon will NOT update my definition files.
Because of this, I still advise people to use the definition_updater.v2.ahk so my most-up-to-date files are used.
Note that it's OK to use both this method and the script method.

  1. Download the files from GitHub.
  2. Unzip the files to a single folder.
    explorer_eqOjVGEG5c
  3. Copy the path of the folder containing all the files. They have to be in the folder.
  4. Copy the folder's path. In my example, it's: D:\Code\AHK\ahkv2_definition_rewrite-main
  5. Open up VS Code and open settings. Use Ctrl+Comma or click the "Manage" gear and choose settings.
  6. Choose Extensions > AutoHotkey 2 > Scroll down to the syntaxes box > Paste the folder path
    Code_nmclXW86Ix
Install option 3: Manual installation
  1. Download the files from this repo.
  2. Go to the installation folder for the addon. It should be defaulted to here: C:\Users\<YourUsername>\.vscode\extensions\thqby.vscode-autohotkey2-lsp-<HighestVersionNumber>\syntaxes
  3. Paste the downlaoded files over the ones in the syntaxes folder.

If you ever want the original files, you can always redownload them from THQBY's addon GitHub.


Auto-Updater

[Return to Contents]
As mentioned previously, I've written an auto-updater.
This script is class structureed and comes with methods and properties to give you control of it. It's designed to be ran by itself as a stand-alone script.
The reason it's not advised to incorporate this script into another script is the auto-updater deletes the original script and replaces it with the newly downloaded version.
This will result in everything in the old script being moved to the recycle bin (allowing it be recovered if an accident should occur).
I did add an update_updater property that can be set to false to prevent updates. This acts as a safety for those who prefer to incorporate this into their main script.
(The lawyer in me requires me to say: I am not responsible for any accidental loss of data!)


In-depth Showcase

[Return to Contents]


Different Widget Types

[Return to Contents]

It should pointed out that there are multiple types of widgets that popup.


Will THQBY Implement This?

[Return to Contents]

It seems unlikely.
I showed the updated files to him and he immediately pass on them.
I'm not sure he even tried them...
I cannot convey how disappointed I am thinking about the hours I invested into this thinking it'd be picked up immediately.
Especially considering the current incomplete and lacking state the definition file is in.
I don't know. Maybe he'll get curious about it later, try it, and change his mind.
Until then, I fully intend on maintaining these files and keeping them up to date.


Change Log

[Return to Contents]

2024-07-11
2024-07-04
2024-07-02 (Big Update)
2024-03-20
2024-03-20
2024-03-19
2024-03-18 (Big Update)
2024-01-10
2024-01-09
2024-01-08
2023-12-24
2023-12-18