Tools to reformat existing code

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
john_c
Posts: 493
Joined: 05 May 2017, 13:19

Tools to reformat existing code

14 Jun 2018, 15:42

Are there any tools to consistenly reformat existing AHK code?

I mean, something like ClangFormat. The only such tool for AHK I hear about is Toralf's "Auto-Syntax-Tidy".

However, the links to it's reworked version (by Sergejzr) are not available (I'm not surprised, it was 2015). See the last two posts here:

https://autohotkey.com/board/topic/7169 ... v12/page-6

So, does anybody have the most recent version of this script or probably someone knows another tool for this task?

(Please, note: I'm not asking about something like "quick suggestons" in some editors. I need to reformat existing code, instead of writing new).
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Tools to reformat existing code

14 Jun 2018, 16:23

My converter has some abilities to tidy code, I plan to release a much easier to use version, but it could be some weeks/months. [I.e. it can simply tidy up an AHK v1 script.]
AHK v1 to AHK v2 converter - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 37&t=36754
And I have this for DllCall lines:
DllCall converter/cleaner (e.g. x32 to x64/x32 two-way compatible) - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=31365
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
john_c
Posts: 493
Joined: 05 May 2017, 13:19

Re: Tools to reformat existing code

14 Jun 2018, 18:32

@jeeswg Very interesting, thanks. I also found your post in this thread:

https://autohotkey.com/boards/viewtopic.php?t=1778

As I understand, Toralf's formatter requires some "syntax files" and you found them and fixed them according to modern versions of AHK?

However, when I tried to use them together with Toralf's script it doesn't work.

Is it correct that there is no easy way to make Toralf's script to work?
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Tools to reformat existing code

14 Jun 2018, 18:55

I haven't tested toralf's script. I had hoped that providing the updated versions of the syntax files might help anyone interested to update the script themselves.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: OrangeCat and 286 guests