Hi,
I had this problem that with several large java classes the
jde-debug-toggle-breakpoint function didn't work and tried to set
breakpoints like ":434" instead of "Myclass:434". I traced the problem
to the c-parse-state function used in
jde-parse-get-innermost-class-at-point function. Apparently
c-parse-state has some issues with big classes (CC mode version
5.31.5): sometimes it "forgets" to return the opening class parenthesis
position (especially when you go towards the end of the buffer).
Here's my attempt to workaround this in jdee (I gave up trying to find what the problem is in cc-mode):
(defun jde-parse-get-innermost-class-at-point ()
"Get the innermost class containing point.
If point is in a class, this function returns
(CLASS_NAME . CLASS_POSITION). CLASS_NAME is the
name of the class. For anonymous classes it is
the unqualified name of the superclass. CLASS_POSITION
is the position of the first character of the class
or interface keyword or the first character
of the new keyword in case of anonymous classes.
Returns nil, if point is not in a class."
(let ((tag (semantic-current-tag-of-class 'type)))
(if tag
(let* (
;; (class-name (semantic-tag-name tag))
(class-pos (semantic-tag-start tag))
(block-pos (save-excursion
(goto-char class-pos)
;; This could be problematic in case a comment is embedded in the class declaration
(search-forward "{")
(backward-char)
(point))))
(if (and class-pos (> (point) block-pos))
(save-excursion
(goto-char block-pos)
(re-search-backward jde-parse-class-decl-re class-pos t)
(cons (match-string-no-properties 2)
(match-beginning 1))))))))
I also had to change jde-parse-class-decl-re like this:
(defconst jde-parse-class-decl-re
(concat
;;; "^"
;;; ;; comments, string literals, keywords, identifier,
;;; ;; assignment operator or open parenthese:
;;; "\\(?:" jde-parse-java-comment-or-ws-re "\\|[a-zA-Z0-9_.=(]\\)*"
;;;jde-parse-class-mod-re
;; keyword before classname:
"\\<\\(class\\|interface\\|new\\)"
"\\(?:" jde-parse-java-comment-or-ws-re "\\)+"
;; package part of superclass of anonymous class:
"\\(?:[a-zA-Z0-9_]+\\.\\)*"
;; classname:
"\\([a-zA-Z0-9_]+\\)"
;; everything between classname and curly brace:
"\\(?:" jde-parse-java-comment-or-ws-re "\\|[a-zA-Z0-9_.,()]\\)*"
"\\=")
"Regular expression matching class declarations before point.
Point must be at opening curly brace of class.
It matches interfaces, named and anonymous classes.")
It did the trick in my case.
_____________________________________________________________________________
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr
|