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

Update GitHub syntax high-light for Lean 4 #377

Closed
leodemoura opened this issue Apr 2, 2021 · 9 comments
Closed

Update GitHub syntax high-light for Lean 4 #377

leodemoura opened this issue Apr 2, 2021 · 9 comments
Labels
help wanted Extra attention is needed

Comments

@leodemoura
Copy link
Member

@Kha @gebner Do you know where we have to add the new keywords?
I did it once, but I forgot where we should add them.

@gebner
Copy link
Member

gebner commented Apr 2, 2021

The syntax highlighting is taken from the vscode-lean extension:
https://github.com/leanprover/vscode-lean/blob/master/syntaxes/lean.json
See leanprover/vscode-lean#121 for why github switched to it.

We should probably make a new syntax highlighting grammar that works for both Lean 3 and Lean 4, and then have github switch to that.

@leodemoura leodemoura added the help wanted Extra attention is needed label Apr 14, 2021
@eric-wieser
Copy link
Contributor

eric-wieser commented Jun 1, 2021

https://github.com/github/linguist is responsible for the highlighting on github. I think the best way to do this would be:

@eric-wieser
Copy link
Contributor

Although we may run into trouble with:

We try only to add new extensions once they have some usage on GitHub. In most cases we prefer that each new file extension be in use in at least 200 unique :user/:repo repositories before supporting them in Linguist.

ChrisHughes24 pushed a commit to ChrisHughes24/lean4 that referenced this issue Dec 2, 2022
…nprover#377)

It seems that Lean 4's `dsimp` has gotten closer to parity with Lean 3's `dsimp` since this code landed.

Compare to the mathlib3 version of `injective.dite` here:
https://github.com/leanprover-community/mathlib/blob/f089486a9af40d019f9ecf7d86a055eb2801124b/src/logic/function/basic.lean#L114-L126
@eric-wieser
Copy link
Contributor

I did this in github-linguist/linguist#6616

@mhuisi
Copy link
Contributor

mhuisi commented Nov 22, 2023

@eric-wieser Nice! I put this on hold because I wanted to do an improvement pass on the vscode-lean4 textmate grammar first, but wasn't aware that linguist references the repository itself, and so there is no need to improve the grammar before the corresponding linguist PR.

@eric-wieser
Copy link
Contributor

github-linguist/linguist#6616 is now merged!

@kim-em
Copy link
Collaborator

kim-em commented Dec 12, 2023

Does this mean we can close this issue?

@eric-wieser
Copy link
Contributor

The linguist release should be tomorrow; so hopefully we'll see if it worked by the end of the week

@eric-wieser
Copy link
Contributor

https://gist.github.com/eric-wieser/b41f0125324b0ba767da53e6bfdaa357 suggests this is working as intended; now we have the long tail of improving the grammar in places where it looks bad on github (since elsewhere we normally rely on the semantic highlighting anyway)

I think this issue can be closed as completed!

@Kha Kha closed this as completed Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants