Skip to content
Snippets Groups Projects
Commit 81bdfb62 authored by Gabriela Bittencourt's avatar Gabriela Bittencourt
Browse files

Add the autocomplete dropdown feature

This adds a dropdown menu with completions from the completion index
when the user creates a new object, message or comment, and starts
typing. Note that this index is initially populated with objects from
the search index of the help browser. As the user types object names,
arguments, messages and comments, they will be added to the completion
index as well.

Entries from the menu can be chosen with the cursor up and down
keys. The enter key can then be used to select an entry and insert the
corresponding completion. Alternatively, clicking with the mouse also
selects an entry.

NOTES / TODO:

This is a very first implementation of autocompletion for purr-data, and
as such it still has a few minor quirks and shortcomings:

- Help index completions: Completions from the help browser's index will
  only be available once that index has been built. By default, this
  happens when the help browser is first launched. However, you can
  change this so that the help index is automatically created when
  purr-data launches, by ticking the corresponding checkbox in the GUI
  preferences. This will make sure that completions from the help index
  are always available, even before launching the help browser for the
  first time.

- Prefix matches: As shipped, completions will encompass all matches of
  the typed text, even within an index item. There is an option to
  select prefix matches only in the code of the search_obj() function in
  pdgui.js. Currently changing the code is the only way to get this
  behavior; there should probably be a checkbox in the GUI preferences
  to make this easier.

- Tab completion: There is no binding for the Tab key in order to select
  a default completion yet, so currently you have to use the cursor keys
  and enter or the mouse to select a completion. This will hopefully be
  added in the future.

- Stale completions: At present, there is no way to remove "stale"
  completion entries, such as obsolete entries from the help index, or
  manually typed completions which haven't been used for a long
  time. There should probably be a way to do this in a (semi-)automatic
  fashion, but at present the completion engine offers no support for
  this.
parent 848a6e5e
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment