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

Lean highlight does not support -- line comment #74

Open
cireu opened this issue Jul 22, 2024 · 2 comments
Open

Lean highlight does not support -- line comment #74

cireu opened this issue Jul 22, 2024 · 2 comments

Comments

@cireu
Copy link

cireu commented Jul 22, 2024

I test the Lean 4 in Shiki at https://shiki.matsu.io/

And I found Shiki cannot render the -- comment of Lean correctly.

图片

(See the different between /- test -/ and -- comment).

@cireu
Copy link
Author

cireu commented Jul 22, 2024

structure Point (α : Type u) where
  mk :: (x : α) (y : α)
  deriving Repr

/- test -/
#check Point       -- a Type
#check @Point.rec  -- the eliminator
#check @Point.mk   -- the constructor
#check @Point.x    -- a projection
#check @Point.y    -- a projection

#eval Point.x (Point.mk 10 20)
#eval Point.y (Point.mk 10 20)

图片

It seems that Github can render this correct.

@slevithan
Copy link

textmate-grammars-themes (and by extension Shiki) gets the lean grammar from upstream here: https://github.com/leanprover/vscode-lean4/blob/master/vscode-lean4/syntaxes/lean4.json

I don't know if GitHub is using the same grammar file.

Does this work correctly if using the upstream grammar directly (rather than the cleaned up version from textmate-grammars-themes)?

  • If yes, it could indeed be a problem with textmate-grammars-themes.
  • But if not, the issue needs to be filed and fixed in the upstream grammar.
    • After a fix is committed there it will automatically be picked up here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants