java - I need to be able to find the line number and method name in eclipse -
i trying find line number , function name of current function cursor located in. need pass information function later processing.
here few more details. editor ceditor. have plugin use data. need display current function , line number starts on. if function xyz starts on line number 5 , user typing in function on line 8. need xyz , line 5.
i programing in java user writing in c/c++.
sorry noticed missed lot of details. building , eclipse plugin needs method user's cursor in. when using ceditor cdt addon.
the documentation cdt (c development tools) api here. cdt supports "dom" (document object model) can walk through learn document being edited. need ahold of itranslationunit object edited document, call getelementatline() icelement object describing code @ given line number. icelement root of big hierarchy of subclasses describe various c language elements.
you can itranslationunit calling coremodelutil.findtranslationunit(), takes ifile parameter.
Comments
Post a Comment