komorebi
komorebi copied to clipboard
[BUG]: AutoHotkey helper library requires optional arguments
Describe the bug
When using the ahk helper library generated by komorebic ahk-library
you are required pass arguments that are meant to be optional
To Reproduce A quick example of this is:
- Add a line like
ActiveWindowBorderColour(0, 255, 255)
orFocusFollowsMouse("disable")
to your config that includes the helper lib - Reload said config
- You will get an error from autohotkey saying too few arguments passed
Expected behavior
You should be able to only pass the RGB values as the window-kind argument is optional in the command komorebic active-window-border-colour 0 255 255
Screenshots and Videos
The command failing
The same line working with the cli
window-kind
is actually a required argument, it's just that the CLI is able to provide a default value.
All of the AHK library is generated from the type annotations of the CLI, but it is possible to parse clap annotations and I think it could be possible to use this to provide a default argument to an AHK function if AHK supports default argument syntax for function definitions.
I'm not going to work on this issue myself, but I can provide guidance for anyone who would like to to try working on the derive-ahk
proc macro which is a very self-contained part of the codebase.
There won't be any more development on the ahk library generator; users will be encouraged to write their own wrappers going forward.