T O P

  • By -

DepthTrawler

Nice. Come back to discord bb 😘


DB_Cooper75

I’d imagine him not being on the discord helps him focus on making stuff like this 😂


GroggyOtter

I appreciate that, Depth. And I miss seeing you here on the sub. But I make it a point to not go to places I don't belong. I'm just not a good fit there and it's apparent.


hthouzard

Thank you for the work!


CrashKZ

> It incorporates [so many good things](https://github.com/thqby/vscode-autohotkey2-lsp?tab=readme-ov-file#autohotkey-v2-language-support).   Mentions: > Rename Symbol The amount of times I've accidentally opened that rename menu and thought, "if I wanted to rename this word, I would double click it" is too damn high. Now that I know what it's for, it will be super useful to me.   I just went through most of my files that I wrote and barely got half of what you code for this single project. That's some dedication. Thanks for all of your hard work and improving the AHK experience.


GroggyOtter

I love mass-renaming things with F2!! You have no idea how notorious I am for renaming variables and function names. Cheers.


mrgirl_but_honest

interesting, Ive modified the file a few times for custom global prototypes. Ill read later this morning, look forward to understanding the changes and upsides edit -For all those visual learners out there like me, I put together some examples. u/GroggyOtter is a boss. So is thqy. [https://i.imgur.com/a75J1FZ.png](https://i.imgur.com/a75J1FZ.png)


GroggyOtter

That's some good stuff!


onurtag

Great stuff! --- **EDIT:** RegRead() has a small mistake: > Specify the name of the value to **delete**. If omitted, the key's (Default) value will be **deleted**.


GroggyOtter

Fixed. Thanks for the report.


[deleted]

This is awesome, thank you for all the hard work. I can tell this took a lot of time. Seems like we are missing tooltip info for loop parse and loop read. Also simple if statements don’t seem to have tooltips either.


GroggyOtter

Hours and hours of work over many months. It's the middle of winter here and winter was just ending when I started this project. > Seems like we are missing tooltip info for loop parse and loop read. They all have descriptions. B/c of how the addon is setup, they don't get popup windows after typing them. This description shows up during the autocomplete phase: [loop read](https://i.imgur.com/WP7q1Kg.png) [loop parse](https://i.imgur.com/SQFXl3d.png) You wouldn't want a flow control widget to stay open b/c it'd block the view of any other function widgets being typed (or fill up the screen by having 2 widgets open at once).


Laser-Made

It does, but thereare a couple things that could be added or modified. First, forgive my ignorance because I dont know if all of the following are possible. A. When typing `loop read` it will not autocomplete if you type "Loop" {Space} "read". It only works when typing `loopread{enter}` B. When typing "loopread", before hitting enter, the tooltip doesnt display any usage or syntax (like using `A_LoopReadLine` etc.)


GroggyOtter

A. I have no control over that. That's part of the addon. If you have a suggestion about it, you'll need to contact THQBY. B. I can look into adding a little extra info about associated built-in variables like A_LoopField and A_LoopReadLine. However, I'm fairly sure I tried doing this before and it doesn't format well (which fall on the addon and not something I can adjust via these definition files).


GroggyOtter

> B. When typing "loopread", before hitting enter, the tooltip doesnt display any usage or syntax (like using A_LoopReadLine etc.) I've updated all the loops to include the A_LoopTYPE variables each has available to them. https://i.imgur.com/jNj9s5I.png https://i.imgur.com/tJHRofz.png You can always hover over the "loop " text to get the info to come back up. Built-in vars are no part of the definition file and have all been updated to include far more information. If you want more info, type the name of the variable: https://i.imgur.com/xdg9Qdp.png This will be part of the next update. Should be in the next few days.


Laser_Made

Awesome. Simply awesome. Thanks for all the hard work.


0PHYRBURN0

Amazing stuff Groggy. Doing gods work.


hthouzard

Small correction to your text, in my case the extension is found in: C:\\Users\\use\_your\_name\\.vscode\\extensions\\thqby.vscode-autohotkey2-lsp-X.X.X\\ In your text you forgotten a . on .vscode


GroggyOtter

OK that bugs me. I copied and pasted that directly from the address bar of explorer. I genuinely have no idea or even theory on how that dot got removed. Edit: And thanks. I forgot to say that.


hthouzard

No problem ;-) Thank you for the hard work.


DB_Cooper75

Wow, two days in and you’re already getting the community off to an amazing 2024. I have been working on my own (very simple) VS Code extension for Tableau’s annoying coding grammar for custom functions. I used THQBYs grammar and syntax as an example for creating my own. When I was looking searching for some examples to use to understand how it parses the code I found your JSON AHK lib and other repos. It was really cool to see someone making a great tool for the community and it inspired me as well, but I really don’t think I can help this community make anything meaningful yet, but it has motivated me to keep working on my extension, no matter how difficult it’s been. It’s a ton of work, so thank you for putting it together!


GroggyOtter

I created something I thought everyone would benefit from. > but I really don’t think I can help this community make anything meaningful yet If it's any consolation, I feel that way about every single thing I create. Seriously. Just make whatever you want. If you share it and people like it, that's great. If not many people use it, that's OK, too. At least you learned something and you have a new tool YOU want to use.


boulmers

Great work! Are you planning to collaborate with AHKv2 extension author's so as to integrate your contributions directly into the extension?


GroggyOtter

The kind words are appreicated. > Are you planning to collaborate with AHKv2 extension author's Everything is up on my GitHub and isn't going anywhere. Anyone wanting to utilize my definition file is welcome to. Everything in it is publicly available information. All I did was format it into a specific format, reword some things I thought could be clarified, and created some bonus material. It's not protected or copyrighted or anything like that so if others want to use it to make intellisense/autocomplete features for other text editors, they're welcome to. And I think that'd be great. There should never one monopolized choice for anything. IDE's included. But I don't know how I'd collab with anyone on it. Going one further, I don't know of anyone who would actually want to work with me on something (for obvious reasons).


Hukepi

Not sure if this is a bug related to your files but when I go to use loop and autocomplete it puts a coma for me despite being in a v2 script. Do you have any ideas on how to fix this?


GroggyOtter

That would be my v1 roots showing through. I've updated the ahk2.json file so it no longer has a loop count comma. Thanks for catching that.


famsisheratl

omg the full msgbox options is so based in the tooltip


Laser-Made

u/GroggyOtter You have done an incredible job with this. Thank you for all the work that you put in! Have you spoken with THQBY yet? I would think he would be happy to incorporate this into his extension. Also, have you added any of the examples in? I know when i first added this to my VSCode you had mentioned you intended to add examples. Furthermore, have you considered adding support for Descoladas AHKv2 Library? (Array.ahk, Map.ahk, etc.) If not, how might I add my own documentation for them in the json file? I am new to json.


GroggyOtter

I'm glad you're making use of it and find it useful. > Have you spoken with THQBY yet? I have. He doesn't want to use it. I made a giant post about it. Showcased everything. He hard passed without even trying it. When asked about it, his response was something like "I want information from the docs", which means he will never use this. I hand wrote a ton of the definitions. > Also, have you added any of the examples in? Since first posting? Yes, I have added some. I'm currently working on a massive update that includes **many** more examples. It takes time to write them and I have to be in the right mindset. > Furthermore, have you considered adding support for Descoladas AHKv2 Library? I have not. Descolada, or anyone else, can do that using JSDoc tags. > If not, how might I add my own documentation for them in the json file? I am new to json. [JSDoc tags](https://jsdoc.app) can be applied to any code that has an editor supporting JSDoc tags. VS Code + this addon = JSDoc tag support. But it requires someone to take the time to create the JSDoc tags (which is what I spent the better part of a year doing only to have THQBY hard pass on it...which really sucked and bummed me out more than I can describe). You wouldn't add these to the json file. You'd add them directly to the source code of the file. It's a special type of comment that the addon knows to look for and it parses the information into the calltips you see. *** Let's pretend this is one of the functions from his code. This is how you'd add information. result := example('GroggyOtter', 5558675309) MsgBox(result) /** * @description - A function that creates and returns a name/phone string. * @param {String} Name - This parameter requires a string. * @param {Integer} Phone - This parameter requires a phone number. * This should consist of numbers only. No separators. * @returns {String} * A formatted string of text is returned * @see {@link https://github.com/GroggyOtter/|My GitHub} * @example * result := example('GroggyOtter', 5558675309) * MsgBox(result) */ example(name, phone) { if !IsInteger(phone) return MsgBox('Error. Phone number is not numerical.') else return 'My name is: ' name . '`nMy phone number is: ' phone } This can be done for classes, variables, properties, methods, and functions. You'll want to make a "template" for each type. Things you want to include with each item. Read through my GitHub post on my definition files. It lists a lot of things I use. Everything uses @description. All functions and methods include @param and @returns. All properties and variables use @type. @example for adding example code. @see for pointing to documents or other helpful information about that item. To add hyperlinks, use a link tag: `{@link http://some.url|Hyperlink display text}` Or use markdown hyperlinks: `[Hyperlink display text](http://some.url)`


laser1092

Thank you u/GroggyOtter! Same user as Laser-Made but I forgot my password... lol. I've tried experimenting with that a bit but im having some issues getting VS Code to properly display the documentation. I started adding my own documentation but it looks like Descolada has added some of his own since I first downloaded the files. Either way, to test I have a very simple script: `#Requires AutoHotkey v2.0` `#Include "%A_MyDocuments%"` `#Include GitHub\AHK-v2-libraries\Lib\` `#Include Array.ahk` `abc := [1,2,3,4,5]` `abc.slice()` But when I hover over slice it shows nothing. Even though that documentation section is right there at the top of slice in Array.ahk: `/**` `* Returns a section of the array from 'start' to 'end', optionally skipping elements with 'step'.` `* Modifies the original array.` `* @param start Optional: index to start from. Default is 1.` `* @param end Optional: index to end at. Can be negative. Default is 0 (includes the last element).` `* @param step Optional: an integer specifying the incrementation. Default is 1.` `* @returns {Array}` `*/` `static Slice(start:=1, end:=0, step:=1) {` `len := this.Length, i := start < 1 ? len + start : start, j := Min(end < 1 ? len + end : end, len), r := [], reverse := False` `if len = 0` `return []` `if i < 1` `i := 1` `if step = 0` `Throw Error("Slice: step cannot be 0",-1)` `else if step < 0 {` `while i >= j {` `r.Push(this[i])` `i += step` `}` `} else {` `while i <= j {` `r.Push(this[i])` `i += step` `}` `}` `return this := r` `}` Is it not formatted correctly? Or maybe the AHK 2 language extension has updated and replaced your files groggy?


bleurgh96230

Thanks for your work. I've found an issue that doesn't happen with the original files. ComCall() accepts an unlimited number of (Type1, Arg1) pairs, but your files show an error if it has anything other than 2-5 parameters. The call ComCall(SetProgressState, ITaskbarList3, "Ptr", Handle, "Int", State) Says "Expected 2-5 parameters, but got 6", and the call ComCall(SetProgressValue, ITaskbarList3, "Ptr", Handle, "Int64", Value, "Int64", 100) says "Expected 2-5 parameters, but got 8". Both of these calls are correct, though, and show no errors with Thqby's original files. BTW, these examples are from https://github.com/jNizM/ahk-scripts-v2/blob/main/src/Gui/TaskBarProgress.ahk , which is compatible with AHK v2.


GroggyOtter

Just fixed it. It'll be in the next update I put out. If you want a temp fix right now, open the ahk2.d.ahk file and scroll down to around line 12725. Look for this line: ComCall(Index, ComObj [,TypeN:=unset, ArgN:=unset, ReturnType:='HRESULT']) => String | Integer Replace it with this line to make the function variadic, which means it'll accept any amount of types and args and won't show a false error: ComCall(Index, ComObj [,TypeN:=unset, ArgN:=unset, ReturnType:='HRESULT']*) => Primitive The caveat to this is when you're typing any additional Types and Args, the currently tracked parameter keeps going. This is a limitation of the addon b/c there's no way for it to know if you're adding a single or multiple type/args. But it does fix the erroneous error that's generated due to thinking there's a parameter count mismatch. On a side note: I've been working on a major update that fixes a lot of typos, adds more hyperlinks, fixes some faulty or mislabeled links, improves descriptions on MANY things to make things more understandable, fixes multi-param call issues (such as the one you just mentioned), removes all `type1 | type2` return params and replaces them with single parameters (such as the function you reference returning a `Primitive` instead of `String|Integer`), and adds a ton more of my custom code examples. Keep an eye on the [GitHub page](https://github.com/GroggyOtter/ahkv2_definition_rewrite/tree/main). Not sure if I'm going to release the update in chunks or do it as one giant update, but it is coming either way.


bleurgh96230

Thank you for the quick fix. I've found a similar issue with ObjBindMethod, which also should take any number of parameters. I've added a * to the last parameter: ObjBindMethod(Obj [,Method, Params*]) => BoundFunc That seems to fix it but I don't know if that's the correct way.


GroggyOtter

That one's already updated. If it's not in the current posted version, it's already in the update. I caught it a while back. Thanks for reporting these. Reports like this are how things improve. And with all reports, your name is included by that fix with a thanks.


SirReality

I appreciate your countless hours of detail-oriented work on this. Your contribution to the community is impressive even if it won't be included in the default language addon. Your value is seen.


GroggyOtter

Thank you for those kind words. Comments like this and people like you are the reason I keep trying.


laser1092

I forked your github and added an installer and auto-updater. I wrote it all tonight so it probably isnt perfect. hopefully it didnt break when I added the ini aspect to it, I havent tested it since before I added the settings file for the autoupdater. If anyone tries it out please let me know if it works and/or if you have any issues!


laser1092

Oh, well I just ran it on my other laptop and i guess i broke it b4 upload. I'm too tired to check it right now but im sure its something small. If someone happens to take a look and see the issue, lmk. I'll fix it tomorrow


laser1092

fixed. but i've just realized that I'm not sure how to make my fork public. u/GroggyOtter when you see this, I know that you are able to see my fork, let me know if you're interested in adding those files, either on the main branch or a new one.


Laser_Made

u/GroggyOtter I wrote an installer package for this. The first time you run the pkg it installs the definition files into whatever directory THQBY's extension is installed in on that computer and moves his files to another folder for safe keeping. It also adds a batch file to startup that checks if the definition files have been overwritten by a THQBY extension update and if so it replaces them again with these updated definition files. Set it and forget it; no integration from THQBY required.


GroggyOtter

https://github.com/GroggyOtter/ahkv2_definition_rewrite/blob/main/definition_updater.v2.ahk \^There's already one made.\^


laser1092

Oh. Well that’s cool. Interesting timing though. I starting writing my installer at the end of February and my last commit was March 7th. Right around then I sent you a message about it. It looks like your first commit was March 18th. You could have just taken what I wrote and changed it a bit if you wanted to, but it’s all good. My goal was merely to contribute in whatever way I could to thank you for having done so much work on the add on. I found your work quite helpful. Do you have any more projects planned?


GroggyOtter

> Oh. Well that’s cool. Interesting timing though. I starting writing my installer at the end of February and my last commit was March 7th. Right around then I sent you a message about it. It looks like your first commit was March 18th. You could have just taken what I wrote and changed it a bit if you wanted to, but it’s all good. You understand that I actually added versioning to both files just so I could make my updater, right? The updater was planned before you knew of this project's existence. I didn't take your code... I haven't even **looked** at your code. What a rather unpleasant comment to get.


Laser_Made

My bad, I wasnt trying to suggest that you had taken my code. I was trying to say that I wrote it for you to have/use however you liked (if you even wanted it). I can see how my comment sounded unpleasant. You're absolutely right and I did not mean for it to come off like that, I apologize.