lean4-htt/tests/lean/interactive/unknownIdentifierCodeActions.lean
Sebastian Ullrich de388a7e6d
feat: unknown identifier code action and the module system (#11164)
This PR ensures that the code action provided on unknown identifiers
correctly inserts `public` and/or `meta` in `module`s
2025-12-12 21:19:34 +00:00

64 lines
1.8 KiB
Text

module
--^ waitForILeans
public section
#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
def pubNonExposed : Lean.Server.Test.Refs.Test1
--^ codeAction
:= Lean.Server.Test.Refs.Test1
--^ codeAction
public meta def pubMeta : Lean.Server.Test.Refs.Test1
--^ codeAction
:= Lean.Server.Test.Refs.Test1
--^ codeAction