lean4-htt/tests/lean/interactive/goTo.lean
2022-05-30 11:16:25 +02:00

62 lines
1.2 KiB
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Lean.Elab
structure Bar where
structure Foo where
foo₁ : Nat
foo₂ : Nat
bar : Bar
def mkFoo₁ : Foo := {
--v textDocument/definition
foo₁ := 1
--^ textDocument/definition
--v textDocument/declaration
foo₂ := 2
--v textDocument/typeDefinition
bar := ⟨⟩
}
--v textDocument/definition
#check (Bar)
structure HandWrittenStruct where
n : Nat
-- def HandWrittenStruct.n := fun | mk n => n
--v textDocument/definition
def hws : HandWrittenStruct := {
--v textDocument/definition
n := 3
}
--v textDocument/declaration
def mkFoo₂ := mkFoo₁
syntax (name := elabTest) "test" : term
@[termElab elabTest] def elabElabTest : Lean.Elab.Term.TermElab := fun _ _ => do
let stx ← `(2)
Lean.Elab.Term.elabTerm stx none
--v textDocument/declaration
#check test
--^ textDocument/definition
def Baz (α : Type) := α
#check fun (b : Baz Nat) => b
--^ textDocument/typeDefinition
example : Nat :=
let a := 1
--v textDocument/definition
a + b
--^ textDocument/definition
where
b := 2
macro_rules | `(test) => `(3)
#check test
--^ textDocument/definition