chore: update stage0

This commit is contained in:
Sebastian Ullrich 2021-02-06 17:45:02 +01:00
parent 4d8859140c
commit f954cec3df
14 changed files with 10310 additions and 3619 deletions

View file

@ -34,4 +34,11 @@ instance : FromJson WaitForDiagnostics :=
instance : ToJson WaitForDiagnostics :=
⟨fun o => mkObj []⟩
structure PlainGoalParams extends TextDocumentPositionParams
deriving FromJson, ToJson
structure PlainGoal where
rendered : String
deriving FromJson, ToJson
end Lean.Lsp

View file

@ -39,13 +39,20 @@ instance Trace.hasToJson : ToJson Trace :=
| Trace.messages => "messages"
| Trace.verbose => "verbose"⟩
/-- Lean-specific initialization options. -/
structure InitializationOptions where
/-- Time (in milliseconds) which must pass since latest edit until elaboration begins. Lower
values may make editors feel faster at the cost of higher CPU usage. Defaults to 200ms. -/
editDelay? : Option Nat
deriving ToJson, FromJson
structure InitializeParams where
processId? : Option Int := none
clientInfo? : Option ClientInfo := none
/- We don't support the deprecated rootPath
(rootPath? : Option String) -/
rootUri? : Option String := none
initializationOptions? : Option Json := none
initializationOptions? : Option InitializationOptions := none
capabilities : ClientCapabilities
/- If omitted, we default to off. -/
trace : Trace := Trace.off
@ -63,7 +70,7 @@ instance : FromJson InitializeParams := ⟨fun j => do
let processId? := j.getObjValAs? Int "processId"
let clientInfo? := j.getObjValAs? ClientInfo "clientInfo"
let rootUri? := j.getObjValAs? String "rootUri"
let initializationOptions? := j.getObjVal? "initializationOptions"
let initializationOptions? := j.getObjValAs? InitializationOptions "initializationOptions"
let capabilities ← j.getObjValAs? ClientCapabilities "capabilities"
let trace := (j.getObjValAs? Trace "trace").getD Trace.off
let workspaceFolders? := j.getObjValAs? (Array WorkspaceFolder) "workspaceFolders"

View file

@ -137,7 +137,7 @@ def TacticInfo.format (cinfo : ContextInfo) (info : TacticInfo) : IO Format := d
let cinfoA := { cinfo with mctx := info.mctxAfter }
let goalsBefore ← cinfoB.ppGoals info.goalsBefore
let goalsAfter ← cinfoA.ppGoals info.goalsAfter
return f!"Tactic\nbefore {goalsBefore}\nafter {goalsAfter}"
return f!"Tactic @ {formatStxRange cinfo info.stx}\nbefore {goalsBefore}\nafter {goalsAfter}"
def MacroExpansionInfo.format (cinfo : ContextInfo) (info : MacroExpansionInfo) : IO Format := do
let before ← cinfo.ppSyntax info.lctx info.before

View file

@ -58,5 +58,8 @@ instance WaitForDiagnosticsParams.hasFileSource : FileSource WaitForDiagnosticsP
instance DocumentSymbolParams.hasFileSource : FileSource DocumentSymbolParams :=
⟨fun p => fileSource p.textDocument⟩
instance PlainGoalParams.hasFileSource : FileSource PlainGoalParams :=
⟨fun p => fileSource p.textDocument⟩
end Lsp
end Lean

View file

@ -368,7 +368,7 @@ section RequestHandling
Requests need to manually check for whether their task has been cancelled, so that they
can reply with a RequestCancelled error. -/
open Elab in
partial def handleHover (id : RequestID) (p : HoverParams)
partial def handleHover (p : HoverParams)
: ServerM (Task (Except IO.Error (Except RequestError (Option Hover)))) := do
let st ← read
let doc ← st.docRef.get
@ -383,23 +383,14 @@ section RequestHandling
withWaitFindSnap doc (fun s => s.endPos > hoverPos)
(notFoundX := pure none) fun snap => do
for t in snap.toCmdState.infoState.trees do
if let some (ci, i) := t.hoverableTermAt? hoverPos then
let tFmt ← ci.runMetaM i.lctx do
return f!"{← Meta.ppExpr i.expr} : {← Meta.ppExpr (← Meta.inferType i.expr)}"
let mut hoverFmt := f!"```lean
{tFmt}
```"
if let some n := i.expr.constName? then
if let some doc ← ci.runMetaM i.lctx <| findDocString? n then
hoverFmt := f!"{hoverFmt}\n***\n{doc}"
return some <| mkHover (toString hoverFmt) i.pos?.get! i.tailPos?.get!
pure ()
if let some (ci, i) := t.hoverableInfoAt? hoverPos then
if let some hoverFmt ← i.fmtHover? ci then
return some <| mkHover (toString hoverFmt) i.pos?.get! i.tailPos?.get!
return none
open Elab in
partial def handleDefinition (goToType? : Bool) (id : RequestID) (p : TextDocumentPositionParams)
partial def handleDefinition (goToType? : Bool) (p : TextDocumentPositionParams)
: ServerM (Task (Except IO.Error (Except RequestError (Array LocationLink)))) := do
let st ← read
let doc ← st.docRef.get
@ -408,7 +399,7 @@ section RequestHandling
withWaitFindSnap doc (fun s => s.endPos > hoverPos)
(notFoundX := pure #[]) fun snap => do
for t in snap.toCmdState.infoState.trees do
if let some (ci, i) := t.hoverableTermAt? hoverPos then
if let some (ci, Info.ofTermInfo i) := t.hoverableInfoAt? hoverPos then
let expr ← if goToType? then ci.runMetaM i.lctx <| Meta.inferType i.expr else i.expr
if let some n := expr.constName? then
let mod? ← ci.runMetaM i.lctx <| findModuleOf? n
@ -419,13 +410,13 @@ section RequestHandling
| none => pure <| some doc.meta.uri
let ranges? ← ci.runMetaM i.lctx <| findDeclarationRanges? n
if let (some ranges, some modUri) := (ranges?, modUri?) then
let declRangeToLspRange (r : DeclarationRange) : Lsp.Range :=
{ start := ⟨r.pos.line - 1, r.charUtf16⟩
«end» := ⟨r.endPos.line - 1, r.endCharUtf16⟩ }
let ll : LocationLink := {
originSelectionRange? := some ⟨text.utf8PosToLspPos i.pos?.get!, text.utf8PosToLspPos i.tailPos?.get!⟩
originSelectionRange? := some ⟨text.utf8PosToLspPos i.stx.getPos?.get!,
text.utf8PosToLspPos i.stx.getTailPos?.get!⟩
targetUri := modUri
targetRange := declRangeToLspRange ranges.range
targetSelectionRange := declRangeToLspRange ranges.selectionRange
@ -433,11 +424,36 @@ section RequestHandling
return #[ll]
return #[]
open Elab in
partial def handlePlainGoal (p : PlainGoalParams)
: ServerM (Task (Except IO.Error (Except RequestError (Option PlainGoal)))) := do
let st ← read
let doc ← st.docRef.get
let text := doc.meta.text
let hoverPos := text.lspPosToUtf8Pos p.position
withWaitFindSnap doc (fun s => s.endPos > hoverPos)
(notFoundX := return none) fun snap => do
for t in snap.toCmdState.infoState.trees do
if let some (ci, ti) := t.goalsAt? hoverPos then
let ci := { ci with mctx := ti.mctxAfter }
let md ←
if ti.goalsAfter.isEmpty then
"no goals"
else
let goals ← ci.runMetaM {} <| ti.goalsAfter.mapM Meta.ppGoal
let goals := goals.map fun goal => s!"```lean
{goal}
```"
String.intercalate "\n---\n" goals
return some { rendered := md }
return none
def rangeOfSyntax (text : FileMap) (stx : Syntax) : Range :=
⟨text.utf8PosToLspPos <| stx.getPos?.get!,
text.utf8PosToLspPos <| stx.getTailPos?.get!⟩
partial def handleDocumentSymbol (id : RequestID) (p : DocumentSymbolParams) :
partial def handleDocumentSymbol (p : DocumentSymbolParams) :
ServerM (Task (Except IO.Error (Except RequestError DocumentSymbolResult))) := do
let st ← read
asTask do
@ -492,7 +508,7 @@ section RequestHandling
children? := syms.toArray
} :: syms', stxs'')
partial def handleWaitForDiagnostics (id : RequestID) (p : WaitForDiagnosticsParams)
partial def handleWaitForDiagnostics (p : WaitForDiagnosticsParams)
: ServerM (Task (Except IO.Error (Except RequestError WaitForDiagnostics))) := do
let st ← read
let rec waitLoop : IO EditableDocument := do
@ -533,10 +549,10 @@ section MessageHandling
def handleRequest (id : RequestID) (method : String) (params : Json)
: ServerM Unit := do
let handle := fun paramType [FromJson paramType] respType [ToJson respType]
(handler : RequestID → paramType → RequestM respType) => do
(handler : paramType → RequestM respType) => do
let st ← read
let p ← parseParams paramType params
let t ← handler id p
let t ← handler p
let t₁ ← (IO.mapTask · t) fun
| Except.ok (Except.ok resp) =>
st.hOut.writeLspResponse ⟨id, resp⟩
@ -552,6 +568,7 @@ section MessageHandling
| "textDocument/definition" => handle TextDocumentPositionParams (Array LocationLink) <| handleDefinition (goToType? := false)
| "textDocument/typeDefinition" => handle TextDocumentPositionParams (Array LocationLink) <| handleDefinition (goToType? := true)
| "textDocument/documentSymbol" => handle DocumentSymbolParams DocumentSymbolResult handleDocumentSymbol
| "$/lean/plainGoal" => handle PlainGoalParams (Option PlainGoal) handlePlainGoal
| _ => throwServerError s!"Got unsupported request: {method}"
end MessageHandling

View file

@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
Authors: Wojciech Nawrocki
-/
import Lean.DocString
import Lean.Elab.InfoTree
import Lean.Util.Sorry
@ -22,7 +23,7 @@ partial def InfoTree.smallestNode? (p : Info → Bool) : InfoTree → Option Inf
| _ => none
/-- For every branch, find the deepest node in that branch matching `p`
and return all of them. Each result is wrapper in all outer `ContextInfo`s. -/
and return all of them. Each result is wrapped in all outer `ContextInfo`s. -/
partial def InfoTree.smallestNodes (p : Info → Bool) : InfoTree → List InfoTree
| context i t => t.smallestNodes p |>.map (context i)
| n@(node i cs) =>
@ -34,46 +35,105 @@ partial def InfoTree.smallestNodes (p : Info → Bool) : InfoTree → List InfoT
else []
| _ => []
def TermInfo.pos? (i : TermInfo) : Option String.Pos :=
def Info.stx : Info → Syntax
| ofTacticInfo i => i.stx
| ofTermInfo i => i.stx
| ofMacroExpansionInfo i => i.before
| ofFieldInfo i => i.stx
def Info.pos? (i : Info) : Option String.Pos :=
i.stx.getPos? (originalOnly := true)
def TermInfo.tailPos? (i : TermInfo) : Option String.Pos :=
def Info.tailPos? (i : Info) : Option String.Pos :=
i.stx.getTailPos? (originalOnly := true)
def TacticInfo.pos? (i : TacticInfo) : Option String.Pos :=
i.stx.getPos? (originalOnly := true)
def InfoTree.smallestInfo? (p : Info → Bool) (t : InfoTree) : Option (ContextInfo × Info) :=
let ts := t.smallestNodes p
def TacticInfo.tailPos? (i : TacticInfo) : Option String.Pos :=
i.stx.getTailPos? (originalOnly := true)
/-- Find a `TermInfo`, if any, which should be shown on hover/cursor at position `hoverPos`. -/
partial def InfoTree.hoverableTermAt? (t : InfoTree) (hoverPos : String.Pos) : Option (ContextInfo × TermInfo) :=
let ts := t.smallestNodes fun
| Info.ofTermInfo i =>
!i.expr.isSyntheticSorry &&
-- TODO: see if we can get rid of this
#[identKind,
strLitKind,
charLitKind,
numLitKind,
scientificLitKind,
nameLitKind,
fieldIdxKind,
interpolatedStrLitKind,
interpolatedStrKind
].contains i.stx.getKind &&
match i.pos?, i.tailPos? with
| some pos, some tailPos => pos ≤ hoverPos ∧ hoverPos < tailPos
| _, _ => false
| _ => false
let terms : List (Nat × ContextInfo × TermInfo) := ts.filterMap (fun
| context ci (node (Info.ofTermInfo i) _) =>
let infos : List (Nat × ContextInfo × Info) := ts.filterMap fun
| context ci (node i _) =>
let diff := i.tailPos?.get! - i.pos?.get!
some (diff, ci, i)
| _ => none
)
terms.toArray.getMax? (fun a b => a.1 > b.1) |>.map fun (_, ci, i) => (ci, i)
infos.toArray.getMax? (fun a b => a.1 > b.1) |>.map fun (_, ci, i) => (ci, i)
/-- Find an info node, if any, which should be shown on hover/cursor at position `hoverPos`. -/
partial def InfoTree.hoverableInfoAt? (t : InfoTree) (hoverPos : String.Pos) : Option (ContextInfo × Info) :=
t.smallestInfo? fun i =>
if let (some pos, some tailPos) := (i.pos?, i.tailPos?) then
if pos ≤ hoverPos ∧ hoverPos < tailPos then
match i with
| Info.ofTermInfo ti =>
!ti.expr.isSyntheticSorry &&
-- TODO: see if we can get rid of this
#[identKind,
strLitKind,
charLitKind,
numLitKind,
scientificLitKind,
nameLitKind,
fieldIdxKind,
interpolatedStrLitKind,
interpolatedStrKind
].contains i.stx.getKind
| Info.ofFieldInfo _ => true
| _ => false
else false
else false
/-- Construct a hover popup, if any, from an info node in a context.-/
def Info.fmtHover? (ci : ContextInfo) (i : Info) : IO (Option Format) := do
let lctx ← match i with
| Info.ofTermInfo i => i.lctx
| Info.ofFieldInfo i => i.lctx
| _ => return none
ci.runMetaM lctx do
match i with
| Info.ofTermInfo ti =>
let tp ← Meta.inferType ti.expr
let eFmt ← Meta.ppExpr ti.expr
let tpFmt ← Meta.ppExpr tp
let hoverFmt := f!"```lean
{eFmt} : {tpFmt}
```"
if let some n := ti.expr.constName? then
if let some doc ← findDocString? n then
return f!"{hoverFmt}\n***\n{doc}"
return hoverFmt
| Info.ofFieldInfo fi =>
let tp ← Meta.inferType fi.val
let tpFmt ← Meta.ppExpr tp
return f!"```lean
{fi.name} : {tpFmt}
```"
| _ => return none
/-- Return a flattened list of smallest-in-span tactic info nodes, sorted by position. -/
partial def InfoTree.smallestTacticStates (t : InfoTree) : Array (Nat × ContextInfo × TacticInfo) :=
let ts := tacticLeaves t
let ts := ts.filterMap fun
| context ci (node i@(Info.ofTacticInfo ti) _) => some (i.pos?.get!, ci, ti)
| _ => none
ts.toArray.qsort fun a b => a.1 < b.1
where tacticLeaves (t : InfoTree) : List InfoTree :=
t.smallestNodes fun
| i@(Info.ofTacticInfo _) => i.pos?.isSome ∧ i.tailPos?.isSome
| _ => false
partial def InfoTree.goalsAt? (t : InfoTree) (hoverPos : String.Pos) : Option (ContextInfo × TacticInfo) :=
let ts := t.smallestTacticStates
-- The extent of a tactic state is (pos, pos of next tactic)
let extents := ts.mapIdx fun i (p, _, ti) =>
(p, if h : (i.val+1) < ts.size then
ts.get ⟨i.val+1, h⟩ |>.1
else
ti.stx.getTailPos?.get!)
let idx? := extents.findIdx? fun (p, tp) => p ≤ hoverPos ∧ hoverPos < tp
idx?.map fun idx => ts.get! idx |> fun (_, ci, ti) => (ci, ti)
end Lean.Elab

View file

@ -181,10 +181,12 @@ section ServerM
hIn : FS.Stream
hOut : FS.Stream
hLog : FS.Stream
/-- Command line arguments. -/
args : List String
fileWorkersRef : IO.Ref FileWorkerMap
-- We store these to pass them to workers.
/-- We store these to pass them to workers. -/
initParams : InitializeParams
editDelay : Nat
workerPath : String
abbrev ServerM := ReaderT ServerContext IO
@ -385,6 +387,7 @@ section MessageHandling
| "textDocument/definition" => handle DefinitionParams
| "textDocument/typeDefinition" => handle TypeDefinitionParams
| "textDocument/documentSymbol" => handle DocumentSymbolParams
| "$/lean/plainGoal" => handle PlainGoalParams
| _ =>
(←read).hOut.writeLspResponseError
{ id := id
@ -449,8 +452,8 @@ section MainLoop
let p ← parseParams DidChangeTextDocumentParams (toJson params)
let fw ← findFileWorker p.textDocument.uri
let now ← monoMsNow
/- We wait 500ms since last edit before applying the changes. -/
let applyTime := now + 500
/- We wait `editDelay`ms since last edit before applying the changes. -/
let applyTime := now + st.editDelay
let startingGroup? ← fw.groupedEditsRef.modifyGet fun
| some ge => (false, some { ge with applyTime := applyTime
params.textDocument := p.textDocument
@ -538,6 +541,7 @@ def initAndRunWatchdog (args : List String) (i o e : FS.Stream) : IO Unit := do
args := args
fileWorkersRef := fileWorkersRef
initParams := initRequest.param
editDelay := initRequest.param.initializationOptions? |>.bind InitializationOptions.editDelay? |>.getD 200
workerPath := workerPath
: ServerContext
}

View file

@ -14,25 +14,47 @@
extern "C" {
#endif
extern lean_object* l___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_toJsonVersionedTextDocumentIdentifier____x40_Lean_Data_Lsp_Basic___hyg_976____closed__1;
lean_object* l_Lean_Json_getObjValAs_x3f___at___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_fromJsonRange____x40_Lean_Data_Lsp_Basic___hyg_387____spec__1(lean_object*, lean_object*);
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoalParams____x40_Lean_Data_Lsp_Extra___hyg_109_(lean_object*);
lean_object* l_Lean_Json_getObjValAs_x3f___at___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_fromJsonTextDocumentPositionParams____x40_Lean_Data_Lsp_Basic___hyg_1299____spec__1(lean_object*, lean_object*);
lean_object* l_Lean_Lsp_instFromJsonPlainGoal;
lean_object* l_Lean_Lsp_instToJsonPlainGoalParams;
lean_object* l_Lean_Json_getObjValAs_x3f___at___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_fromJsonLocation____x40_Lean_Data_Lsp_Basic___hyg_533____spec__1(lean_object*, lean_object*);
lean_object* l_List_join___rarg(lean_object*);
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190_(lean_object*);
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_toJsonWaitForDiagnosticsParams____x40_Lean_Data_Lsp_Extra___hyg_8_(lean_object*);
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonWaitForDiagnosticsParams____x40_Lean_Data_Lsp_Extra___hyg_42_(lean_object*);
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoalParams____x40_Lean_Data_Lsp_Extra___hyg_109____boxed(lean_object*);
lean_object* l_Lean_Lsp_instToJsonWaitForDiagnosticsParams;
lean_object* l_Lean_Lsp_instFromJsonWaitForDiagnostics(lean_object*);
lean_object* l_Lean_Lsp_instFromJsonPlainGoal___closed__1;
lean_object* l_Lean_Lsp_instToJsonPlainGoalParams___closed__1;
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_toJsonPlainGoalParams____x40_Lean_Data_Lsp_Extra___hyg_153_(lean_object*);
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_toJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_220_(lean_object*);
lean_object* l_Lean_Lsp_instFromJsonWaitForDiagnostics___closed__1;
lean_object* l_Lean_Lsp_instToJsonWaitForDiagnosticsParams___closed__1;
lean_object* l_Lean_Lsp_instFromJsonWaitForDiagnostics___boxed(lean_object*);
lean_object* l_Lean_Lsp_instToJsonWaitForDiagnostics___closed__1;
extern lean_object* l___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_toJsonTextDocumentEdit____x40_Lean_Data_Lsp_Basic___hyg_1053____closed__1;
lean_object* l___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_toJsonTextDocumentIdentifier____x40_Lean_Data_Lsp_Basic___hyg_915_(lean_object*);
extern lean_object* l___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_toJsonLocation____x40_Lean_Data_Lsp_Basic___hyg_499____closed__1;
lean_object* l_Lean_Lsp_instToJsonWaitForDiagnostics(lean_object*);
lean_object* l_Lean_Lsp_instToJsonPlainGoal___closed__1;
lean_object* l_Lean_Lsp_instFromJsonPlainGoalParams___closed__1;
lean_object* l_Lean_JsonNumber_fromNat(lean_object*);
lean_object* l_Lean_Lsp_instToJsonWaitForDiagnostics___boxed(lean_object*);
lean_object* l_Lean_Json_mkObj(lean_object*);
lean_object* l_Lean_Lsp_instFromJsonWaitForDiagnosticsParams___closed__1;
extern lean_object* l___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_toJsonTextDocumentPositionParams____x40_Lean_Data_Lsp_Basic___hyg_1265____closed__1;
lean_object* l_Lean_Lsp_instToJsonPlainGoal;
lean_object* l_Lean_Lsp_instFromJsonWaitForDiagnosticsParams;
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonWaitForDiagnosticsParams____x40_Lean_Data_Lsp_Extra___hyg_42____boxed(lean_object*);
lean_object* l___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_toJsonPosition____x40_Lean_Data_Lsp_Basic___hyg_185_(lean_object*);
lean_object* l_Lean_Lsp_instFromJsonPlainGoalParams;
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190____closed__1;
lean_object* l_Lean_Json_getObjValAs_x3f___at___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_fromJsonPosition____x40_Lean_Data_Lsp_Basic___hyg_219____spec__1(lean_object*, lean_object*);
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190____boxed(lean_object*);
lean_object* l_Lean_Json_getObjValAs_x3f___at_Lean_JsonRpc_instFromJsonMessage___spec__2(lean_object*, lean_object*);
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_toJsonWaitForDiagnosticsParams____x40_Lean_Data_Lsp_Extra___hyg_8_(lean_object* x_1) {
_start:
{
@ -225,6 +247,246 @@ lean_dec(x_1);
return x_2;
}
}
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoalParams____x40_Lean_Data_Lsp_Extra___hyg_109_(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3;
x_2 = l___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_toJsonTextDocumentEdit____x40_Lean_Data_Lsp_Basic___hyg_1053____closed__1;
x_3 = l_Lean_Json_getObjValAs_x3f___at___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_fromJsonTextDocumentPositionParams____x40_Lean_Data_Lsp_Basic___hyg_1299____spec__1(x_1, x_2);
if (lean_obj_tag(x_3) == 0)
{
lean_object* x_4;
x_4 = lean_box(0);
return x_4;
}
else
{
lean_object* x_5; lean_object* x_6; lean_object* x_7;
x_5 = lean_ctor_get(x_3, 0);
lean_inc(x_5);
lean_dec(x_3);
x_6 = l___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_toJsonTextDocumentPositionParams____x40_Lean_Data_Lsp_Basic___hyg_1265____closed__1;
x_7 = l_Lean_Json_getObjValAs_x3f___at___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_fromJsonRange____x40_Lean_Data_Lsp_Basic___hyg_387____spec__1(x_1, x_6);
if (lean_obj_tag(x_7) == 0)
{
lean_object* x_8;
lean_dec(x_5);
x_8 = lean_box(0);
return x_8;
}
else
{
uint8_t x_9;
x_9 = !lean_is_exclusive(x_7);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11;
x_10 = lean_ctor_get(x_7, 0);
x_11 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_11, 0, x_5);
lean_ctor_set(x_11, 1, x_10);
lean_ctor_set(x_7, 0, x_11);
return x_7;
}
else
{
lean_object* x_12; lean_object* x_13; lean_object* x_14;
x_12 = lean_ctor_get(x_7, 0);
lean_inc(x_12);
lean_dec(x_7);
x_13 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_13, 0, x_5);
lean_ctor_set(x_13, 1, x_12);
x_14 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_14, 0, x_13);
return x_14;
}
}
}
}
}
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoalParams____x40_Lean_Data_Lsp_Extra___hyg_109____boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoalParams____x40_Lean_Data_Lsp_Extra___hyg_109_(x_1);
lean_dec(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Lsp_instFromJsonPlainGoalParams___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoalParams____x40_Lean_Data_Lsp_Extra___hyg_109____boxed), 1, 0);
return x_1;
}
}
static lean_object* _init_l_Lean_Lsp_instFromJsonPlainGoalParams() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_Lsp_instFromJsonPlainGoalParams___closed__1;
return x_1;
}
}
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_toJsonPlainGoalParams____x40_Lean_Data_Lsp_Extra___hyg_153_(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16;
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
x_3 = l___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_toJsonTextDocumentIdentifier____x40_Lean_Data_Lsp_Basic___hyg_915_(x_2);
x_4 = l___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_toJsonTextDocumentEdit____x40_Lean_Data_Lsp_Basic___hyg_1053____closed__1;
x_5 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_5, 0, x_4);
lean_ctor_set(x_5, 1, x_3);
x_6 = lean_box(0);
x_7 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_7, 0, x_5);
lean_ctor_set(x_7, 1, x_6);
x_8 = lean_ctor_get(x_1, 1);
lean_inc(x_8);
lean_dec(x_1);
x_9 = l___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_toJsonPosition____x40_Lean_Data_Lsp_Basic___hyg_185_(x_8);
x_10 = l___private_Lean_Data_Lsp_Basic_0__Lean_Lsp_toJsonTextDocumentPositionParams____x40_Lean_Data_Lsp_Basic___hyg_1265____closed__1;
x_11 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_11, 0, x_10);
lean_ctor_set(x_11, 1, x_9);
x_12 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_12, 0, x_11);
lean_ctor_set(x_12, 1, x_6);
x_13 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_13, 0, x_12);
lean_ctor_set(x_13, 1, x_6);
x_14 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_14, 0, x_7);
lean_ctor_set(x_14, 1, x_13);
x_15 = l_List_join___rarg(x_14);
x_16 = l_Lean_Json_mkObj(x_15);
return x_16;
}
}
static lean_object* _init_l_Lean_Lsp_instToJsonPlainGoalParams___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_toJsonPlainGoalParams____x40_Lean_Data_Lsp_Extra___hyg_153_), 1, 0);
return x_1;
}
}
static lean_object* _init_l_Lean_Lsp_instToJsonPlainGoalParams() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_Lsp_instToJsonPlainGoalParams___closed__1;
return x_1;
}
}
static lean_object* _init_l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190____closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("rendered");
return x_1;
}
}
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190_(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3;
x_2 = l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190____closed__1;
x_3 = l_Lean_Json_getObjValAs_x3f___at_Lean_JsonRpc_instFromJsonMessage___spec__2(x_1, x_2);
if (lean_obj_tag(x_3) == 0)
{
lean_object* x_4;
x_4 = lean_box(0);
return x_4;
}
else
{
uint8_t x_5;
x_5 = !lean_is_exclusive(x_3);
if (x_5 == 0)
{
return x_3;
}
else
{
lean_object* x_6; lean_object* x_7;
x_6 = lean_ctor_get(x_3, 0);
lean_inc(x_6);
lean_dec(x_3);
x_7 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_7, 0, x_6);
return x_7;
}
}
}
}
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190____boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190_(x_1);
lean_dec(x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Lsp_instFromJsonPlainGoal___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190____boxed), 1, 0);
return x_1;
}
}
static lean_object* _init_l_Lean_Lsp_instFromJsonPlainGoal() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_Lsp_instFromJsonPlainGoal___closed__1;
return x_1;
}
}
lean_object* l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_toJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_220_(lean_object* x_1) {
_start:
{
lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9;
x_2 = lean_alloc_ctor(3, 1, 0);
lean_ctor_set(x_2, 0, x_1);
x_3 = l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190____closed__1;
x_4 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_4, 0, x_3);
lean_ctor_set(x_4, 1, x_2);
x_5 = lean_box(0);
x_6 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_6, 0, x_4);
lean_ctor_set(x_6, 1, x_5);
x_7 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_7, 0, x_6);
lean_ctor_set(x_7, 1, x_5);
x_8 = l_List_join___rarg(x_7);
x_9 = l_Lean_Json_mkObj(x_8);
return x_9;
}
}
static lean_object* _init_l_Lean_Lsp_instToJsonPlainGoal___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_toJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_220_), 1, 0);
return x_1;
}
}
static lean_object* _init_l_Lean_Lsp_instToJsonPlainGoal() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_Lsp_instToJsonPlainGoal___closed__1;
return x_1;
}
}
lean_object* initialize_Init(lean_object*);
lean_object* initialize_Lean_Data_Json(lean_object*);
lean_object* initialize_Lean_Data_JsonRpc(lean_object*);
@ -258,6 +520,24 @@ l_Lean_Lsp_instFromJsonWaitForDiagnostics___closed__1 = _init_l_Lean_Lsp_instFro
lean_mark_persistent(l_Lean_Lsp_instFromJsonWaitForDiagnostics___closed__1);
l_Lean_Lsp_instToJsonWaitForDiagnostics___closed__1 = _init_l_Lean_Lsp_instToJsonWaitForDiagnostics___closed__1();
lean_mark_persistent(l_Lean_Lsp_instToJsonWaitForDiagnostics___closed__1);
l_Lean_Lsp_instFromJsonPlainGoalParams___closed__1 = _init_l_Lean_Lsp_instFromJsonPlainGoalParams___closed__1();
lean_mark_persistent(l_Lean_Lsp_instFromJsonPlainGoalParams___closed__1);
l_Lean_Lsp_instFromJsonPlainGoalParams = _init_l_Lean_Lsp_instFromJsonPlainGoalParams();
lean_mark_persistent(l_Lean_Lsp_instFromJsonPlainGoalParams);
l_Lean_Lsp_instToJsonPlainGoalParams___closed__1 = _init_l_Lean_Lsp_instToJsonPlainGoalParams___closed__1();
lean_mark_persistent(l_Lean_Lsp_instToJsonPlainGoalParams___closed__1);
l_Lean_Lsp_instToJsonPlainGoalParams = _init_l_Lean_Lsp_instToJsonPlainGoalParams();
lean_mark_persistent(l_Lean_Lsp_instToJsonPlainGoalParams);
l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190____closed__1 = _init_l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190____closed__1();
lean_mark_persistent(l___private_Lean_Data_Lsp_Extra_0__Lean_Lsp_fromJsonPlainGoal____x40_Lean_Data_Lsp_Extra___hyg_190____closed__1);
l_Lean_Lsp_instFromJsonPlainGoal___closed__1 = _init_l_Lean_Lsp_instFromJsonPlainGoal___closed__1();
lean_mark_persistent(l_Lean_Lsp_instFromJsonPlainGoal___closed__1);
l_Lean_Lsp_instFromJsonPlainGoal = _init_l_Lean_Lsp_instFromJsonPlainGoal();
lean_mark_persistent(l_Lean_Lsp_instFromJsonPlainGoal);
l_Lean_Lsp_instToJsonPlainGoal___closed__1 = _init_l_Lean_Lsp_instToJsonPlainGoal___closed__1();
lean_mark_persistent(l_Lean_Lsp_instToJsonPlainGoal___closed__1);
l_Lean_Lsp_instToJsonPlainGoal = _init_l_Lean_Lsp_instToJsonPlainGoal();
lean_mark_persistent(l_Lean_Lsp_instToJsonPlainGoal);
return lean_io_result_mk_ok(lean_box(0));
}
#ifdef __cplusplus

File diff suppressed because it is too large Load diff

View file

@ -121,6 +121,7 @@ lean_object* l_Lean_Elab_withInfoContext_x27___rarg___lambda__2(lean_object*, le
lean_object* l_Lean_Elab_InfoTree_format_match__2___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_array_get(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_withInfoHole___rarg___lambda__1___closed__3;
lean_object* l_Lean_Elab_TacticInfo_format___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_ContextInfo_mctx___default;
lean_object* l_Lean_Elab_withInfoHole___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_InfoTree_substitute___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
@ -136,6 +137,7 @@ lean_object* l_Lean_Elab_TermInfo_format___lambda__1___boxed(lean_object*, lean_
lean_object* l_Lean_Elab_TermInfo_format___lambda__1___closed__1;
lean_object* l_Lean_Elab_TacticInfo_format___closed__1;
size_t l_Lean_Name_hash(lean_object*);
lean_object* l_Lean_Elab_TacticInfo_format___closed__6;
lean_object* l_Nat_repr(lean_object*);
lean_object* l_Lean_Meta_MetaM_run___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Std_PersistentHashMap_insertAux_traverse___at_Lean_Elab_assignInfoHoleId___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -199,6 +201,7 @@ lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_InfoTree_substitute___spec__3
lean_object* l_Lean_Elab_assignInfoHoleId___rarg___lambda__2___closed__2;
lean_object* l_Lean_Syntax_getPos_x3f(lean_object*, uint8_t);
lean_object* l_ReaderT_instMonadReaderT___rarg___lambda__4___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Elab_TacticInfo_format___closed__5;
lean_object* l_Std_PersistentArray_push___rarg(lean_object*, lean_object*);
lean_object* l_Lean_Elab_instInhabitedInfoTree;
lean_object* l_Std_PersistentHashMap_findAtAux___at_Lean_Elab_InfoTree_substitute___spec__8(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -2576,7 +2579,7 @@ static lean_object* _init_l_Lean_Elab_TacticInfo_format___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("Tactic\nbefore ");
x_1 = lean_mk_string("Tactic @ ");
return x_1;
}
}
@ -2594,7 +2597,7 @@ static lean_object* _init_l_Lean_Elab_TacticInfo_format___closed__3() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("\nafter ");
x_1 = lean_mk_string("\nbefore ");
return x_1;
}
}
@ -2608,305 +2611,212 @@ lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
static lean_object* _init_l_Lean_Elab_TacticInfo_format___closed__5() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("\nafter ");
return x_1;
}
}
static lean_object* _init_l_Lean_Elab_TacticInfo_format___closed__6() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_Lean_Elab_TacticInfo_format___closed__5;
x_2 = lean_alloc_ctor(2, 1, 0);
lean_ctor_set(x_2, 0, x_1);
return x_2;
}
}
lean_object* l_Lean_Elab_TacticInfo_format(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
uint8_t x_4;
x_4 = !lean_is_exclusive(x_1);
if (x_4 == 0)
{
lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15;
x_5 = lean_ctor_get(x_1, 0);
x_6 = lean_ctor_get(x_1, 1);
x_7 = lean_ctor_get(x_1, 3);
x_8 = lean_ctor_get(x_1, 4);
x_9 = lean_ctor_get(x_1, 5);
x_10 = lean_ctor_get(x_1, 2);
lean_dec(x_10);
x_11 = lean_ctor_get(x_2, 0);
lean_inc(x_11);
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14;
x_4 = lean_ctor_get(x_1, 0);
x_5 = lean_ctor_get(x_1, 1);
x_6 = lean_ctor_get(x_1, 3);
x_7 = lean_ctor_get(x_1, 4);
x_8 = lean_ctor_get(x_1, 5);
x_9 = lean_ctor_get(x_2, 0);
lean_inc(x_9);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_ctor_set(x_1, 2, x_11);
x_12 = lean_ctor_get(x_2, 3);
lean_inc(x_12);
x_13 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_13, 0, x_5);
lean_ctor_set(x_13, 1, x_6);
lean_ctor_set(x_13, 2, x_12);
lean_ctor_set(x_13, 3, x_7);
lean_ctor_set(x_13, 4, x_8);
lean_ctor_set(x_13, 5, x_9);
x_14 = lean_ctor_get(x_2, 1);
lean_inc(x_14);
x_15 = l_Lean_Elab_ContextInfo_ppGoals(x_1, x_14, x_3);
lean_dec(x_1);
if (lean_obj_tag(x_15) == 0)
lean_inc(x_4);
x_10 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_10, 0, x_4);
lean_ctor_set(x_10, 1, x_5);
lean_ctor_set(x_10, 2, x_9);
lean_ctor_set(x_10, 3, x_6);
lean_ctor_set(x_10, 4, x_7);
lean_ctor_set(x_10, 5, x_8);
x_11 = lean_ctor_get(x_2, 3);
lean_inc(x_11);
lean_inc(x_8);
lean_inc(x_7);
lean_inc(x_6);
lean_inc(x_5);
lean_inc(x_4);
x_12 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_12, 0, x_4);
lean_ctor_set(x_12, 1, x_5);
lean_ctor_set(x_12, 2, x_11);
lean_ctor_set(x_12, 3, x_6);
lean_ctor_set(x_12, 4, x_7);
lean_ctor_set(x_12, 5, x_8);
x_13 = lean_ctor_get(x_2, 1);
lean_inc(x_13);
x_14 = l_Lean_Elab_ContextInfo_ppGoals(x_10, x_13, x_3);
lean_dec(x_10);
if (lean_obj_tag(x_14) == 0)
{
lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19;
x_16 = lean_ctor_get(x_15, 0);
lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18;
x_15 = lean_ctor_get(x_14, 0);
lean_inc(x_15);
x_16 = lean_ctor_get(x_14, 1);
lean_inc(x_16);
x_17 = lean_ctor_get(x_15, 1);
lean_dec(x_14);
x_17 = lean_ctor_get(x_2, 4);
lean_inc(x_17);
lean_dec(x_15);
x_18 = lean_ctor_get(x_2, 4);
lean_inc(x_18);
x_18 = l_Lean_Elab_ContextInfo_ppGoals(x_12, x_17, x_16);
lean_dec(x_12);
if (lean_obj_tag(x_18) == 0)
{
uint8_t x_19;
x_19 = !lean_is_exclusive(x_18);
if (x_19 == 0)
{
lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32;
x_20 = lean_ctor_get(x_18, 0);
x_21 = lean_ctor_get(x_2, 2);
lean_inc(x_21);
lean_dec(x_2);
x_19 = l_Lean_Elab_ContextInfo_ppGoals(x_13, x_18, x_17);
lean_dec(x_13);
if (lean_obj_tag(x_19) == 0)
{
uint8_t x_20;
x_20 = !lean_is_exclusive(x_19);
if (x_20 == 0)
{
lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28;
x_21 = lean_ctor_get(x_19, 0);
x_22 = l_Lean_Elab_TacticInfo_format___closed__2;
x_23 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_23, 0, x_22);
lean_ctor_set(x_23, 1, x_16);
x_24 = l_Lean_Elab_TacticInfo_format___closed__4;
x_25 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_25, 0, x_23);
lean_ctor_set(x_25, 1, x_24);
x_22 = l___private_Lean_Elab_InfoTree_0__Lean_Elab_formatStxRange(x_1, x_21);
x_23 = l_Lean_Elab_TacticInfo_format___closed__2;
x_24 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_24, 0, x_23);
lean_ctor_set(x_24, 1, x_22);
x_25 = l_Lean_Elab_TacticInfo_format___closed__4;
x_26 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_26, 0, x_25);
lean_ctor_set(x_26, 1, x_21);
x_27 = l_Std_Format_join___closed__1;
x_28 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_28, 0, x_26);
lean_ctor_set(x_28, 1, x_27);
lean_ctor_set(x_19, 0, x_28);
return x_19;
}
else
{
lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38;
x_29 = lean_ctor_get(x_19, 0);
x_30 = lean_ctor_get(x_19, 1);
lean_inc(x_30);
lean_inc(x_29);
lean_dec(x_19);
x_31 = l_Lean_Elab_TacticInfo_format___closed__2;
lean_ctor_set(x_26, 0, x_24);
lean_ctor_set(x_26, 1, x_25);
x_27 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_27, 0, x_26);
lean_ctor_set(x_27, 1, x_15);
x_28 = l_Lean_Elab_TacticInfo_format___closed__6;
x_29 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_29, 0, x_27);
lean_ctor_set(x_29, 1, x_28);
x_30 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_30, 0, x_29);
lean_ctor_set(x_30, 1, x_20);
x_31 = l_Std_Format_join___closed__1;
x_32 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_32, 0, x_31);
lean_ctor_set(x_32, 1, x_16);
x_33 = l_Lean_Elab_TacticInfo_format___closed__4;
x_34 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_34, 0, x_32);
lean_ctor_set(x_34, 1, x_33);
x_35 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_35, 0, x_34);
lean_ctor_set(x_35, 1, x_29);
x_36 = l_Std_Format_join___closed__1;
x_37 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_37, 0, x_35);
lean_ctor_set(x_37, 1, x_36);
x_38 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_38, 0, x_37);
lean_ctor_set(x_38, 1, x_30);
return x_38;
}
lean_ctor_set(x_32, 0, x_30);
lean_ctor_set(x_32, 1, x_31);
lean_ctor_set(x_18, 0, x_32);
return x_18;
}
else
{
uint8_t x_39;
lean_dec(x_16);
x_39 = !lean_is_exclusive(x_19);
if (x_39 == 0)
{
return x_19;
}
else
{
lean_object* x_40; lean_object* x_41; lean_object* x_42;
x_40 = lean_ctor_get(x_19, 0);
x_41 = lean_ctor_get(x_19, 1);
lean_inc(x_41);
lean_inc(x_40);
lean_dec(x_19);
x_42 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_42, 0, x_40);
lean_ctor_set(x_42, 1, x_41);
return x_42;
}
}
}
else
{
uint8_t x_43;
lean_dec(x_13);
lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47;
x_33 = lean_ctor_get(x_18, 0);
x_34 = lean_ctor_get(x_18, 1);
lean_inc(x_34);
lean_inc(x_33);
lean_dec(x_18);
x_35 = lean_ctor_get(x_2, 2);
lean_inc(x_35);
lean_dec(x_2);
x_43 = !lean_is_exclusive(x_15);
if (x_43 == 0)
{
return x_15;
}
else
{
lean_object* x_44; lean_object* x_45; lean_object* x_46;
x_44 = lean_ctor_get(x_15, 0);
x_45 = lean_ctor_get(x_15, 1);
lean_inc(x_45);
lean_inc(x_44);
lean_dec(x_15);
x_46 = lean_alloc_ctor(1, 2, 0);
x_36 = l___private_Lean_Elab_InfoTree_0__Lean_Elab_formatStxRange(x_1, x_35);
x_37 = l_Lean_Elab_TacticInfo_format___closed__2;
x_38 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_38, 0, x_37);
lean_ctor_set(x_38, 1, x_36);
x_39 = l_Lean_Elab_TacticInfo_format___closed__4;
x_40 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_40, 0, x_38);
lean_ctor_set(x_40, 1, x_39);
x_41 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_41, 0, x_40);
lean_ctor_set(x_41, 1, x_15);
x_42 = l_Lean_Elab_TacticInfo_format___closed__6;
x_43 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_43, 0, x_41);
lean_ctor_set(x_43, 1, x_42);
x_44 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_44, 0, x_43);
lean_ctor_set(x_44, 1, x_33);
x_45 = l_Std_Format_join___closed__1;
x_46 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_46, 0, x_44);
lean_ctor_set(x_46, 1, x_45);
return x_46;
x_47 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_47, 0, x_46);
lean_ctor_set(x_47, 1, x_34);
return x_47;
}
}
else
{
uint8_t x_48;
lean_dec(x_15);
lean_dec(x_2);
x_48 = !lean_is_exclusive(x_18);
if (x_48 == 0)
{
return x_18;
}
else
{
lean_object* x_49; lean_object* x_50; lean_object* x_51;
x_49 = lean_ctor_get(x_18, 0);
x_50 = lean_ctor_get(x_18, 1);
lean_inc(x_50);
lean_inc(x_49);
lean_dec(x_18);
x_51 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_51, 0, x_49);
lean_ctor_set(x_51, 1, x_50);
return x_51;
}
}
}
else
{
lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57;
x_47 = lean_ctor_get(x_1, 0);
x_48 = lean_ctor_get(x_1, 1);
x_49 = lean_ctor_get(x_1, 3);
x_50 = lean_ctor_get(x_1, 4);
x_51 = lean_ctor_get(x_1, 5);
lean_inc(x_51);
lean_inc(x_50);
lean_inc(x_49);
lean_inc(x_48);
lean_inc(x_47);
lean_dec(x_1);
x_52 = lean_ctor_get(x_2, 0);
lean_inc(x_52);
lean_inc(x_51);
lean_inc(x_50);
lean_inc(x_49);
lean_inc(x_48);
lean_inc(x_47);
x_53 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_53, 0, x_47);
lean_ctor_set(x_53, 1, x_48);
lean_ctor_set(x_53, 2, x_52);
lean_ctor_set(x_53, 3, x_49);
lean_ctor_set(x_53, 4, x_50);
lean_ctor_set(x_53, 5, x_51);
x_54 = lean_ctor_get(x_2, 3);
uint8_t x_52;
lean_dec(x_12);
lean_dec(x_2);
x_52 = !lean_is_exclusive(x_14);
if (x_52 == 0)
{
return x_14;
}
else
{
lean_object* x_53; lean_object* x_54; lean_object* x_55;
x_53 = lean_ctor_get(x_14, 0);
x_54 = lean_ctor_get(x_14, 1);
lean_inc(x_54);
x_55 = lean_alloc_ctor(0, 6, 0);
lean_ctor_set(x_55, 0, x_47);
lean_ctor_set(x_55, 1, x_48);
lean_ctor_set(x_55, 2, x_54);
lean_ctor_set(x_55, 3, x_49);
lean_ctor_set(x_55, 4, x_50);
lean_ctor_set(x_55, 5, x_51);
x_56 = lean_ctor_get(x_2, 1);
lean_inc(x_56);
x_57 = l_Lean_Elab_ContextInfo_ppGoals(x_53, x_56, x_3);
lean_dec(x_53);
if (lean_obj_tag(x_57) == 0)
lean_inc(x_53);
lean_dec(x_14);
x_55 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_55, 0, x_53);
lean_ctor_set(x_55, 1, x_54);
return x_55;
}
}
}
}
lean_object* l_Lean_Elab_TacticInfo_format___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61;
x_58 = lean_ctor_get(x_57, 0);
lean_inc(x_58);
x_59 = lean_ctor_get(x_57, 1);
lean_inc(x_59);
lean_dec(x_57);
x_60 = lean_ctor_get(x_2, 4);
lean_inc(x_60);
lean_dec(x_2);
x_61 = l_Lean_Elab_ContextInfo_ppGoals(x_55, x_60, x_59);
lean_dec(x_55);
if (lean_obj_tag(x_61) == 0)
{
lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72;
x_62 = lean_ctor_get(x_61, 0);
lean_inc(x_62);
x_63 = lean_ctor_get(x_61, 1);
lean_inc(x_63);
if (lean_is_exclusive(x_61)) {
lean_ctor_release(x_61, 0);
lean_ctor_release(x_61, 1);
x_64 = x_61;
} else {
lean_dec_ref(x_61);
x_64 = lean_box(0);
}
x_65 = l_Lean_Elab_TacticInfo_format___closed__2;
x_66 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_66, 0, x_65);
lean_ctor_set(x_66, 1, x_58);
x_67 = l_Lean_Elab_TacticInfo_format___closed__4;
x_68 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_68, 0, x_66);
lean_ctor_set(x_68, 1, x_67);
x_69 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_69, 0, x_68);
lean_ctor_set(x_69, 1, x_62);
x_70 = l_Std_Format_join___closed__1;
x_71 = lean_alloc_ctor(4, 2, 0);
lean_ctor_set(x_71, 0, x_69);
lean_ctor_set(x_71, 1, x_70);
if (lean_is_scalar(x_64)) {
x_72 = lean_alloc_ctor(0, 2, 0);
} else {
x_72 = x_64;
}
lean_ctor_set(x_72, 0, x_71);
lean_ctor_set(x_72, 1, x_63);
return x_72;
}
else
{
lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76;
lean_dec(x_58);
x_73 = lean_ctor_get(x_61, 0);
lean_inc(x_73);
x_74 = lean_ctor_get(x_61, 1);
lean_inc(x_74);
if (lean_is_exclusive(x_61)) {
lean_ctor_release(x_61, 0);
lean_ctor_release(x_61, 1);
x_75 = x_61;
} else {
lean_dec_ref(x_61);
x_75 = lean_box(0);
}
if (lean_is_scalar(x_75)) {
x_76 = lean_alloc_ctor(1, 2, 0);
} else {
x_76 = x_75;
}
lean_ctor_set(x_76, 0, x_73);
lean_ctor_set(x_76, 1, x_74);
return x_76;
}
}
else
{
lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80;
lean_dec(x_55);
lean_dec(x_2);
x_77 = lean_ctor_get(x_57, 0);
lean_inc(x_77);
x_78 = lean_ctor_get(x_57, 1);
lean_inc(x_78);
if (lean_is_exclusive(x_57)) {
lean_ctor_release(x_57, 0);
lean_ctor_release(x_57, 1);
x_79 = x_57;
} else {
lean_dec_ref(x_57);
x_79 = lean_box(0);
}
if (lean_is_scalar(x_79)) {
x_80 = lean_alloc_ctor(1, 2, 0);
} else {
x_80 = x_79;
}
lean_ctor_set(x_80, 0, x_77);
lean_ctor_set(x_80, 1, x_78);
return x_80;
}
}
lean_object* x_4;
x_4 = l_Lean_Elab_TacticInfo_format(x_1, x_2, x_3);
lean_dec(x_1);
return x_4;
}
}
static lean_object* _init_l_Lean_Elab_MacroExpansionInfo_format___closed__1() {
@ -3155,6 +3065,7 @@ x_4 = lean_ctor_get(x_2, 0);
lean_inc(x_4);
lean_dec(x_2);
x_5 = l_Lean_Elab_TacticInfo_format(x_1, x_4, x_3);
lean_dec(x_1);
return x_5;
}
case 1:
@ -5826,6 +5737,10 @@ l_Lean_Elab_TacticInfo_format___closed__3 = _init_l_Lean_Elab_TacticInfo_format_
lean_mark_persistent(l_Lean_Elab_TacticInfo_format___closed__3);
l_Lean_Elab_TacticInfo_format___closed__4 = _init_l_Lean_Elab_TacticInfo_format___closed__4();
lean_mark_persistent(l_Lean_Elab_TacticInfo_format___closed__4);
l_Lean_Elab_TacticInfo_format___closed__5 = _init_l_Lean_Elab_TacticInfo_format___closed__5();
lean_mark_persistent(l_Lean_Elab_TacticInfo_format___closed__5);
l_Lean_Elab_TacticInfo_format___closed__6 = _init_l_Lean_Elab_TacticInfo_format___closed__6();
lean_mark_persistent(l_Lean_Elab_TacticInfo_format___closed__6);
l_Lean_Elab_MacroExpansionInfo_format___closed__1 = _init_l_Lean_Elab_MacroExpansionInfo_format___closed__1();
lean_mark_persistent(l_Lean_Elab_MacroExpansionInfo_format___closed__1);
l_Lean_Elab_MacroExpansionInfo_format___closed__2 = _init_l_Lean_Elab_MacroExpansionInfo_format___closed__2();

View file

@ -30,6 +30,7 @@ lean_object* l_Lean_Lsp_HoverParams_hasFileSource___boxed(lean_object*);
lean_object* l_Lean_Lsp_TextDocumentEdit_hasFileSource(lean_object*);
lean_object* l_Lean_Lsp_DidOpenTextDocumentParams_hasFileSource(lean_object*);
lean_object* l_Lean_Lsp_TextDocumentPositionParams_hasFileSource(lean_object*);
lean_object* l_Lean_Lsp_PlainGoalParams_hasFileSource___boxed(lean_object*);
lean_object* l_Lean_Lsp_Location_hasFileSource(lean_object*);
lean_object* l_Lean_Lsp_TextDocumentEdit_hasFileSource___boxed(lean_object*);
lean_object* l_Lean_Lsp_TextDocumentPositionParams_hasFileSource___boxed(lean_object*);
@ -43,6 +44,7 @@ lean_object* l_Lean_Lsp_DidCloseTextDocumentParams_hasFileSource___boxed(lean_ob
lean_object* l_Lean_Lsp_VersionedTextDocumentIdentifier_hasFileSource___boxed(lean_object*);
lean_object* l_Lean_Lsp_DocumentSymbolParams_hasFileSource(lean_object*);
lean_object* l_Lean_Lsp_VersionedTextDocumentIdentifier_hasFileSource(lean_object*);
lean_object* l_Lean_Lsp_PlainGoalParams_hasFileSource(lean_object*);
lean_object* l_Lean_Lsp_Location_hasFileSource(lean_object* x_1) {
_start:
{
@ -309,6 +311,24 @@ lean_dec(x_1);
return x_2;
}
}
lean_object* l_Lean_Lsp_PlainGoalParams_hasFileSource(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_ctor_get(x_1, 0);
lean_inc(x_2);
return x_2;
}
}
lean_object* l_Lean_Lsp_PlainGoalParams_hasFileSource___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_Lsp_PlainGoalParams_hasFileSource(x_1);
lean_dec(x_1);
return x_2;
}
}
lean_object* initialize_Init(lean_object*);
lean_object* initialize_Lean_Data_Lsp(lean_object*);
static bool _G_initialized = false;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff