Hi,
This may be the difference between senator-jump (what used to be bound
to c-c , j, and semantic-complete-jump-local, which is now bound to c-c , j.
The algorithm for all these bits are a bit naive in that they just pull
up all the tags and offer them up.
If there is a specific type of filter that you (collectively) want, it
isn't that hard to implement. The semantic completion engine is
architected with 'collectors' and 'displayors'. It sounds like all that
is needed is a new collector type.
I've attached a starter patch for what I'm guessing is the feature you
want. Please tune it and let me know if it does what you are looking for.
Eric
On 05/12/2010 05:40 AM, Tobias Gerdin wrote:
Den Tue, 11 May 2010 09:42:04 -0700
skrev Re: [jdee-users] Flatten/filter the Classes imenu?:
Thanks, Eric. Yes, the keystroke C-c , j is great, though it suffers
from too many hits. One of my Java files has 1200+ matches (tags),
and that's not atypical. Many of those are the import statements,
which I'll never want to navigate to. Many others are method
parameters, which I'll also never want to navigate to.
I use Debian JDEE 2.3.5.1 (based on cedet1.0pre4, I believe) and often
make use of senator-jump (which I've bound to C-c j in JDE mode) while
navigating inside a class. For me the set of completions does not
include method parameters (which I agree would not be that useful) so
it usually works well even in fairly large classes. I find it useful
that it also allows jumping to instance variables (but the import
statements could probably have been omitted, I agree).
-Tobias
------------------------------------------------------------------------------
_______________________________________________
jdee-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jdee-users
*** semantic-complete.el.~1.69.~ 2010-04-08 22:04:30.000000000 -0400
--- semantic-complete.el 2010-05-12 07:26:45.000000000 -0400
***************
*** 1217,1222 ****
--- 1217,1243 ----
"Calculate the completions for prefix from completionlist."
(semanticdb-brute-deep-find-tags-for-completion prefix (oref obj path)))
+ ;;; Current Datatype member search.
+ (defclass semantic-collector-local-members (semantic-collector-project-abstract)
+ ((scope :initform nil
+ :type (or null semantic-scope-cache)
+ :documentation
+ "The scope the local members are being completed from."))
+ "Completion engine for tags in a project.")
+
+ (defmethod semantic-collector-calculate-completions-raw
+ ((obj semantic-collector-local-members) prefix completionlist)
+ "Calculate the completions for prefix from completionlist."
+ (let* ((scope (or (oref obj scope)
+ (oset obj scope (semantic-calculate-scope))))
+ (localstuff (oref scope scope)))
+ (list
+ (cons
+ (oref scope :table)
+ (semantic-find-tags-for-completion prefix localstuff)))))
+ ;(semanticdb-brute-deep-find-tags-for-completion prefix (oref obj path))))
+
+ ;;; Smart completion collector
(defclass semantic-collector-analyze-completions (semantic-collector-abstract)
((context :initarg :context
:type semantic-analyze-context
***************
*** 1813,1818 ****
--- 1834,1862 ----
)
;;;###autoload
+ (defun semantic-complete-read-tag-local-members (prompt &optional
+ default-tag
+ initial-input
+ history)
+ "Ask for a tag by name from the local type members.
+ Available tags are from the the current scope.
+ Completion options are presented in a traditional way, with highlighting
+ to resolve same-name collisions.
+ PROMPT is a string to prompt with.
+ DEFAULT-TAG is a semantic tag or string to use as the default value.
+ If INITIAL-INPUT is non-nil, insert it in the minibuffer initially.
+ HISTORY is a symbol representing a variable to store the history in."
+ (semantic-complete-read-tag-engine
+ (semantic-collector-local-members prompt :buffer (current-buffer))
+ (semantic-displayor-traditional-with-focus-highlight "simple")
+ ;;(semantic-displayor-tooltip "simple")
+ prompt
+ default-tag
+ initial-input
+ history)
+ )
+
+ ;;;###autoload
(defun semantic-complete-read-tag-project (prompt &optional
default-tag
initial-input
***************
*** 2033,2038 ****
--- 2077,2095 ----
(semantic-tag-name tag)))))
;;;###autoload
+ (defun semantic-complete-jump-local-members ()
+ "Jump to a semantic symbol."
+ (interactive)
+ (let ((tag (semantic-complete-read-tag-local-members "Jump to symbol: ")))
+ (when (semantic-tag-p tag)
+ (push-mark)
+ (goto-char (semantic-tag-start tag))
+ (semantic-momentary-highlight-tag tag)
+ (working-message "%S: %s "
+ (semantic-tag-class tag)
+ (semantic-tag-name tag)))))
+
+ ;;;###autoload
(defun semantic-complete-analyze-and-replace ()
"Perform prompt completion to do in buffer completion.
`semantic-analyze-possible-completions' is used to determine the
------------------------------------------------------------------------------
_______________________________________________
jdee-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jdee-users