Function: semantic-complete-inline-analyzer
semantic-complete-inline-analyzer is a byte-compiled function defined
in complete.el.gz.
Signature
(semantic-complete-inline-analyzer CONTEXT)
Documentation
Complete a symbol name by name based on the current context.
This is similar to semantic-complete-read-tag-analyze, except
that the completion interaction is in the buffer where the context
was calculated from.
CONTEXT is the semantic analyzer context to start with.
Customize semantic-complete-inline-analyzer-displayer-class
to control how completion options are displayed.
See semantic-complete-inline-tag-engine for details on how
completion works.
Source Code
;; Defined in /usr/src/emacs/lisp/cedet/semantic/complete.el.gz
(defun semantic-complete-inline-analyzer (context)
"Complete a symbol name by name based on the current context.
This is similar to `semantic-complete-read-tag-analyze', except
that the completion interaction is in the buffer where the context
was calculated from.
CONTEXT is the semantic analyzer context to start with.
Customize `semantic-complete-inline-analyzer-displayer-class'
to control how completion options are displayed.
See `semantic-complete-inline-tag-engine' for details on how
completion works."
(if (not context) (setq context (semantic-analyze-current-context (point))))
(if (not context) (error "Nothing to complete on here"))
(let* ((collector (semantic-collector-analyze-completions
:buffer (oref context buffer)
:context context))
(syms (semantic-ctxt-current-symbol (point)))
(rsym (reverse syms))
(thissym (car rsym))
(nextsym (car-safe (cdr rsym)))
(complst nil))
(when (and thissym (or (not (string= thissym ""))
nextsym))
;; Do a quick calculation of completions.
(semantic-collector-calculate-completions
collector thissym nil)
;; Get the master list
(setq complst (semanticdb-strip-find-results
(semantic-collector-all-completions collector thissym)))
;; Shorten by name
(setq complst (semantic-unique-tag-table-by-name complst))
(if (or (and (= (length complst) 1)
;; Check to see if it is the same as what is there.
;; if so, we can offer to complete.
(let ((compname (semantic-tag-name (car complst))))
(not (string= compname thissym))))
(> (length complst) 1))
;; There are several options. Do the completion.
(semantic-complete-inline-tag-engine
collector
(funcall semantic-complete-inline-analyzer-displayer-class)
;;(semantic-displayer-tooltip)
(oref context buffer)
(car (oref context bounds))
(cdr (oref context bounds))
))
)))