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

Consider adding to github/linguist #537

Open
Purpzie opened this issue Mar 14, 2022 · 6 comments
Open

Consider adding to github/linguist #537

Purpzie opened this issue Mar 14, 2022 · 6 comments

Comments

@Purpzie
Copy link

Purpzie commented Mar 14, 2022

I noticed that .rhai files don't have any highlighting on github, and that no issues exist about this yet. Github's highlighting is powered by github/linguist, and they allow people to submit new languages if they're popular enough (used in >200 repos). Unfortunately github's search is pretty broken atm so I'm not sure how many repositories rhai is in.

Until github supports it, throwing this in a repo's .gitattributes will highlight it by pretending it's rust:

*.rhai linguist-language=Rust
@schungx
Copy link
Collaborator

schungx commented Mar 14, 2022

Rhai is a scripting language, so I'm not sure if it is actually used in any repo as a main development language.

However, I'll try the .gitattributes trick.

It might be better to use js in order to get support for interpolated strings...

@Purpzie
Copy link
Author

Purpzie commented Mar 14, 2022

True, but other scripting languages are already highlighted, such as lua.

Also oops yeah almost forgot about interpolated strings. I chose rust because I figured js would freak out without () in if statements.

@schungx
Copy link
Collaborator

schungx commented Mar 14, 2022

Also oops yeah almost forgot about interpolated strings. I chose rust because I figured js would freak out without () in if statements.

It actually does OK with if... I tried JavaScript on my own repo and it seems to work fine!

Rust seems to mainly trip on interpolated strings, switch statements, import and export statements etc.

@Sable-20
Copy link

https://github.com/search?l=&q=a+extension%3Arhai&type=code

dunno if this is what youre looking for but here you go @Purpzie search for repos using rhai

@emesare
Copy link
Member

emesare commented Sep 5, 2022

Now that GitHub support cargo dependencies, there is quite a few codebases that support rhai scripts!
https://github.com/rhaiscript/rhai/network/dependents

@schungx
Copy link
Collaborator

schungx commented Sep 6, 2022

I tried to submit to github/linguist quite a while ago but for some reason which I cannot remember I couldn't.

Maybe somebody can help do that?

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

4 participants