- Using the Prolog IDE
The Prolog Search finds code loaded into the Prolog process that is currently selected in the Prolog Console. It will not find predicates in files that are not consulted! If you want a textual search, use the textual search dialog that is standard in Eclipse.
There are three ways to run a search:
The following options are supported:
modis the searched module name the search will find
predif pred is imported from
mod, typically via a use_module directive)
Three different problem searches are possible:
pdt_call_analysis:entry_point/1(the expected format is
For each search it is possible to use the Create Warnings option. If enabled a persistent Eclipse marker will be created for each search result.
The results of the Prolog Search are presented in the Search View. The following elements are shown in this view:
This is how search results for different search options look like. The searches were performed on the PDT Tutorial Project.
|Search String||Search for…||Limit to…||Exact Match||Results||Kind of match|
|abc/1||Predicate||Definitions||Yes||Line number and clause head (definition)|
|abc/1||Predicate||References||Yes||Predicate call (reference)|
|search_demo||Module/Entity||References||Yes|| Predicate call (reference) and |
import declaration (reference to a module)
You can start the search for predicates directly from the editor.
The search for predicate declarations and definitions from the editor will find the same results like the global search via the search dialog but the results will contain information regarding the context (current file) of the search:
The “invisible” category is intended to make programmers aware of unrelated but homonymous predicates that could lead to confusion.
If results on multiple categories are found the categories are ordered as shown above (supermodules, local module, submodules and invisible predicates).
The reference search in the editor will find exactly the same results as the global reference search.
Sometimes you might want to search for a predicate mentioned in a console message. For example, after a message about a call to an undefined predicate you might want to find all other references to it.
For this, select the predicate name (or full predicate indicator name/arity) in the console and choose “Open Search Dialog” from the context menu. The Prolog Search dialog will be opened with the current text selection in the Prolog Console as input.