summaryrefslogtreecommitdiff
path: root/lisp/cedet/semantic/java.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-10-02 02:10:29 +0800
committerChong Yidong <cyd@gnu.org>2012-10-02 02:10:29 +0800
commit62a81506f802e4824b718cc30321ee3a0057cdf7 (patch)
treed681d7b767b1c3f7e4aee24ce39f6bef0d7f1f7e /lisp/cedet/semantic/java.el
parentb3317662acc0157406c20c8e14c43b7126eaa8a0 (diff)
downloademacs-62a81506f802e4824b718cc30321ee3a0057cdf7.tar.gz
Update CEDET from upstream.
Diffstat (limited to 'lisp/cedet/semantic/java.el')
-rw-r--r--lisp/cedet/semantic/java.el26
1 files changed, 24 insertions, 2 deletions
diff --git a/lisp/cedet/semantic/java.el b/lisp/cedet/semantic/java.el
index 8747d793ab8..e560e6ecab2 100644
--- a/lisp/cedet/semantic/java.el
+++ b/lisp/cedet/semantic/java.el
@@ -121,6 +121,7 @@ corresponding compound declaration."
(setq clone (semantic-tag-clone tag (car dim))
xpand (cons clone xpand))
(semantic-tag-put-attribute clone :dereference (cdr dim)))
+
((eq class 'variable)
(or (consp elts) (setq elts (list (list elts))))
(setq dim (semantic-java-dim (semantic-tag-get-attribute tag :type))
@@ -139,7 +140,20 @@ corresponding compound declaration."
(semantic-tag-put-attribute clone :type type)
(semantic-tag-put-attribute clone :dereference (+ dim0 (cdr dim)))
(semantic-tag-set-bounds clone start end)))
- )
+
+ ((and (eq class 'type) (string-match "\\." (semantic-tag-name tag)))
+ ;; javap outputs files where the package name is stuck onto the class or interface
+ ;; name. To make this more regular, we extract the package name into a package statement,
+ ;; then make the class name regular.
+ (let* ((name (semantic-tag-name tag))
+ (rsplit (nreverse (split-string name "\\." t)))
+ (newclassname (car rsplit))
+ (newpkg (mapconcat 'identity (reverse (cdr rsplit)) ".")))
+ (semantic-tag-set-name tag newclassname)
+ (setq xpand
+ (list tag
+ (semantic-tag-new-package newpkg nil))))
+ ))
xpand))
;;; Environment
@@ -159,6 +173,15 @@ corresponding compound declaration."
(semantic-find-tags-by-class
'type (semantic-find-tag-by-overlay point))))
+;; Tag Protection
+;;
+(define-mode-local-override semantic-tag-protection
+ java-mode (tag &optional parent)
+ "Return the protection of TAG in PARENT.
+Override function for `semantic-tag-protection'."
+ (let ((prot (semantic-tag-protection-default tag parent)))
+ (or prot 'package)))
+
;; Prototype handler
;;
(defun semantic-java-prototype-function (tag &optional parent color)
@@ -242,7 +265,6 @@ Optional argument COLOR indicates that color should be mixed in."
(let ((name (semantic-tag-name tag)))
(concat (mapconcat 'identity (split-string name "\\.") "/") ".java")))
-
;; Documentation handler
;;
(defsubst semantic-java-skip-spaces-backward ()