I want to find out the line number the call refers to using the AST api in the package. How can i do this?
You have an illustration on how to search in the CompilationUnit method in this papercut article :
for (ICompilationUnit unit : mypackage.getCompilationUnits()) { IType[] types = unit.getTypes(); for (int i = 0; i < types.length; i++) { IType type = types[i]; IMethod[] methods = type.getMethods();
ASTNode.getStartPosition()
CompilationUnit
CompilationUnit.getLineNumber(position)
CompilationUnit.getLineNumber (int position)
in relation to the CompilationUnit object
Documentation:
, . 1, . . , A\n {\n} 3 [0,7], [8,9] [10,10]. -1 -2, .
Source: https://habr.com/ru/post/1731001/More articles:Получение текста под указателем мыши - javascriptIBM MQSeries Accessing Issue from .NET - c #JQuery changes CSS of a child div after cloning - jqueryWhat development tools are available for IBMi (AS / 400, iSeries)? - ibm-midrangeStrange value in exe header - windowsСколько акций на рынке OpenGL2.0 в iPhone от аппаратных средств (iPhone/iPod Touch) - iphoneRegEx helps operators - c #Is there a safe check I can do before calling DateTime.AddMonths (int months)? - c #C function call from DTrace scripts - dtraceWhat the syntax in Java means: new Stream () {...}? - javaAll Articles