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

Make the LSP independent of level assignment. #186

Open
wants to merge 2 commits into
base: updated_enabled_cdot
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=0.26.2
version=0.27.0
profile=default
4 changes: 3 additions & 1 deletion lsp/lib/docs/proof_step.ml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ let of_module (mule : Tlapm_lib.Module.T.mule) prev : t option =
proof status between the modifications. *)
let o =
match o.fingerprint with
| None -> Tlapm_lib.Backend.Prep.prepare_obligation o
| None ->
(* `Tlapm_lib.Backend.Prep.prepare_obligation o` works too slow here. *)
Tlapm_lib.Backend.Fingerprints.write_fingerprint o
| Some _ -> o
in
let o = Obl.of_parsed_obligation o Proof_status.Pending in
Expand Down
7 changes: 6 additions & 1 deletion src/backend/fingerprints.ml
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,14 @@ and fp_sequent stack buf sq =
spin stack cx;
let v,r = Stack.pop stack in
if !r then
(* Here `Expr.Levels.get_level e` was used instead of
`if Expr.Constness.is_const e then 0 else 3`,
but that introduces a dependency on having the levels
assigned before calculating fingerprints. The former is
slow and thus is problematic to use in LSP. *)
bprintf buf "$Def(%d,%d)"
(match v with Identhypi i -> i | _ -> assert false)
(Expr.Levels.get_level e)
(if Expr.Constness.is_const e then 0 else 3)
| Defn ({core = Bpragma (nm, _, _)}, _, Hidden, _) ->
Stack.push stack (IdentBPragma nm.core, ref false);
spin stack cx;
Expand Down