Skip to content

Refactor logic in generation text edits for array element deletion#291

Merged
KavinduZoysa merged 2 commits intoballerina-platform:1.2.xfrom
pasindufernando1:deleteMappingIssue1170
Sep 8, 2025
Merged

Refactor logic in generation text edits for array element deletion#291
KavinduZoysa merged 2 commits intoballerina-platform:1.2.xfrom
pasindufernando1:deleteMappingIssue1170

Conversation

@pasindufernando1
Copy link
Contributor

Copilot AI review requested due to automatic review settings September 8, 2025 07:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the logic for generating text edits when deleting array elements from mappings. The main purpose is to fix incorrect positioning when determining the text range to delete for array elements that are not at the beginning or end of the array.

  • Fixed incorrect start position calculation for deleting middle and last array elements
  • Added comprehensive test cases to validate array element deletion scenarios

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
DataMapManager.java Fixed text edit range calculation by using endLine() instead of startLine() for previous element positioning
variable5.bal Added test source file with array type definitions and initialization
variable6.json Added test configuration for deleting middle array element (index 1)
variable7.json Added test configuration for deleting last array element (index 2)
DataMappingDeleteTest.java Added new test cases to the configuration list

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@KavinduZoysa KavinduZoysa merged commit 5859137 into ballerina-platform:1.2.x Sep 8, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants