123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960(**************************************************************************)(* *)(* VSCoq *)(* *)(* Copyright INRIA and contributors *)(* (see version control and README file for authors & dates) *)(* *)(**************************************************************************)(* *)(* This file is distributed under the terms of the MIT License. *)(* See LICENSE file. *)(* *)(**************************************************************************)openUtilopenPrinteropenProtocol.PrintingopenProtocol.LspWrapper(* Note: this queue is not very useful today, as we process results in the main
vscoq process, which does not allow for real asynchronous processing of results. *)letquery_results_queue=Queue.create()letquery_feedback:notificationSel.Event.t=Sel.On.queuequery_results_queue(funx->QueryResultNotificationx)[%%ifcoq="8.18"]openVernacexpropenPp(* TODO : remove these two functions when interp_search_restriction is
added in the comSearch.mli in Coq (they're simply copied here for now) *)letglobal_moduleqid=tryNametab.full_name_moduleqidwithNot_found->CErrors.user_err?loc:qid.CAst.loc(str"Module/Section "++Ppconstr.pr_qualidqid++str" not found.")letinterp_search_restriction=function|SearchOutsidel->(List.mapglobal_modulel,true)|SearchInsidel->(List.mapglobal_modulel,false)letadapt_pr_searchfrkec=frke(Evd.from_enve)c[%%else]letinterp_search_restriction=ComSearch.interp_search_restrictionletadapt_pr_searchf=f[%%endif]letinterp_search~idenvsigmasr=letpr_searchref_kindenvsigmac=letpr=pr_globalrefinletopenImpargsinletimpls=implicits_of_globalrefinletimpargs=select_stronger_impargsimplsinletimpargs=List.mapbinding_kind_of_statusimpargsinletpc=pr_ltype_envenvsigma~impargscinletname=pp_of_coqppprinletstatement=pp_of_coqpppcinQueue.push{id;name;statement}query_results_queueinletr=interp_search_restrictionrin(Search.searchenvsigma(List.map(ComSearch.interp_search_requestenvsigma)s)r|>Search.prioritize_search)(adapt_pr_searchpr_search);[query_feedback]