lean4-htt/tests/lean/interactive/unknownIdentifierCodeActions.lean
Marc Huisinga 4329eae8d4
fix: unknown identifier minimization (#10797)
This PR fixes a bug in the unknown identifier code actions where the
identifiers wouldn't be correctly minimized in nested namespaces. It
also fixes a bug where identifiers would sometimes be minimized to
`[anonymous]`.

The first bug was introduced in #10619.
2025-10-15 19:25:27 +00:00

50 lines
1.4 KiB
Text

--^ waitForILeans
#check Lean.Server.Test.Refs.test1
--^ codeAction
example : LeanServerTestRefsTest0
--^ codeAction
namespace Lean.Server.Test.Refs
#check Lean.Server.Test.Refs.test1
--^ codeAction
end Lean.Server.Test.Refs
namespace Lean.Server.Test.Refs.Foobar
#check Lean.Server.Test.LeanServerTestRefsTest0'
end Lean.Server.Test.Refs.Foobar
open Lean.Server.Test.Refs.Foobar
#check Lean.Server.Test.Refs.test1
--^ codeAction
#check Lean.Server.Test.Refs.test
--^ codeAction
namespace Lean.Server.Test.Refs.Test1
#check Lean.Server.Test.Refs.Test1
--^ codeAction
end Lean.Server.Test.Refs.Test1
structure Foobar where
veryLongAndHopefullyVeryUniqueBar0 : Nat
namespace Foobar
def veryLongAndHopefullyVeryUniqueFoo0 := 0
def veryLongAndHopefullyVeryUniqueFoobar0 : Foobar := { veryLongAndHopefullyVeryUniqueBar0 := 0 }
end Foobar
open Foobar
#check veryLongAndHopefullyVeryUniqueFoo
--^ codeAction
example (f : Foobar) : Nat := f.veryLongAndHopefullyVeryUniqueBar
--^ codeAction
example : Foobar := .veryLongAndHopefullyVeryUniqueFoobar
--^ codeAction