highlight.js icon indicating copy to clipboard operation
highlight.js copied to clipboard

Overhaul GML highlighting

Open thennothinghappened opened this issue 11 months ago • 7 comments

Changes

I've created a proper grammar for GameMaker Language, which supports many of the language's newer features, and goes a lot further than the existing one - which currently just matches a master list of keywords and function names that must be kept up to date.

The work I've done here is a port of my previous PRs to the GameMaker Manual (https://github.com/YoYoGames/GameMaker-Manual/pull/160, https://github.com/YoYoGames/GameMaker-Manual/pull/220), though since they use a bit of a customised fork, required some extra work to then bring upstream. As this PR encompasses the changes I listed in those PRs above I've avoided re-stating the same changes, though if it would be preferable I can bring them over into this PR's description.

Additional to the PRs however, I've also made some further minor fixes and improvements:

  • JSDoc is now highlighted, in all forms stated in the GameMaker Manual.
  • Multi-line #macros are now parsed properly, though this isn't currently a noticeable change.
  • Many obsolete or incorrect keyword entries have been removed, and some new ones have been added.
  • The gml.css theme has been updated accordingly with the changes with scopes to more correctly follow the GM IDE's colour scheme.

Comparison

As a visual overview of the changes, here's a before and after!

Before

image

After

image

Checklist

  • [x] Updated markup tests.
  • [x] Updated the changelog at CHANGES.md

thennothinghappened avatar Dec 14 '24 03:12 thennothinghappened

This is a huge change and will need a bit of going thru. I'll drop comments.

joshgoebel avatar Dec 14 '24 06:12 joshgoebel

Thanks for the thorough review! I've addressed everything I could, though there's two left unresolved with comments as I was unsure how to proceed with them so leaving for further feedback.

thennothinghappened avatar Dec 15 '24 00:12 thennothinghappened

Hey, just checking in on the status of this PR - is there anything else I need to do to get it merged? I've not modified CHANGES.md as I wasn't sure when it'd be merged and that seemed like a source of issues to edit that file too soon.

thennothinghappened avatar Mar 07 '25 21:03 thennothinghappened

This would be incredible if this could get merged!

tinkerer-red avatar Mar 07 '25 22:03 tinkerer-red

Thanks for the persistence in helping me clean this up, should hopefully be up to snuff at this point!

thennothinghappened avatar Mar 18 '25 00:03 thennothinghappened

I've just gone ahead and finally updated the changelog, though I noted that the next version is a patch release, so let me know if I should revert that commit until later.

thennothinghappened avatar Mar 18 '25 01:03 thennothinghappened

@joshgoebel is there anything else needing to be resolved to merge this?

thennothinghappened avatar May 01 '25 01:05 thennothinghappened

Is there any reason this is awaiting confirmation? If it's for peer review from someone more experienced in GML this seems about as accurate as we can get. Any pending changes from here would be preference of the repo maintainers them selves.

tinkerer-red avatar Jun 30 '25 09:06 tinkerer-red

@joshgoebel apologies for the double-ping now, but I'm still unsure whether you need me to do anything else to merge this. If you've not had the time to look at it, no stress.

thennothinghappened avatar Sep 12 '25 11:09 thennothinghappened