-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Typst #6379
Add Typst #6379
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See inline comments.
The .typ
extension is used by other languages but Linguist doesn't know this. Accordingly, at least one other language needs to get .typ
associated with it so this PR doesn't cause all users to be identified as "typst".
As XML seems to be a common user, I recommend adding the extension and a sample to XML in this PR too.
That said, the .typ
extension as returned by your search and heuristic is not popular enough for inclusion yet.
I'll remove
I think you mistyped, you meant that So if I don't add another language, the heuristic is just ignored and it will always match to typst? |
Where should I add the XML |
Nope. I meant
Yup because the extension strategy is used before heuristics and the extension will only match one language so things won't go beyond that strategy:
XML. You'll need to add the extension to the XML language entry too. |
This is happening because of the layout of the repo. Linguist expects repos to be actual grammar repos as used by the relevant editors and as such will only look in certain locations for the grammar files as the editors do: As this is a json formatted grammar, it needs to be in a directory called You're need to either find another grammar, restructure the layout of the grammar repo, or split the grammar out into its own repo. |
So the original grammar from https://github.com/nvarner/typst-lsp had the following errors:
I now made a fork (https://github.com/michidk/typst-grammar) that has the required structure and fixes the issues. The script runs and completes now without errors:
|
@lildude Is there some concrete way to measure the popularity of this language as defined by linguist? Is there a concrete number we can see somewhere? You mentioned that GitHub search cannot be used, since it does not count unique repositories using a file type. Then how is this measured? Or is this just guestimated from the search results? |
There isn't a concrete number to look at. The popularity is currently approximated from the search results. See #5756 |
@lildude Can you please execute the workflow? |
Sure, but it's with stating this won't be merged until usage has met the required levels. If you want to see how CI is behaving in the interim, run the tests locally. |
@lildude The search now shows 2k files. |
Add the Typst language, fixes #6358.
Checklist:
#239DAD
<meta name="theme-color" content="#239dad">
Notes
As I executed the add-grammar script I got the following error: