views:

53

answers:

1

Hi,

I have been developing a plugin for Eclipse. The plugin has a couple of views that need to update when the caret moves in the active editor to reflect the outer method.

Currently, I am getting an ASTNode that represents the outer method using the ASTParser class on the whole source for the file and then traversing its hierarchy until I find the outer method. This works OK for moderate sized code files but is understandably slower for very large code files.

I wondered if there is an inbuilt function that can give me a representation of the outer method that may be more effient than my current approach? I have looked high and low, but perhaps I am looking in the wrong places.

Thanks in advance for any help, Alan

A: 

Hi,

I just wanted to give an update on this issue in case it helps anyone else.

I gave up trying to find a direct entry point to the code for the method where the caret is. This then led me to develop an algorithm to parse the code surrounding the caret position. This was adequite for my own needs and drew a close to days of searching Google for a solution.

Alan

Alan Spark