(require 'semantic/analyze)
(require 'semantic/analyze/refs))
+(declare-function imenu--mouse-menu "imenu")
+
;;; Code:
;;; COMPLETION
location.")
(make-variable-buffer-local 'semantic-ia-cache)
+;;; COMPLETION HELPER
+;;
+;; This overload function handles inserting a tag
+;; into a buffer for these local completion routines.
+;;
+;; By creating the functions as overloadable, it can be
+;; customized. For example, the default will put a paren "("
+;; character after function names. For Lisp, it might check
+;; to put a "(" in front of a function name.
+
+(define-overloadable-function semantic-ia-insert-tag (tag)
+ "Insert TAG into the current buffer based on completion.")
+
+(defun semantic-ia-insert-tag-default (tag)
+ "Insert TAG into the current buffer based on completion."
+ (insert (semantic-tag-name tag))
+ (let ((tt (semantic-tag-class tag)))
+ (cond ((eq tt 'function)
+ (insert "("))
+ (t nil))))
+
+(declare-function semantic-analyze-possible-completions
+ "semantic/analyze/complete")
+
(defun semantic-ia-get-completions (context point)
"Fetch the completion of CONTEXT at POINT.
Supports caching."
"Complete the current symbol via a menu based at POINT.
Completion options are calculated with `semantic-analyze-possible-completions'."
(interactive "d")
+ (require 'imenu)
(let* ((a (semantic-analyze-current-context point))
(syms (semantic-ia-get-completions a point))
)
(semantic-ia-insert-tag ans))
))))
-;;; COMPLETION HELPER
-;;
-;; This overload function handles inserting a tag
-;; into a buffer for these local completion routines.
-;;
-;; By creating the functions as overloadable, it can be
-;; customized. For example, the default will put a paren "("
-;; character after function names. For Lisp, it might check
-;; to put a "(" in front of a function name.
-
-(define-overloadable-function semantic-ia-insert-tag (tag)
- "Insert TAG into the current buffer based on completion.")
-
-(defun semantic-ia-insert-tag-default (tag)
- "Insert TAG into the current buffer based on completion."
- (insert (semantic-tag-name tag))
- (let ((tt (semantic-tag-class tag)))
- (cond ((eq tt 'function)
- (insert "("))
- (t nil))))
-
;;; Completions Tip
;;
;; This functions shows how to get the list of completions,
(pulse-momentary-highlight-one-line (point))
)
+(declare-function semantic-decoration-include-visit "semantic/decorate/include")
+
(defun semantic-ia-fast-jump (point)
"Jump to the tag referred to by the code at POINT.
Uses `semantic-analyze-current-context' output to identify an accurate
((semantic-tag-of-class-p (semantic-current-tag) 'include)
;; Just borrow this cool fcn.
+ (require 'semantic/decorate/include)
(semantic-decoration-include-visit)
)