-
Notifications
You must be signed in to change notification settings - Fork 36
Handle entire expression deletion in select and root expressions #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
KavinduZoysa
merged 5 commits into
ballerina-platform:1.2.x
from
pasindufernando1:deleteMappingIssue1069
Sep 9, 2025
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
74b99e5
Handle entire root expression deletion in the reusable data mapper
pasindufernando1 5967d07
Merge remote-tracking branch 'upstream/1.2.x' into deleteMappingIssue…
pasindufernando1 9c86b4f
Handle entire expression deletion of a select clause
pasindufernando1 55edc6e
Fix checkstyle issues
pasindufernando1 7c42287
Address PR suggestion
pasindufernando1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...flow-model-generator-ls-extension/src/test/resources/delete_mapping/config/variable8.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| { | ||
| "source": "variable6.bal", | ||
| "description": "", | ||
| "codedata": { | ||
| "node": "VARIABLE", | ||
| "lineRange": { | ||
| "fileName": "variable6.bal", | ||
| "startLine": { | ||
| "line": 10, | ||
| "offset": 0 | ||
| }, | ||
| "endLine": { | ||
| "line": 10, | ||
| "offset": 52 | ||
| } | ||
| } | ||
| }, | ||
| "mapping": { | ||
| "output": "name", | ||
| "inputs": [ | ||
| "arr1" | ||
| ], | ||
| "expression": "arr1", | ||
| "diagnostics": [], | ||
| "elements": [] | ||
| }, | ||
| "targetField": "name", | ||
| "output": { | ||
| "variable6.bal": [ | ||
| { | ||
| "range": { | ||
| "start": { | ||
| "line": 10, | ||
| "character": 47 | ||
| }, | ||
| "end": { | ||
| "line": 10, | ||
| "character": 51 | ||
| } | ||
| }, | ||
| "newText": "{}" | ||
| } | ||
| ] | ||
| } | ||
| } |
47 changes: 47 additions & 0 deletions
47
...flow-model-generator-ls-extension/src/test/resources/delete_mapping/config/variable9.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| { | ||
| "source": "variable6.bal", | ||
| "description": "", | ||
| "codedata": { | ||
| "node": "VARIABLE", | ||
| "lineRange": { | ||
| "fileName": "variable6.bal", | ||
| "startLine": { | ||
| "line": 17, | ||
| "offset": 12 | ||
| }, | ||
| "endLine": { | ||
| "line": 20, | ||
| "offset": 14 | ||
| } | ||
| } | ||
| }, | ||
| "mapping": { | ||
| "output": "rec", | ||
| "inputs": [ | ||
| "recItem" | ||
| ], | ||
| "expression": "recItem\n", | ||
| "diagnostics": [], | ||
| "elements": [], | ||
| "isQueryExpression": false, | ||
| "isFunctionCall": false | ||
| }, | ||
| "targetField": "v2.rec", | ||
| "output": { | ||
| "variable6.bal": [ | ||
| { | ||
| "range": { | ||
| "start": { | ||
| "line": 19, | ||
| "character": 27 | ||
| }, | ||
| "end": { | ||
| "line": 19, | ||
| "character": 34 | ||
| } | ||
| }, | ||
| "newText": "{}" | ||
| } | ||
| ] | ||
| } | ||
| } |
26 changes: 26 additions & 0 deletions
26
.../flow-model-generator-ls-extension/src/test/resources/delete_mapping/source/variable6.bal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| import ballerina/http; | ||
|
|
||
| type RecType record {| | ||
| int i; | ||
| |}; | ||
|
|
||
| type ArrType record {| | ||
| RecType[] rec; | ||
| |}; | ||
|
|
||
| function name(ArrType arr1) returns ArrType => arr1; | ||
|
|
||
| service OASServiceType on new http:Listener(9090) { | ||
|
|
||
| resource function get pet() returns int|http:NotFound { | ||
| do { | ||
| ArrType v1 = {}; | ||
| ArrType v2 = { | ||
| rec: from var recItem in v1.rec | ||
| select recItem | ||
| }; | ||
| } on fail error e { | ||
| return http:NOT_FOUND; | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.