Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language Server Protocol for TLAPM #93

Merged
merged 145 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
e09e72d
Initial experiments with LSP.
kape1395 Sep 19, 2023
fc0cd13
Empty LSP server works.
kape1395 Sep 19, 2023
6d06443
Some code reorg.
kape1395 Sep 19, 2023
c5e54d4
Use the code formatter.
kape1395 Sep 19, 2023
e71f936
Improving it.
kape1395 Sep 19, 2023
705f1cc
CLI added, some refactorings, 2 transports.
kape1395 Sep 20, 2023
7b6735f
IO Tracing added.
kape1395 Sep 20, 2023
67b1629
Some LSP communication works already.
kape1395 Sep 22, 2023
6b90562
Option to redirect stderr to a file.
kape1395 Sep 23, 2023
637f37d
Use logging to a file rom the ts code.
kape1395 Sep 23, 2023
687f5a4
Docs store.
kape1395 Sep 23, 2023
a6ddb4f
Some experiments on test cases.
kape1395 Sep 23, 2023
ff2d50b
Handle some LSP packets.
kape1395 Sep 24, 2023
cc08f1d
Attempt to reuse the original traceln function.
kape1395 Sep 24, 2023
fd022ee
Track connection state.
kape1395 Sep 24, 2023
79eadba
Support prover-info cmd.
kape1395 Sep 24, 2023
d6c7131
Cleanup.
kape1395 Sep 24, 2023
bbbc308
Cleanup.
kape1395 Sep 24, 2023
31d69e1
Playing with more LSP command types.
kape1395 Sep 24, 2023
ac444b2
Notes.
kape1395 Sep 24, 2023
a54d399
Prove-step now contains the cursor in the doc.
kape1395 Sep 24, 2023
9bd124e
Some tests.
kape1395 Sep 29, 2023
413bd17
Some progress on the tlapm invokation.
kape1395 Oct 2, 2023
bf54288
Toolbox parser, support multiline fields.
kape1395 Oct 2, 2023
10f8edf
Small code simplifications.
kape1395 Oct 2, 2023
9316553
Some notes.
kape1395 Oct 3, 2023
866892d
Some test cases.
kape1395 Oct 7, 2023
eeab4f0
Support for reading a TLA file from STDIN.
kape1395 Oct 7, 2023
0f9da46
Use stream add function instead of stream directly.
kape1395 Oct 7, 2023
dede4da
Code reorganized to run on threads.
kape1395 Oct 7, 2023
7d62986
Working on the LSP prove-step command.
kape1395 Oct 7, 2023
4db77ad
Prover is now invoked.
kape1395 Oct 8, 2023
8719f7d
TLAPM is now invoked.
kape1395 Oct 8, 2023
d0120d7
Range translation fixed.
kape1395 Oct 8, 2023
462cad8
Obligations are now shown (on proof event only).
kape1395 Oct 8, 2023
679e556
Structs to maintain obligation state added.
kape1395 Oct 8, 2023
2253767
Notes.
kape1395 Oct 8, 2023
2b416ed
It starts looking like working.
kape1395 Oct 9, 2023
b7cd138
Line diff.
kape1395 Oct 9, 2023
cd5d78f
Docs module reorganized.
kape1395 Oct 9, 2023
32bbf85
Diagnostics pull implemented.
kape1395 Oct 10, 2023
b3bce51
Code formatting.
kape1395 Oct 10, 2023
7ec97db
Unify use of diagnostic source.
kape1395 Oct 10, 2023
9ab7d63
Misc fixes.
kape1395 Oct 10, 2023
2aa1f6f
Show failed obligation.
kape1395 Oct 10, 2023
989642c
Rename the prove-step command.
kape1395 Oct 13, 2023
46a66f0
Makefile env setup targets fixed.
kape1395 Oct 13, 2023
7b3e2b9
Parser is now invoked.
kape1395 Oct 14, 2023
7870b0a
Use modules instead of embedded recs.
kape1395 Oct 14, 2023
cb51893
Consider theorem ranges when checking a step.
kape1395 Oct 14, 2023
8d9d19c
A bit of error handling.
kape1395 Oct 14, 2023
c58d5e4
Make build work with older ocaml versions.
kape1395 Oct 14, 2023
37e8a07
Experiment: use custom notification to present proof states.
kape1395 Oct 15, 2023
58618d5
Notes.
kape1395 Oct 15, 2023
579804a
Proof state is shown somehow.
kape1395 Oct 15, 2023
1a72a56
Cleanup.
kape1395 Oct 16, 2023
0cc97f9
QED step locus tracking fixed in the parser.
kape1395 Oct 16, 2023
4b6baa8
Code action for "check-proof".
kape1395 Oct 16, 2023
2c4b5eb
Use Ocaml 5.1 in the CI build.
kape1395 Oct 16, 2023
871a148
Make CI work with OCaml 5.1.
kape1395 Oct 16, 2023
ca30c58
Better traceln impl.
kape1395 Oct 17, 2023
5177315
Use Re2 instead of Str.
kape1395 Oct 19, 2023
4425941
Try improve range calculations.
kape1395 Oct 19, 2023
83acdf3
Route the obl_num/terminated to the corresponding doc.
kape1395 Oct 20, 2023
38403e8
A bit of cleanup.
kape1395 Oct 20, 2023
ab6cb52
Working on the progress presentation and the cancellation.
kape1395 Oct 21, 2023
2116c53
Progress is now shown.
kape1395 Oct 21, 2023
7da3374
Cleanup.
kape1395 Oct 21, 2023
c72e177
Cancellation support.
kape1395 Oct 21, 2023
7e552c0
Improve error handling.
kape1395 Nov 11, 2023
a12ddea
Fixes #100.
kape1395 Nov 11, 2023
d0ed4b6
Use SigINT to interrupt the TLAPM instead of SigKILL.
kape1395 Dec 17, 2023
07819c6
Buffer proof info updates for some time before sending them to the IDE.
kape1395 Dec 17, 2023
ccaa8f7
Merge remote-tracking branch 'upstream/main' into lsp
kape1395 Dec 21, 2023
528e0a8
Invoke graceful termination on SigINT.
kape1395 Jan 5, 2024
668db17
Initial version of providing the proof state of a step.
kape1395 Jan 7, 2024
4074c28
Missing lib added, some auto-formatting.
kape1395 Jan 7, 2024
07e89f9
Make mutex usage compatible with older ocaml versions.
kape1395 Jan 7, 2024
0cb0251
Broken test fixed.
kape1395 Jan 7, 2024
f18baaa
Remove test LSP client. It is not relevant anymore.
kape1395 Jan 7, 2024
dd07c14
Adjust the proof state structs for the UI.
kape1395 Jan 8, 2024
0928d79
Split tlapm_lsp_docs into multiple files.
kape1395 Jan 12, 2024
332a174
Use HTTPS to download Isabelle.
kape1395 Jan 12, 2024
814e059
Take obligation text from the parser.
kape1395 Jan 13, 2024
ec55193
Use search path when parsing a document.
kape1395 Jan 13, 2024
9be9d3a
Only show steps from the current file.
kape1395 Jan 14, 2024
529e001
Proof steps are determined correctly again. Closes #114.
kape1395 Jan 16, 2024
bb88a5e
Retain proof state based on fingerprints; attach obligations to steps…
kape1395 Jan 21, 2024
b0497da
Include the BY clauses into the proof step range.
kape1395 Jan 22, 2024
d26164b
Show proof steps for HAVE, TAKE, WITNESS.
kape1395 Jan 22, 2024
87788f0
Better error message for unsupported recursive operators.
kape1395 Jan 23, 2024
7db485a
Code reorganized into sub-modules.
kape1395 Jan 23, 2024
8354385
Formatter.
kape1395 Jan 23, 2024
0311059
Move range to the main lsp lib.
kape1395 Jan 23, 2024
241cfb3
Prover client code reorganized.
kape1395 Jan 24, 2024
7db97e8
Reorganize code into sub-modules.
kape1395 Jan 24, 2024
4ef5e1f
Progress reorganized.
kape1395 Jan 24, 2024
54e5930
Add status to TlapsProofStepDetails.
kape1395 Jan 24, 2024
7d9cb83
LSP: omitted and progress fixed.
kape1395 Jan 26, 2024
b500bbd
Misc TODOs addressed.
kape1395 Jan 27, 2024
8bec891
Send updates to the current proof step details.
kape1395 Jan 27, 2024
c00773d
Retain decorators after tabs are switched.
kape1395 Jan 27, 2024
512586b
Set the current proof step via explicit LSP command.
kape1395 Jan 27, 2024
b5aa2a7
Send the obligation role with the details.
kape1395 Jan 27, 2024
f006a8f
Pass obligation status to UI.
kape1395 Jan 28, 2024
9289216
Have to process all the referenced modules.
kape1395 Jan 30, 2024
14e45b5
Exchange module search paths with the LSP client.
kape1395 Feb 3, 2024
52d2219
LSP now takes paths from the client.
kape1395 Feb 3, 2024
31ed7d8
Add `--prefer-stdlib` option and use it in the LSP server. This is to…
kape1395 Feb 9, 2024
1b4437c
Global ref to the parser paths eliminated.
kape1395 Feb 10, 2024
777c732
Propagate parser updates to the loaded docs.
kape1395 Feb 10, 2024
6231f51
Report an understandable error if an operator is applied with a wrong…
kape1395 Feb 13, 2024
5dc0169
Register parsing errors so that they can be reported nicely.
kape1395 Feb 13, 2024
d3eb73f
More of error handling in the parser.
kape1395 Feb 17, 2024
0a5b5f6
Merge remote-tracking branch 'origin/main' into lsp
kape1395 Feb 26, 2024
5fa594b
Merge remote-tracking branch 'upstream/main' into lsp
kape1395 Feb 26, 2024
edfd377
Mistype fixed.
kape1395 May 31, 2024
cee770f
Update lsp/lib/docs/doc_vsn.ml
kape1395 May 31, 2024
8dfcaa5
Remove unused module export.
kape1395 Jun 1, 2024
70d43c3
Mistype fixed.
kape1395 Jun 1, 2024
9bb6a52
Mistype fixed.
kape1395 Jun 1, 2024
9d9a559
Mistype fixed.
kape1395 Jun 1, 2024
6591218
Comment refined.
kape1395 Jun 1, 2024
09c9414
failwith -> assert false
kape1395 Jun 1, 2024
f653fd7
Use atomic instead of mutex in the signal handler.
kape1395 Jun 8, 2024
53cfe83
Merge remote-tracking branch 'origin/main' into lsp
kape1395 Jun 8, 2024
8b8ce33
Multiple mistypes in comments fixed.
kape1395 Jun 8, 2024
933a762
Use assert false for impossible cases.
kape1395 Jun 8, 2024
f682548
Use `type nonrec t = t` instead of a renamed type.
kape1395 Jun 8, 2024
1865962
A function simplified.
kape1395 Jun 8, 2024
6f7c3ac
Don't use needless namespaces.
kape1395 Jun 8, 2024
20583b6
Error message improved.
kape1395 Jun 8, 2024
7491db9
Make code more readable.
kape1395 Jun 8, 2024
7865485
Error message improved.
kape1395 Jun 8, 2024
6b6d9a8
Use OCaml 4.14 instead of 4.13. Build a release on 5.1.0.
kape1395 Jun 8, 2024
f5fccb3
Refine the `step_loc` description.
kape1395 Jun 8, 2024
c573aba
Improve comments.
kape1395 Jun 10, 2024
0ac8eac
Exactly 1 module has to be specified if TLAPM is invoked with the `--…
kape1395 Jun 10, 2024
9e1fbe7
Update to the new dependency versions.
kape1395 Aug 24, 2024
ab37243
Merge remote-tracking branch 'origin/main' into lsp
kape1395 Aug 24, 2024
47afb6b
Use proper library paths in all cases.
kape1395 Aug 26, 2024
0c996a6
Improve comments.
kape1395 Aug 26, 2024
4837328
Handle file read errors gracefully.
kape1395 Aug 26, 2024
8138f4b
Toolbox protocol v2 added, fixed the check if an obligation is in the…
kape1395 Aug 27, 2024
4d53b9e
Cleanup around the pending provers for an obligation.
kape1395 Aug 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use search path when parsing a document.
Signed-off-by: Karolis Petrauskas <k.petrauskas@gmail.com>
  • Loading branch information
kape1395 committed Jan 13, 2024
commit ec55193d0ba530a8d0e0d186aff2f08f5dde9d7c
4 changes: 4 additions & 0 deletions src/params.ml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ let add_search_dir dir =
if List.for_all (fun lp -> lp <> dir) !rev_search_path then
rev_search_path := library_path :: dir :: List.tl !rev_search_path

(* Reset the search path to the specified list. *)
let set_search_path dirs =
rev_search_path := library_path :: List.concat [dirs; Setup_paths.Sites.stdlib]

let output_dir = ref "."

let default_method =
Expand Down
1 change: 1 addition & 0 deletions src/params.mli
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ val fpf_in: string option ref
val summary: bool ref
val stats: bool ref
val add_search_dir: string -> unit
val set_search_path: string list -> unit
val keep_going: bool ref (* FIXME check still used ? *)
val suppress_all: bool ref
val set_smt_logic: string -> unit
Expand Down
7 changes: 4 additions & 3 deletions src/tlapm_lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -609,17 +609,18 @@ let module_of_string (content : string) (fn : string) : (Module.T.mule, (string
let hint = Property.assign hint Module.Save.module_content_prop (Module.Save.String content) in
let mule = Module.Save.parse_file ~clock:Clocks.parsing hint in
Params.input_files := [Filename.basename fn]; (* Needed, because p_gen.ml decides if obs should be generated by this. *)
Params.set_search_path [Filename.dirname fn]; (* Were to look for referenced files. TODO: Take additional. *)
mule.core.important <- true ;
let mcx = Module.Standard.initctx in
let mcx = Sm.add mule.core.name.core mule mcx in
let mcx = Module.Save.complete_load ~clock:Clocks.parsing mcx in
let (mcx, mods) = Module.Dep.schedule mcx in
match List.filter (fun m -> m.core.important) mods with
match List.filter (fun m -> m.core.name.core = mule.core.name.core) mods with
| [mule] ->
let (_mcx, mule, _summ) = Module.Elab.normalize mcx Deque.empty mule in
Ok mule
| [] -> failwith "module_of_string, no important mules"
| _ -> failwith "module_of_string, too many important mules"
| [] -> failwith "module_of_string, found no module we tried to parse."
| _ -> failwith "module_of_string, found too many modules with required name."
in
match parse_it () with
| Ok mule -> Ok mule
Expand Down
Loading