Description
Is your feature request related to a problem? Please describe
Need to capture source code position information (line/column) for parameters in method declarations to enable precise source code navigation and analysis.
Describe the solution you'd like
Add position tracking fields to ParameterInCallable class:
- startLine: Starting line number
- endLine: Ending line number
- startCol: Starting column number
- endCol: Ending column number
Current implementation:
@Data
public class ParameterInCallable {
private String type;
private String name;
private List<String> annotations;
private List<String> modifiers;
}
Proposed implementation:
@Data
public class ParameterInCallable {
private String type;
private String name;
private List<String> annotations;
private List<String> modifiers;
private int startLine;
private int endLine;
private int startCol;
private int endCol;
}
// Usage in parameter processing:
private static ParameterInCallable processParameterDeclaration(Parameter paramDecl) {
ParameterInCallable parameter = new ParameterInCallable();
paramDecl.getBegin().ifPresent(position -> {
parameter.setStartLine(position.line);
parameter.setStartCol(position.column);
});
paramDecl.getEnd().ifPresent(position -> {
parameter.setEndLine(position.line);
parameter.setEndCol(position.column);
});
// ... rest of processing
return parameter;
}
Describe alternatives you've considered
- Store positions as a separate object/map
- Track only line numbers without columns
- Track only start positions without end positions
Direct field storage in ParameterInCallable
provides the clearest and most maintainable solution that can be consumed by CLDK downstream.
Additional context
Implementation requires minor changes:
- Add position fields to ParameterInCallable class
- Update processParameterDeclaration to populate positions from JavaParser Position objects
- Update related tests