1:- module(pls_index_hover, [
    2  hover_for_position/3
    3]).    4
    5:- use_module(pls_index).    6
    7hover_for_position(URI, Position, Hover) :-
    8  get_document_item(URI, Position, exports(Predicate)),
    9  get_document_item(URI, Range, exports(Predicate)),
   10  get_hover(Predicate, Range, Hover),
   11  !.
   12
   13hover_for_position(URI, Position, Hover) :-
   14  get_document_item(URI, Position, references(Caller, Predicate)),
   15  get_document_item(URI, Range, references(Caller, Predicate)),
   16  get_hover(Predicate, Range, Hover),
   17  !.
   18
   19hover_for_position(URI, Position, Hover) :-
   20  get_document_item(URI, Position, defines(Predicate)),
   21  get_document_item(URI, Range, defines(Predicate)),
   22  get_hover(Predicate, Range, Hover),
   23  !.
 get_hover(+Callablle, +Range, -Hover) is nondet
Return a hover for the indicated range; will always return minimal markup, even if no documentation available.
   30get_hover(Predicate, Range, Hover) :-
   31  get_docs(Predicate, Docs),
   32  Hover = _{
   33    range: Range,
   34    contents: _{
   35      kind: 'markdown',
   36      value: Docs
   37      }
   38  }