eclipse / eclipse-collections

Eclipse Collections is a collections framework for Java with optimized data structures and a rich, functional and fluent API.
http://www.eclipse.org/collections
2.39k stars 593 forks source link

Set *.stg to linguist-linguist=StringTemplate in .gitattributes. #1608

Closed motlin closed 1 month ago

motlin commented 1 month ago

This project's StringTemplate files are rendering in GitHub as plain text. Looking in the Linguist supported languages, I see that StringTemplate is present but is set to match *.st files and not *.stg files. Following the GitHub docs I set *.stg to linguist-linguist=StringTemplate in .gitattributes.

Before:

Screenshot 2024-05-28 at 9 57 24 AM

After:

Screenshot 2024-05-28 at 10 01 37 AM
motlin commented 1 month ago

We can click around and see the syntax highlighting with links like this one: https://github.com/motlin/eclipse-collections/blob/gitattributes-StringTemplate/eclipse-collections-code-generator/src/main/resources/primitiveLiteral.stg.

I wanted to put up the PR but I'm no longer sure this is the correct thing to do. I think ST and STG may be two slightly different syntaxes.

donraab commented 1 month ago

@motlin Feel free to merge this one after you rebase. We can ignore the failing Early Access build.