idlwave: Object Method Completion and Class Ambiguity
4.4.2 Object Method Completion and Class Ambiguity
--------------------------------------------------
An object method is not uniquely determined without the object’s class.
Since the class is almost always omitted in the calling source (as
required to obtain the true benefits of object-based programming),
IDLWAVE considers all available methods in all classes as possible
method name completions. The combined list of keywords of the current
method in _all_ known classes which contain that method will be
considered for keyword completion. In the ‘*Completions*’ buffer, the
matching classes will be shown next to each item (see option
‘idlwave-completion-show-classes’). As a special case, the class of an
object called ‘self’ is always taken to be the class of the current
routine, when in an IDLWAVE buffer. All inherits classes are considered
as well.
You can also call ‘idlwave-complete’ with a prefix arg: ‘C-u
M-<TAB>’. IDLWAVE will then prompt you for the class in order to narrow
down the number of possible completions. The variable
‘idlwave-query-class’ can be configured to make such prompting the
default for all methods (not recommended), or selectively for very
common methods for which the number of completing keywords would be too
large (e.g., ‘Init,SetProperty,GetProperty’).
After you have specified the class for a particular statement (e.g.,
when completing the method), IDLWAVE can remember it for the rest of the
editing session. Subsequent completions in the same statement (e.g.,
keywords) can then reuse this class information. This works by placing
a text property on the method invocation operator ‘->’, after which the
operator will be shown in a different face (bold by default). The
variable ‘idlwave-store-inquired-class’ can be used to turn it off or
on.
-- User Option: idlwave-completion-show-classes (‘1’)
Non-‘nil’ means show up to that many classes in ‘*Completions*’
buffer when completing object methods and keywords.
-- User Option: idlwave-completion-fontify-classes (‘t’)
Non-‘nil’ means fontify the classes in completions buffer.
-- User Option: idlwave-query-class (‘nil’)
Association list governing query for object classes during
completion.
-- User Option: idlwave-store-inquired-class (‘t’)
Non-‘nil’ means store class of a method call as text property on
‘->’.
-- User Option: idlwave-class-arrow-face
Face to highlight object operator arrows ‘->’ which carry a saved
class text property.