Skip to content

Update Lean.sublime-syntax from Lean 3 to Lean 4​​ #3286

Open
@YDX-2147483647

Description

@YDX-2147483647

Syntax: Lean

Guideline Criteria: N/A (already added)

Lean is an interactive theorem prover.
The current syntax was added in #1446 four years ago (2021-03-01, v0.18.0):

Lean.sublime-syntax has been added manually from https://github.com/leanprover/vscode-lean/blob/master/syntaxes/lean.json via conversion.

* `Lean.sublime-syntax` has been added manually from https://github.com/leanprover/vscode-lean/blob/master/syntaxes/lean.json via conversion.

https://github.com/leanprover/vscode-lean was for Lean 3, and the repo was archived a month ago (2025-04-02). It is succeeded by https://github.com/leanprover/vscode-lean4.

Could we update Lean 3 to Lean 4? Is a PR welcome?

Further details

The existing Lean 3 .sublime-syntax also works reasonably well for Lean 4. (I've used it successfully for months through typst.)

There's only one known edge case: f'x', where 'x' is incorrectly parsed as a string.

-- Apostrophes are allowed in variable names
variable (f'x' : ℕ)

-- But somehow, Klingon variables are parsed correctly…
variable (bangwI' jablu'DI' QaQqu' nay' Ghay'cha' he' : ℕ)

Links

Additional info

Directly conversion will raise the following error.

Traceback (most recent call last):
  File "…\sublime_text_build_4200_x64\Lib\python38\sublime_plugin.py", line 1601, in run_
    return self.run()
  File "…\sublime_text_build_4200_x64\Packages\Default.sublime-package\convert_syntax.py", line 433, in run
  File "…\sublime_text_build_4200_x64\Packages\Default.sublime-package\convert_syntax.py", line 358, in convert
  File "…\sublime_text_build_4200_x64\Packages\Default.sublime-package\convert_syntax.py", line 312, in make_context
Exception: no entry in repository for stringBlock

Fixed in leanprover/vscode-lean4#623.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions