komorebi icon indicating copy to clipboard operation
komorebi copied to clipboard

[BUG]: AutoHotkey helper library requires optional arguments

Open ItsPizzaTime1501 opened this issue 2 years ago • 1 comments

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:

  1. Add a line like ActiveWindowBorderColour(0, 255, 255) or FocusFollowsMouse("disable") to your config that includes the helper lib
  2. Reload said config
  3. 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 AutoHotkeyU64_sbGi1BFfP5 The command failing cmd_Zy6YZ4dwXG The same line working with the cli

ItsPizzaTime1501 avatar Sep 03 '22 01:09 ItsPizzaTime1501

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.

LGUG2Z avatar Sep 04 '22 15:09 LGUG2Z

There won't be any more development on the ahk library generator; users will be encouraged to write their own wrappers going forward.

LGUG2Z avatar May 12 '24 18:05 LGUG2Z