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

Update the syntax of Autohotkey #6772

Open
thqby opened this issue Mar 27, 2024 · 3 comments
Open

Update the syntax of Autohotkey #6772

thqby opened this issue Mar 27, 2024 · 3 comments

Comments

@thqby
Copy link

thqby commented Mar 27, 2024

Describe the enhancement

AutoHotkey v2 has been officially released for more than a year, and it is the main version at present. In this month, v1 has stopped maintenance. AutoHotkey in github still uses the old syntax for language highlighting, so it's time to update it.

URL of syntax highlighting grammar

https://github.com/thqby/vscode-autohotkey2-lsp/blob/main/syntaxes/ahk2.tmLanguage.json

Most popular extensions

https://github.com/thqby/vscode-autohotkey2-lsp

@Banaanae
Copy link

I'm willing to work on this

@Banaanae
Copy link

Banaanae commented Jun 4, 2024

I've look into this a bit more, and aren't too sure what to do.

While AutoHotkey has been released on V2, there are still many scripts using (the now deprecated) AutoHotkey V1. So I'm unsure whether we just update to V2 grammar (meaning deprecated V1 files may lose some highlighting), or if there is a solution to have multiple grammar files based on a RegEx (something like heuristics?)

If that second option isn't possible forcing V2 as the highlighted option would be the way forward?

@lildude
Copy link
Member

lildude commented Jun 4, 2024

We have a 1:1 relationship between languages and grammars.

The best solution is for the grammar to be backwardly compatible with the older version of the language.

The next best is to create a new entry for V2 as a new language, group the two, and use a heuristic (a regex) to differentiate the two. Keep in mind this V2 would be considered a completely new language and will need to meet our usage requirements before inclusion.

Switching out the current grammar for the newer and breaking syntax highlighting for older scripts is going to result in more work for the new grammar maintainers as any issues reported here will simply be redirected to the grammar maintainters to fix. This could in turn result in the "best solution" I previously mentioned 😁

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

No branches or pull requests

3 participants