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

Incorrect highlighting if deprecation message contains ] character #515

Open
3 tasks done
TwoFX opened this issue Aug 7, 2024 · 1 comment
Open
3 tasks done

Incorrect highlighting if deprecation message contains ] character #515

TwoFX opened this issue Aug 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@TwoFX
Copy link
Member

TwoFX commented Aug 7, 2024

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

The following code produces incorrect highlighting in VS Code in recent (post-#3968) Lean releases:

@[deprecated Array.get? "Use a[i]? or a.get? i instead"]
def Array.atIndex? (a : Array α) (i : Nat) : Option α :=
  a.get? i

image

The web editor at live.lean-lang.org seems to be unaffected by this issue.

An interesting variant of this is

@[deprecated Array.get? "Use `a[i]?` or `a.get? i` instead", inherit_doc Array.get?]

where the highlighting is only broken until the end of the attribute.

Steps to Reproduce

  1. Create a new Lean project on a recent nightly and paste in the above code

Expected behavior: Highlighting should work as usual

Actual behavior: Highlighting gets confused by the ] character in the deprecation message.

Versions

4.11.0-nightly-2024-08-05
Linux markus-z16 6.9.12-200.fc40.x86_64 leanprover/lean4#1 SMP PREEMPT_DYNAMIC Sat Jul 27 15:56:15 UTC 2024 x86_64 GNU/Linux
vscode-lean4 v.0.0.176 in VS Code 1.92.0

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

@TwoFX TwoFX added the bug Something isn't working label Aug 7, 2024
@eric-wieser
Copy link
Contributor

I think this was fixed already in lean3, in leanprover/vscode-lean#265

@Kha Kha transferred this issue from leanprover/lean4 Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants