The Semantic Analyzer can be used to perform code completion in a manner that takes the local context into account. (In addition to the user commands in this section, Semantic Idle Completions mode also uses the Semantic Analyzer. See Idle Completions Mode.)
This is the most basic command for Semantic Analyzer-based completion. Called interactively, it displays a list of the possible completions for the symbol at point.
When called from a Lisp program,
semantic-analyze-possible-completions
does not display a
completions list. The argument context should be either a
buffer position, or a context object. The return value is a list of
Semantic tag objects that complete the symbol for context,
based on the following criteria:
:prefix
.
Most of the other commands documented in this section call
semantic-analyze-possible-completions
internally.
This command is bound to C-c , SPC when Semantic mode is enabled (see Semantic mode user commands). It displays a list of possible completions for the symbol at point, and activates a special set of key bindings for choosing a completion.
You can type RET to accept the current completion, M-n and M-p to cycle through the possible completions, TAB to complete as far as possible and then cycle through completions, and either C-g or any other key to abort the completion.
This command is similar to the completion performed by Semantic Idle Completions mode. The main difference is that it is called explicitly, whereas Semantic Idle Completions mode completes during idle time (see Idle Completions Mode).
The value of this variable determines how
semantic-complete-analyze-inline
shows its completions.
Possible values include:
semantic-displayer-traditional
Display completions in a separate window. This is the default value.
semantic-displayer-ghost
Display completions “inline” with the buffer text, similar to the default behavior of Semantic Idle Completions mode (see Idle Completions Mode).
semantic-displayer-tooltip
Display completions in a tooltip.
In addition to semantic-complete-analyze-inline
, you can use
the simpler command semantic-ia-complete-symbol point
. This
behaves like the usual M-TAB (complete-symbol
)
command (see Symbol Completion in Emacs manual), except it
uses the Semantic Analyzer.
Complete the current symbol at point.