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

Add Luau file type support #33767

Open
NeonD00m opened this issue Mar 2, 2025 · 3 comments
Open

Add Luau file type support #33767

NeonD00m opened this issue Mar 2, 2025 · 3 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first. type/upstream This is an issue in one of Gitea's dependencies and should be reported there

Comments

@NeonD00m
Copy link

NeonD00m commented Mar 2, 2025

Feature Description

Github supports Luau. github-linguist/linguist#6000

Screenshots

No response

@NeonD00m NeonD00m added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Mar 2, 2025
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 2, 2025

  • Luau "linguist" is detected by github.com/go-enry/go-enry/v2, it seems that it already supports "luau"

    • go-enry luau
  • Highlighting is powered by github.com/alecthomas/chroma/v2 , you could also use this approach: update the [highlight.mapping] section in your "app.ini", use Lua hightlighting

@wxiaoguang wxiaoguang added the type/upstream This is an issue in one of Gitea's dependencies and should be reported there label Mar 2, 2025
@silverwind
Copy link
Member

silverwind commented Mar 2, 2025

Is syntax the same as lua? If yes, just PR the file extension into chroma and it will automatically work in gitea:

https://github.com/alecthomas/chroma/blob/4b0882a15f49a23c272b79b5af541bf918b98998/lexers/embedded/lua.xml#L5-L6

Edit: According to this Linguist treats it as an alias to lua, so above is a good start:

https://github.com/github-linguist/linguist/pull/6612/files#diff-9c337ec09ccaaa1374713aad9ba26cdc1308586a27cb309a883a0b19bde663d8R3937-R3938

@silverwind
Copy link
Member

alecthomas/chroma#1056

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first. type/upstream This is an issue in one of Gitea's dependencies and should be reported there
Projects
None yet
Development

No branches or pull requests

3 participants