Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completing fields adds to much info #193

Closed
kleewho opened this issue Jul 1, 2015 · 7 comments
Closed

Completing fields adds to much info #193

kleewho opened this issue Jul 1, 2015 · 7 comments
Labels
Milestone

Comments

@kleewho
Copy link
Collaborator

kleewho commented Jul 1, 2015

When completing fields there's additional info about it's type added to the buffer. When inserted in buffer it looks like this:

this.field : String - LibraryA

Additional information about it's type and origin is useful in company popup (or completion buffer) but it should be omitted when inserting to buffer. Information about returning type is already removed for completing functions. Steps to reproduce are quite simple. It seems that the only thing to do is to try to complete any field.

@jchochli jchochli added the bug label Jul 2, 2015
@joostkremers
Copy link

This seems related to #148. I have the same problem described there: completion (not just of fields, also function and variable names) inserts all the info given in the popup into the buffer when selecting a completion.

If the completion contains editable fields (such as the arguments of functions), then everything works correctly: only the fields are inserted (the popup usually shows more info) and you can edit the fields. If the info in the popup doesn't contain any fields, everything is inserted and I have to hit (C-)Backspace to remove the superfluous stuff.

I was originally using autocomplete.el, but switched to company.el because someone in #148 said that that solved the problem for them. In my case, though, it's still not working.

Some info:

OS: Elementary OS Luna (based on Ubuntu 12.04)
Emacs 24.5.1
emacs-eclim: 20150703.651 (installed from MELPA)
eclim: 2.4.1
Eclipse: 4.4.2 (Luna)

I’m using yas-minor-mode in my Java buffers.

@kleewho
Copy link
Collaborator Author

kleewho commented Jul 5, 2015

@joostkremers Thanks for the info. Do you know the way to reproduce popup without info you mentioned?

@joostkremers
Copy link

No, I don't, unfortunately.

@joostkremers
Copy link

I disabled emacs-eclim's own company-mode extensions and am using the default eclim backend provided by the company.el package. It's not as nice (there are no annotations for variables and classes, for example), but at least it doesn't insert too much text into the buffer.

@bbelleville
Copy link
Contributor

The reason for this bug is that company-emacs-eclim-action was only being called if the completion had an annotation. With my pull request it will always be called, and both the length of the completion and the annotation are used to determine beg and end passed to eclim--completion-action. I tested my proposed fix completing methods and fields in various scenarios using company mode, and everything seemed to be working correctly.

@kleewho
Copy link
Collaborator Author

kleewho commented Jul 9, 2015

So it was me who introduced this bug. Good to know. Thanks!

@jchochli jchochli closed this as completed Jul 9, 2015
@jchochli jchochli added this to the 0.3 milestone Jul 9, 2015
@joostkremers
Copy link

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants