1:- module(pls_index_defintions, [
    2  definition_for_position/3
    3]).    4
    5:- use_module(library(log4p)).    6:- use_module(documents).    7
    8definition_for_position(URI, Position, Definitions) :-
    9  get_document_item(URI, Position, exports(Predicate)),
   10  get_definitions(Predicate, Definitions).
   11
   12definition_for_position(URI, Position, Definitions) :-
   13  get_document_item(URI, Position, references(_Caller, Predicate)),
   14  get_definitions(Predicate, Definitions).
   15
   16get_definitions(Predicate, Definitions) :-
   17  findall(
   18    _{
   19      uri: DefURI,
   20      range: DefRange
   21      }, 
   22    get_document_item(DefURI, DefRange, defines(Predicate)),
   23    Definitions
   24    )