Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v2] Add formatting support #381

Closed
mark-wiemer opened this issue Aug 8, 2023 · 4 comments
Closed

[v2] Add formatting support #381

mark-wiemer opened this issue Aug 8, 2023 · 4 comments
Assignees
Labels
AHK v2 exclusive to AHK v2 formatter code formatter issues

Comments

@mark-wiemer
Copy link
Member

mark-wiemer commented Aug 8, 2023

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 mark-wiemer added the AHK v2 exclusive to AHK v2 label Aug 8, 2023
@mark-wiemer mark-wiemer self-assigned this Aug 8, 2023
@mark-wiemer mark-wiemer added the formatter code formatter issues label Aug 8, 2023
@mark-wiemer mark-wiemer added this to AHK++ Aug 8, 2023
@mark-wiemer
Copy link
Member Author

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 mark-wiemer changed the title [v2] Make formatting support non-experimental [v2] Add formatting support Aug 8, 2023
@mark-wiemer mark-wiemer moved this to Todo in AHK++ Aug 8, 2023
@mark-wiemer mark-wiemer pinned this issue Aug 8, 2023
This was referenced Aug 8, 2023
@mark-wiemer
Copy link
Member Author

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
Copy link
Member Author

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.

ahkpp/src/extension.ts

Lines 54 to 57 in 70bab81

vscode.languages.registerDocumentFormattingEditProvider(
language,
new FormatProvider(),
),

@mark-wiemer
Copy link
Member Author

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 thqby/vscode-autohotkey2-lsp#531

@mark-wiemer mark-wiemer moved this from In Progress to Todo in AHK++ Aug 10, 2024
@mark-wiemer mark-wiemer unpinned this issue Aug 17, 2024
@mark-wiemer mark-wiemer moved this from Todo to In Progress in AHK++ Aug 18, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in AHK++ Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AHK v2 exclusive to AHK v2 formatter code formatter issues
Projects
Status: Done
Development

No branches or pull requests

1 participant