jdee
jdee copied to clipboard
Indentation for annotations
Indentation for annotations doesn't work properly.
Do you have an example file where it fails? Indentation for annotations for me is working correctly. I can try to fix it.
It happens when there is a newline separating multiple parameters.
public class Yada {
@AnAnnotation(param1=1,
param2=2)
public void run() {
}
};
I believe this is due to a bug in the function c-guess-basic-syntax that handles Java annotations. Specifically, the listed case 5N should be something like the following. This change changes the syntax so that the indentation will be relative to the start of the entire preceding annotation, not just the prior line of the annotation.
;;CASE 5N: We are at a topmost continuation line and the only
;;preceding items are annotations.
((and (c-major-mode-is 'java-mode)
(setq placeholder (point))
(c-beginning-of-statement-1)
(progn
(while (and (c-forward-annotation))
(c-forward-syntactic-ws))
t)
(prog1
(>= (point) placeholder)
(goto-char placeholder)))
;; (c-add-syntax 'annotation-top-cont (c-point 'boi))
(prog1
(c-add-syntax 'annotation-top-cont (progn (c-beginning-of-statement-1) (point)))
(goto-char placeholder))
)
Bug fixed in future Emacs version. See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22358 for more details.
I am having an issue with default
interface methods. They are being indented to the absolute left.
Where can I find documentation to fix this? Is this a jdee issue at all? Where to ask for help?