|
1 | | -/- |
2 | | -Copyright (c) 2026 Lean FRO LLC. All rights reserved. |
3 | | -Released under Apache 2.0 license as described in the file LICENSE. |
4 | | -Author: Emilio J. Gallego Arias |
5 | | --/ |
| 1 | + /- |
| 2 | + Copyright (c) 2026 Lean FRO LLC. All rights reserved. |
| 3 | + Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | + Author: Emilio J. Gallego Arias |
| 5 | + -/ |
6 | 6 |
|
7 | | -import Lean |
| 7 | + import RunAt.Internal.DirectImports |
| 8 | + import RunAt.Internal.SaveSupport |
8 | 9 |
|
9 | | -open Lean |
| 10 | + /-- |
| 11 | + Compatibility import for broker-only save support internals. |
10 | 12 |
|
11 | | -namespace RunAt.Internal |
| 13 | + The actual definitions now live in: |
12 | 14 |
|
13 | | -/-- |
14 | | -Internal broker-only request for saving the current elaborated document state to |
15 | | -the Lake artifact locations expected by the workspace. |
16 | | -
|
17 | | -This is not part of the public `runAt` API. |
18 | | --/ |
19 | | -def saveArtifactsMethod : String := "$/lean/runAt/saveArtifacts" |
20 | | - |
21 | | -/-- |
22 | | -Internal broker-only request for checking whether the current elaborated document |
23 | | -state is ready for artifact save. |
24 | | -
|
25 | | -This is not part of the public `runAt` API. |
26 | | --/ |
27 | | -def saveReadinessMethod : String := "$/lean/runAt/saveReadiness" |
28 | | - |
29 | | -/-- |
30 | | -Internal broker-only request for parsing the current document header and |
31 | | -returning its direct imports from the current tracked text snapshot. |
32 | | -
|
33 | | -This is not part of the public `runAt` API. |
34 | | --/ |
35 | | -def directImportsMethod : String := "$/lean/runAt/directImports" |
36 | | - |
37 | | -/-- Internal request payload for artifact serialization from the current worker snapshot. -/ |
38 | | -structure SaveArtifactsParams where |
39 | | - textDocument : Lean.Lsp.TextDocumentIdentifier |
40 | | - oleanFile : String |
41 | | - ileanFile : String |
42 | | - cFile : String |
43 | | - bcFile? : Option String := none |
44 | | - deriving FromJson, ToJson |
45 | | - |
46 | | -instance : Lean.Lsp.FileSource SaveArtifactsParams where |
47 | | - fileSource p := p.textDocument.uri |
48 | | - |
49 | | -/-- Internal request payload for save-readiness checks from the current worker snapshot. -/ |
50 | | -structure SaveReadinessParams where |
51 | | - textDocument : Lean.Lsp.TextDocumentIdentifier |
52 | | - deriving FromJson, ToJson |
53 | | - |
54 | | -instance : Lean.Lsp.FileSource SaveReadinessParams where |
55 | | - fileSource p := p.textDocument.uri |
56 | | - |
57 | | -/-- Internal request payload for direct-import queries from the current tracked text snapshot. -/ |
58 | | -structure DirectImportsParams where |
59 | | - textDocument : Lean.Lsp.TextDocumentIdentifier |
60 | | - deriving FromJson, ToJson |
61 | | - |
62 | | -instance : Lean.Lsp.FileSource DirectImportsParams where |
63 | | - fileSource p := p.textDocument.uri |
64 | | - |
65 | | -/-- Internal success payload for artifact serialization. -/ |
66 | | -structure SaveArtifactsResult where |
67 | | - written : Bool := true |
68 | | - version : Nat |
69 | | - textHash : UInt64 |
70 | | - deriving FromJson, ToJson |
71 | | - |
72 | | -/-- Internal success payload for save-readiness checks. -/ |
73 | | -structure SaveReadinessResult where |
74 | | - version : Nat |
75 | | - diagnosticErrorCount : Nat := 0 |
76 | | - commandErrorCount : Nat := 0 |
77 | | - saveReady : Bool := true |
78 | | - saveReadyReason : String := "ok" |
79 | | - deriving FromJson, ToJson |
80 | | - |
81 | | -/-- Internal success payload for direct-import queries from the current tracked text snapshot. -/ |
82 | | -structure DirectImportsResult where |
83 | | - version : Nat |
84 | | - imports : Array String := #[] |
85 | | - deriving FromJson, ToJson |
86 | | - |
87 | | -end RunAt.Internal |
| 15 | + - `RunAt.Internal.SaveSupport` for the supported save-after-sync broker path |
| 16 | + - `RunAt.Internal.DirectImports` for the unsupported direct-import query path |
| 17 | + -/ |
0 commit comments