]> code.delx.au - gnu-emacs-elpa/commitdiff
company-eclim: Get valid completions just after an opening paren
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 26 Mar 2013 04:18:00 +0000 (08:18 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 26 Mar 2013 04:34:23 +0000 (08:34 +0400)
NEWS.md
company-eclim.el

diff --git a/NEWS.md b/NEWS.md
index ebb0dc6e2c0d2f7efe5dd6750aeed1c808ee2672..2aced04d48f308539bc013ca37fa6a20f9b91489 100644 (file)
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,6 +2,7 @@
 
 ## 2013-03-26 (0.6.4)
 
+* `company-eclim` shows valid completions after an opening paren.
 * Expanded template does not get removed until the point leaves it.  After your
   input the last argument in a method call expanded by `company-eclim`, you can
   press `<tab>` once more, to jump after the closing paren.  No other bundled
index b0444c08f81039010aa2d40b7bb379bddb0fdaa3..b9ac24207f173d8bf731aa7ce332d721accd1528 100644 (file)
@@ -120,7 +120,8 @@ eclim can only complete correctly when the buffer has been saved."
                               (company-eclim--call-process
                                "java_complete" "-p" (company-eclim--project-name)
                                "-f" project-file
-                               "-o" (number-to-string (1- (point)))
+                               "-o" (number-to-string
+                                     (company-eclim--search-point prefix))
                                "-e" "utf-8"
                                "-l" "standard"))))
       (let* ((meta (cdr (assoc 'info item)))
@@ -131,6 +132,11 @@ eclim can only complete correctly when the buffer has been saved."
   (let ((completion-ignore-case nil))
     (all-completions prefix company-eclim--doc)))
 
+(defun company-eclim--search-point (prefix)
+  (if (or (plusp (length prefix)) (eq (char-before) ?.))
+      (1- (point))
+    (point)))
+
 (defun company-eclim--meta (candidate)
   (gethash candidate company-eclim--doc))