github-linguist / linguist

Language Savant. If your repository's language is being reported incorrectly, send us a pull request!
MIT License
12.36k stars 4.29k forks source link

Improve Game Maker Language file detection for those generated by GM Studio 2.3 #6517

Closed lildude closed 3 months ago

lildude commented 1 year ago

Describe the enhancement

The logic currently used for matching Game Maker Language studio .yy and .yyp files don't match the newer format used by Game Maker Studio 2.3 and aren't hiding them or marking them as JSON:

Detecting as generated:

https://github.com/github-linguist/linguist/blob/916bd8f3df802fa98b0ea85539e67bd0b88ef158/lib/linguist/generated.rb#L672-L683

Detecting them as JSON:

https://github.com/github-linguist/linguist/blob/916bd8f3df802fa98b0ea85539e67bd0b88ef158/lib/linguist/heuristics.yml#L810-L814

This results in files with this extension being identified as Yacc.

From a naïve perspective (I know nothing about GML), it appears we can fix this by looking out for "resourceType": "GM* in these two locations too.

Until this is implemented, the effect of the above can be acheived by adding the following override to repositories:

*.yy linguist-language=JSON,linguist-generated

/cc @kt-altyn @RobQuistNL

RobQuistNL commented 1 year ago

your assumptions seem to be correct, I've seen that resourceType pointer around everywhere too.

EDIT: It might be that GMStudio 2.3 changed "modelName" to "resourceType", then it might be an easy fix.

pluto13x commented 5 months ago

Hi, I'm having this same issue and I don't quite understand how to fix it. Could you simplify it? This is my repo: https://github.com/pluto13x/Space-Cocktails

pluto13x commented 5 months ago

Hi, I fixed it by adding a .gitattributes file with "*.yy linguist-language=Game Maker Language" in it. Still, here's a reminder that this is still an issue