Skip to content

Commit

Permalink
Merge pull request #756 from SkySkimmer/indirect
Browse files Browse the repository at this point in the history
Adapt to coq/coq#18422 (indirect accessor handled through vernactypes)
  • Loading branch information
rtetley authored Apr 8, 2024
2 parents 8a30a03 + 7531ba1 commit 50b2913
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion language-server/dm/documentManager.ml
Original file line number Diff line number Diff line change
Expand Up @@ -469,14 +469,27 @@ let locate st pos ~pattern =
Ok( pp_of_coqpp @@ Notation.locate_notation
(Constrextern.without_symbols (Printer.pr_glob_constr_env env sigma)) ntn sc)

[%%if coq = "8.18" || coq = "8.19"]
let print st pos ~pattern =
let loc = RawDocument.loc_of_position (Document.raw_document st.document) pos in
match get_context st pos with
| None -> Error("No context found")
| Some (sigma, env) ->
| Some (sigma, env) ->
let qid = parse_entry st loc (Pcoq.Prim.smart_global) pattern in
let udecl = None in (*TODO*)
Ok ( pp_of_coqpp @@ Prettyp.print_name env sigma qid udecl )
[%%else]
let print st pos ~pattern =
let loc = RawDocument.loc_of_position (Document.raw_document st.document) pos in
match get_context st pos with
| None -> Error("No context found")
| Some (sigma, env) ->
let qid = parse_entry st loc (Pcoq.Prim.smart_global) pattern in
let udecl = None in (*TODO*)
let access = Library.indirect_accessor[@@warning "-3"] in
Ok ( pp_of_coqpp @@ Prettyp.print_name access env sigma qid udecl )
[%%endif]


module Internal = struct

Expand Down

0 comments on commit 50b2913

Please sign in to comment.