Autocompletion inserts too much into the buffer

38 views
Skip to first unread message

joost.m...@gmail.com

unread,
Jul 6, 2015, 8:08:14 PM7/6/15
to emacs...@googlegroups.com
Hi,

I've recently started learning Java and set up emacs-eclim to be able to write my code in Emacs. Everything seems to be working just fine, except for one annoying thing. When completing variables, the annotation that appears in the popup is also put in the buffer. For example, if I type mt1.thr, where mt1 is an object with an instance variable thrd, completion will display a popup with the text

mt1.thrd : Thread - MyThread

in it, telling me the name of the variable, its type (Thread) and the class it's defined in (MyThread). Selecting the completion option should only insert mt1.thrd into the buffer, but it actually inserts the entire text.

Completion works fine if a method name is completed. If I type e.g., System.out.pri, I get a popup listing (among others):

System.out.print(Object obj) : void - PrintStream

Selecting this candidate inserts only the method name and its argument as an editable field. The part about the return type and defining class is not inserted into the buffer.

I looked at the code of company-eclim.el and company-template.el and it seems that Emacs is looking for a closing parenthesis to determine where the annotation starts. Since variables do not have parentheses, this doesn't work. (Though I may of course be wrong about this, I didn't dig very deep.)

I'm using company for completion, but I've tried autocomplete as well, with similar problems.

Some info: I'm using Elementary OS Luna, which isbased on Ubuntu 12.04, Emacs 24.5.1 (compiled from source), emacs-eclim 20150703.651 (installed from MELPA), eclim 2.4.1 and Eclipse 4.4.2 (Luna).

Note that the same problem seems to have been reported as a Github issue (#148 and #193), So I don't seem to be alone on this.

Anyone have a clue what's wrong here? Is this a bug or did I mess up my configuration?

TIA

Joost

Reply all
Reply to author
Forward
0 new messages