Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.

Adding Autohotkey formatter #13

Open
mstenemo opened this issue Apr 14, 2018 · 3 comments
Open

Adding Autohotkey formatter #13

mstenemo opened this issue Apr 14, 2018 · 3 comments

Comments

@mstenemo
Copy link

When I try to auto indent my .ahk files, I get "There is no formatter for 'ahk'-files installed." IF it does not exist, is there a plan to implement one? How would I go about creating it?

@denolfe
Copy link
Contributor

denolfe commented Apr 15, 2018

From looking at other languages' formatters, it seems like quite an undertaking. However here is an official blog post about implementing a formatter.

Just for completeness, I've also used this formatter script written in AutoHotkey, which formats the code from your clipboard.

@mstenemo
Copy link
Author

mstenemo commented Apr 15, 2018

Looking at the formatters found at the marketplace for other language formaters it does indeed look like more work than I anticipated. Would it be possible to get create a fork of a working formater, e.g. Prettier - Code formatter, and adjust it to achieve basic formating, or would it be better to start from scratch?

@denolfe
Copy link
Contributor

denolfe commented Apr 19, 2018

I've clicked through a few of them, and it looks like most of them just pull in a formatting executable to do the work for them.

To get this functionality, I see 3 options:

  • Find a formatter that does all of the modifications via regex and modify that
  • Leverage an existing formatting script for Ahk and then copy and modify code from one of the formatters that use an executable
  • If you don't need it to be in this extension, take a look into one of the "Run on Save" packages that let you run tasks on save. Rig the formatter script to execute on your current file via a task on save. A little clunky but could work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants