leanprover / leanprover/lean4

server sync bug in syntax quotations

Open
#4,750 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug P-medium
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

MWE:

import Lean

elab (ident)? ("Foo") : command => sorry

syntax "Fix " colGt ident : tactic

example (x : Lean.TSyntax `ident) : Lean.MacroM Lean.Syntax :=
  `(tactic| Fix $x:iden)
                    -- ^ insert a 't' here

As written, the example produces three parse errors, on the $, the : and the ). Inserting t to complete the word ident makes the example correct (which can be confirmed by compiling on the command line), but in the server it continues to report errors on the $ and the ). Removing and re-adding :ident makes the error go away, and removing and re-adding ident makes it come back.

Tested on leanprover/lean4:v4.9.0-rc3.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported Lean MWE and compare command-line compilation with the server's diagnostics after completing ident in the syntax quotation. Investigate why removing and re-adding :ident changes the reported errors; done means the server matches command-line behavior and clears the stale parse errors without requiring text edits.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.