ervandew/eclim — pull request #360 by dhleong (2014-10-02 02:02:25+00:00)
Title: Android XML completion

This PR adds some semi-competent completion for Android XML files via the ADT plugin. It is unfortunately hacky, relying on some reflection and some copying of code from ADT source, etc. (though the latter is mostly to avoid using private methods via reflection, which seems more likely to break in an update than the others.

If you have any thoughts on reducing coupling (IE: to prevent everything from exploding if Google releases a new ADT that breaks all the things), or really any ideas for improvement, I'm definitely open to suggestions. I tried to follow existing work for JDT and pydev and CDT as guidelines for what you might find acceptable.

Known issue: Though most attributes seem to be suggested as expected, it refuses to propose `android:layout_width` and friends, as well as their values. I'm at a loss as to why; I've waded through a lot of ADT code, but I'm not super familiar with the completion APIs, so perhaps there's some crucial binding-to-the-project bit that I'm missing. The weirdest part is that the `LayoutContentAssist` class doesn't seem to even be attempting to propose these things—it only seems to want to propose the element names and FQNs for EG the `` things. I compensated a little bit by mixing in some hacks around the `ValuesContentAssist`, but of course those aren't filtered by which apply to the current View, so it's less than ideal....