Skip to content

Lexical preserving code attribute and new code list start attribute in callables#135

Merged
rahlk merged 2 commits into
mainfrom
code-startline-and-lexical-preserve
Jun 1, 2025
Merged

Lexical preserving code attribute and new code list start attribute in callables#135
rahlk merged 2 commits into
mainfrom
code-startline-and-lexical-preserve

Conversation

@sinha108
Copy link
Copy Markdown
Collaborator

Motivation and Context

This PR makes two changes. First, it updates the code attribute for callables and initializers to be lexical preserving (thus, not discarding blank lines), which ensures that relative line numbers within a code block with respect to the start of the code block can be used accurately. Second, the PR adds the codeStartLine attribute to callables so that determining the start line of a code block does not require the application of heuristics on callable start line handling the formatting of callable annotations and declaration.

How Has This Been Tested?

Tested with sample code and checked the updates attributes.

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the Codellm-Devkit Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

…ing manner

(so blank lines are not discarded); added codeStartLine attribute to callables

Signed-off-by: Saurabh Sinha <sinha108@gmail.com>
@sinha108 sinha108 requested a review from rahlk May 31, 2025 01:22
Signed-off-by: Saurabh Sinha <sinha108@gmail.com>
@rahlk rahlk merged commit bcd58a6 into main Jun 1, 2025
@sinha108 sinha108 added the kind/feature Feature label Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants