Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

shortcut to implement/override methods from the completion menu

  • Loading branch information...
commit 5b06569735041d6b95bff1800bdaf7260ca2295d 1 parent cf8fb36
@fred-o fred-o authored
Showing with 17 additions and 13 deletions.
  1. +17 −13 eclim-completion.el
View
30 eclim-completion.el
@@ -158,19 +158,23 @@ buffer."
(defun eclim--completion-action-java ()
(let* ((end (point))
(completion (buffer-substring-no-properties eclim--completion-start end)))
- (if (string-match "\\([^-:]+\\) .*?\\(- *\\(.*\\)\\)?" completion)
- (let* ((insertion (match-string 1 completion))
- (rest (match-string 3 completion))
- (package (if (and rest (string-match "\\w+\\(\\.\\w+\\)*" rest)) rest nil))
- (template (eclim--completion-yasnippet-convert insertion)))
- (delete-region eclim--completion-start end)
- (if (and eclim-use-yasnippet template (featurep 'yasnippet))
- (yas/expand-snippet template)
- (insert insertion))
- (when package
- (eclim-java-import
- (concat package "." (substring insertion 0 (or (string-match "[<(]" insertion)
- (length insertion))))))))))
+ (cond ((string-match "\\(.*?\\) :.*- Override method" completion)
+ (let ((sig (eclim--java-parse-method-signature (match-string 1 completion))))
+ (delete-region eclim--completion-start end)
+ (eclim-java-implement (symbol-name (assoc-default :name sig)))))
+ ((string-match "\\([^-:]+\\) .*?\\(- *\\(.*\\)\\)?" completion)
+ (let* ((insertion (match-string 1 completion))
+ (rest (match-string 3 completion))
+ (package (if (and rest (string-match "\\w+\\(\\.\\w+\\)*" rest)) rest nil))
+ (template (eclim--completion-yasnippet-convert insertion)))
+ (delete-region eclim--completion-start end)
+ (if (and eclim-use-yasnippet template (featurep 'yasnippet))
+ (yas/expand-snippet template)
+ (insert insertion))
+ (when package
+ (eclim-java-import
+ (concat package "." (substring insertion 0 (or (string-match "[<(]" insertion)
+ (length insertion)))))))))))
(defun eclim--completion-action-xml ()
(when (string-match "[\n[:blank:]]" (char-to-string (char-before eclim--completion-start)))
Please sign in to comment.
Something went wrong with that request. Please try again.