leanprover / leanprover/lean4

Borrow annotation affects auto-completion

Open
#2,683 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

Prerequisites
  • Put an X between the brackets on this line if you have done all of the following:
    • Check that your issue is not already filed.
    • Reduce the issue to a minimal, self-contained, reproducible test case. Avoid dependencies to mathlib4 or std4.
Description

Adding borrowing annotation to an argument breaks auto-completion of its fields.

Steps to Reproduce
structure A where
  n : Nat

opaque f (a : @& A) (i : Fin a.n) : Nat

Expected behavior: when typing "." after "Fin a" the provided auto-completion choice is as if a had type A: "n".

Actual behavior: the provided auto-completion is: "a", "abbrev", ...

Versions

Lean (version 4.2.0-rc1, commit a62d2fd49796, Release)
Lean (version 4.1.0, commit a832f398b80a, Release)
Linux fedora 6.5.6-200.fc38.x86_64

Additional Information

There is a commit referencing this issue: 3318c75.

Impact

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

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 minimal Lean reproduction in the issue and run it against the listed Lean versions. Trace the auto-completion behavior after Fin a. for the borrowed a; done means the completion includes n, as it would for type A.

Written by the indexing model from the issue text.

Assessment

Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.