Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] ITranslationUnit.getElementAtLine()


Hi,

I'm currently working on a patch for bug# 94203, which adds support to the
outline view for the "Link With Editor" option. I would like to use
ITranslationUnit.getElementAtLine() to determine the element at the current
line in the editor and then select it in the outline view. The javadoc for
this method says that it should return the smallest child element at that
line. However, the implementation in TranslationUnit just finds the first
element at that line and returns it without actually trying to find the
smallest element. This is a problem because, for example, if a field of a
structure is selected in the editor then the root of the structure becomes
selected in the outline view and not the field itself. Does anyone have an
objection if I change the behavior of getElementAtLine() so that it
actually returns the smallest element? I'm worried that I might break
something that depends on the current behavior.

Thanks.


Mike Kucera
IBM CDT Team
IBM Toronto Lab
mkucera@xxxxxxxxxx



Back to the top