Skip to content

VS Code F2 renaming goes too far #11403

@ocfnash

Description

@ocfnash

Prerequisites

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

Description

VS Code F2 renaming renames more than it should

Steps to Reproduce

  1. Open the following in VS Code
import Mathlib.Algebra.Lie.Nilpotent

universe u₁ u₂ u₃ u₄

variable {R : Type u₁} {L : Type u₂} {M : Type u₄}
variable [CommRing R] [LieRing L] [LieAlgebra R L]
variable [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]

namespace LieSubmodule

open LieModule

variable {I : LieIdeal R L} {x : L}

theorem exists_smul_add_of_span_sup_eq_top (y : L) : ∃ t : R, ∃ z ∈ I, y = t • x + z := by
  sorry

theorem lie_top_eq_of_span_sup_eq_top (N : LieSubmodule R L M) :
    (↑⁅(⊤ : LieIdeal R L), N⁆ : Submodule R M) =
      (N : Submodule R M).map (toEnd R L M x) ⊔ (↑⁅I, N⁆ : Submodule R M) := by
  sorry

end LieSubmodule
  1. Select the variable R on line 5
  2. Use VS Code F2 feature to rename

Expected behavior: Only the variable R should be renamed.

Actual behavior: The variable R and also the variable y appearing in y = t • x + z is renamed.

Versions

Lean: 4.26.0-rc2
OS: MacOS 15.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions