mark-wiemer-org / ahkpp

AHK++ provides AutoHotkey v1 and v2 support for VS Code, Theia IDE, and more
https://marketplace.visualstudio.com/items?itemName=mark-wiemer.vscode-autohotkey-plus-plus
Other
168 stars 10 forks source link

[v2] Add formatting support #381

Closed mark-wiemer closed 1 month ago

mark-wiemer commented 1 year ago

Is your feature request related to a problem? Please describe. Currently, v2 support doesn't have formatting enabled by default. Please enable formatting for AHK v2 scripts.

Describe the solution you'd like When I try to format an AHK v2 script, it works.

Describe alternatives you've considered I have to use another extension to format AHK v2 scripts.

Notes It is not currently possible to configure AHK++ to format AHK v2 scripts even if I want to do so :(

mark-wiemer commented 1 year ago

Note: leaving this out of the initial preview release because thqby's formatter is 6,000+ lines long! I'll consider adding basic support using the existing formatter, but step 1 is actually releasing something, and formatting isn't critical :)

mark-wiemer commented 1 year ago

Formatting and snippets are both underway, I'm working on cleaning up thqby's code.

Then I'll add tests and work to integrate it with the existing project :)

Ref https://github.com/mark-wiemer-org/vscode-autohotkey2-lsp

mark-wiemer commented 4 months ago

Hey folks, terribly sorry for the delay. Let's just say life's been a bit busy. In any case, I am here and this is definitely the next big feature to come. But there is a lot of code to clean up!

If there is great demand, I can open experimental formatting support using the existing v1 formatter for simple scripts, but it'll have plenty of disclaimers explaining that there will likely be bugs and it's not recommended for large scripts.

Ref the following code, we are only assigning a formatting provider for the v1 language, though it'd be trivial to add one for v2.

https://github.com/mark-wiemer-org/ahkpp/blob/70bab8199fb1c87f6da163f35eeff1b9aab73f33/src/extension.ts#L54-L57

mark-wiemer commented 4 months ago

Current plan is to integrate code formatting, linting, and unit tests into thqby's repo, then I can start to integrate that code into my repo as a submodule. That way everyone benefits :) ref https://github.com/thqby/vscode-autohotkey2-lsp/issues/531