linguist icon indicating copy to clipboard operation
linguist copied to clipboard

ZS and Z#

Open SuperHero2010 opened this issue 4 months ago • 13 comments

Language name

ZS

URL of example repository

https://github.com/WMZS-Modding/zs-language

URL of syntax highlighting grammar

https://github.com/WMZS-Modding/zs-language

Most popular extensions

.zs: 32.6K files

Detected language

ZenScript, Z# (ZSharp) is the two conflicted extensions with my ZS Language. In linguist repository, ZenScript had already had extenstion is .zs. However, ZS Language had also had extension is .zs, which is making Linguist can't distinguish between "ZenScript" and "ZS".

I have a fork that isn't really complete. What should I do to make Linguist distinguish between the two programming languages ​​correctly?

SuperHero2010 avatar Aug 24 '25 04:08 SuperHero2010

You can find details for adding support for a language in the CONTRIBUTING.md file. Please note we have minimum usage requirements so will not accept PRs for very new and hobby languages.

lildude avatar Aug 24 '25 15:08 lildude

You can find details for adding support for a language in the CONTRIBUTING.md file. Please note we have minimum usage requirements so will not accept PRs for very new and hobby languages.

I've already understood Linguist only accepts languages with a certain level of usage, so my ZS language may not qualify yet.

However, my main concern is about file extension conflicts rather than immediate acceptance. Both ZenScript and my ZS language use .zs. My idea is:

  • If a .zs file has no specific marker, detect it as ZenScript.
  • If a .zs file contains a marker like ! ZS-CSHARP or ! ZS-LUA, detect it as ZS language instead.

Would this kind of rule be possible in Linguist in the future? I’ve already forked the repository, but I’m not ready to open a PR until ZS becomes more widely used.

SuperHero2010 avatar Aug 25 '25 01:08 SuperHero2010

We use heuristics (regular expressions in the heuristics.yml file) to differentiate the languages that have matching extensions.

lildude avatar Aug 25 '25 11:08 lildude

We use heuristics (regular expressions in the heuristics.yml file) to differentiate the languages that have matching extensions.

Your answer really addresses the concern of Linguist being able to differentiate between ZenScript and ZS. However, as mentioned, my language is really new and not really popular yet, so even though I forked your repository, I can't send a Pull Request until ZS meets your minimum usage requirements or is popular.

SuperHero2010 avatar Aug 25 '25 13:08 SuperHero2010

Please keep in mind my "future note": The first Pull Request contains a submodule. However, this submodule doesn't receive the latest updates on my repository side. So in the future, after the first Pull Request is merged, I'll continue to send other Pull Requests on schedule as I'll be constantly updating my repository.

SuperHero2010 avatar Aug 27 '25 11:08 SuperHero2010

So in the future, after the first Pull Request is merged, I'll continue to send other Pull Requests on schedule as I'll be constantly updating my repository.

Please don't. See the second paragraph in My Linguist PR has been merged but GitHub doesn't reflect my changes.

lildude avatar Aug 27 '25 12:08 lildude

So in the future, after the first Pull Request is merged, I'll continue to send other Pull Requests on schedule as I'll be constantly updating my repository.

Please don't. See the second paragraph in My Linguist PR has been merged but GitHub doesn't reflect my changes.

I'm sorry, I was forgotten to read troubleshooting.md, so I had said like:

So in the future, after the first Pull Request is merged, I'll continue to send other Pull Requests on schedule as I'll be constantly updating my repository.

This is my fault, please skip this.

I have a situation: I had resolved the conflict between ZenScript and ZS by editing heuristics.yml. Now I want to add a Z# language to Linguist, but I'm worried that there will be a second conflict between ZenScript, Z# and ZS (because I previously forked to register 2 languages ​​ZenScript and ZS with the same file extension .zs in languages.yml). Should I add this Z# language? If this language isn't popular enough, I won't add it. However, I don't want to abandon Z#. So I want to ask you if I'm allowed to add it to Linguist.

SuperHero2010 avatar Aug 30 '25 01:08 SuperHero2010

Should I add this Z# language?

No. It definitely sounds like a hobby language that is no longer in development so isn't likely to ever meet usage requirements.

lildude avatar Aug 30 '25 10:08 lildude

I have a question: I know I can't use GPL-3.0 License on your Linguist, but my License in ZS Highlight Syntaxes is GPL-3.0. So it's imposible to create a pull request if I write mit in zs-language.dep.yml, is it?

SuperHero2010 avatar Sep 05 '25 13:09 SuperHero2010

So it's imposible to create a pull request if I write mit in zs-language.dep.yml, is it?

That would be rejected because you're misleading the situation. I manually check all grammars to make sure the license matches the source so if the source is GPL, the PR will be rejected.

lildude avatar Sep 05 '25 13:09 lildude

That would be rejected because you're misleading the situation. I manually check all grammars to make sure the license matches the source so if the source is GPL, the PR will be rejected.

Ok. But It's imposible to create 2 Licenses in ZS Highlight Syntaxes (eg., LICENSE-GPL, LICENSE-MIT, LICENSE (for tell to user why I have to create dual-license)), then change LICENSE to LICENSE-MIT in zs-language.dep.yml, is it? If true, should I change LICENSE from GPL-3.0 to MIT?

SuperHero2010 avatar Sep 06 '25 01:09 SuperHero2010

I have a worrying question about ZS language usage: ZenScript has a lot of users and there are tens of thousands of files that overlap with ZS. If I search for usage by typing path:*.zs NOT is:fork, it will show both languages. How can I know only ZS language usage (:user/:repo) (I just want to know although ZS isn't used yet, I just need to know to let me use in the future)?

SuperHero2010 avatar Nov 09 '25 14:11 SuperHero2010

As there are two languages sharing a common extension, we require a heuristic to differentiate the two. As this is just a regex, you can use that regex in GitHub's search to find and prove popularity.

lildude avatar Nov 09 '25 18:11 lildude