1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253(**************************************************************************)(* *)(* 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.LspWrapperopenVernacexpropenPp(* 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)(* 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)letinterp_search~idenvsigmasr=letpr_searchref_kindenvc=letname=pr_globalrefinletopenImpargsinletimpls=implicits_of_globalrefinletimpargs=select_stronger_impargsimplsinletimpargs=List.mapbinding_kind_of_statusimpargsinletstatement=pr_ltype_envenvEvd.(from_envenv)~impargscinletname=pp_of_coqppnameinletstatement=pp_of_coqppstatementinQueue.push{id;name;statement}query_results_queueinletr=interp_search_restrictionrin(Search.searchenvsigma(List.map(ComSearch.interp_search_requestenvEvd.(from_envenv))s)r|>Search.prioritize_search)pr_search;[query_feedback]