-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41170 from KavinduZoysa/fix-issue-40614
Add create function CA for var type decleration and select-expr
- Loading branch information
Showing
16 changed files
with
461 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 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
57 changes: 57 additions & 0 deletions
57
...e/src/test/resources/codeaction/create-function/config/undefinedFunctionCodeAction25.json
This file contains 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,57 @@ | ||
{ | ||
"position": { | ||
"line": 1, | ||
"character": 52 | ||
}, | ||
"source": "createUndefinedFunction14.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create function 'toUpperCase(...)'", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 2, | ||
"character": 1 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"character": 1 | ||
} | ||
}, | ||
"newText": "\n\nfunction toUpperCase(string letter) returns any|error {\n return ;\n}" | ||
} | ||
], | ||
"resolvable": true, | ||
"data": { | ||
"extName": "org.ballerinalang.langserver.codeaction.BallerinaCodeActionExtension", | ||
"codeActionName": "Create Function", | ||
"fileUri": "createUndefinedFunction14.bal", | ||
"range": { | ||
"start": { | ||
"line": 1, | ||
"character": 46 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"character": 65 | ||
} | ||
}, | ||
"actionData": { | ||
"key": "node.range", | ||
"value": { | ||
"start": { | ||
"line": 1.0, | ||
"character": 46.0 | ||
}, | ||
"end": { | ||
"line": 1.0, | ||
"character": 65.0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
57 changes: 57 additions & 0 deletions
57
...e/src/test/resources/codeaction/create-function/config/undefinedFunctionCodeAction26.json
This file contains 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,57 @@ | ||
{ | ||
"position": { | ||
"line": 1, | ||
"character": 54 | ||
}, | ||
"source": "createUndefinedFunction15.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create function 'toUpperCase(...)'", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 2, | ||
"character": 1 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"character": 1 | ||
} | ||
}, | ||
"newText": "\n\nfunction toUpperCase(string letter) returns int {\n return 0;\n}" | ||
} | ||
], | ||
"resolvable": true, | ||
"data": { | ||
"extName": "org.ballerinalang.langserver.codeaction.BallerinaCodeActionExtension", | ||
"codeActionName": "Create Function", | ||
"fileUri": "createUndefinedFunction15.bal", | ||
"range": { | ||
"start": { | ||
"line": 1, | ||
"character": 48 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"character": 67 | ||
} | ||
}, | ||
"actionData": { | ||
"key": "node.range", | ||
"value": { | ||
"start": { | ||
"line": 1.0, | ||
"character": 48.0 | ||
}, | ||
"end": { | ||
"line": 1.0, | ||
"character": 67.0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
57 changes: 57 additions & 0 deletions
57
...e/src/test/resources/codeaction/create-function/config/undefinedFunctionCodeAction27.json
This file contains 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,57 @@ | ||
{ | ||
"position": { | ||
"line": 1, | ||
"character": 18 | ||
}, | ||
"source": "createUndefinedFunction16.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create function 'toUpperCase(...)'", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 2, | ||
"character": 1 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"character": 1 | ||
} | ||
}, | ||
"newText": "\n\nfunction toUpperCase(any a) returns any|error {\n return ;\n}" | ||
} | ||
], | ||
"resolvable": true, | ||
"data": { | ||
"extName": "org.ballerinalang.langserver.codeaction.BallerinaCodeActionExtension", | ||
"codeActionName": "Create Function", | ||
"fileUri": "createUndefinedFunction16.bal", | ||
"range": { | ||
"start": { | ||
"line": 1, | ||
"character": 11 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"character": 30 | ||
} | ||
}, | ||
"actionData": { | ||
"key": "node.range", | ||
"value": { | ||
"start": { | ||
"line": 1.0, | ||
"character": 11.0 | ||
}, | ||
"end": { | ||
"line": 1.0, | ||
"character": 30.0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
57 changes: 57 additions & 0 deletions
57
...e/src/test/resources/codeaction/create-function/config/undefinedFunctionCodeAction28.json
This file contains 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,57 @@ | ||
{ | ||
"position": { | ||
"line": 0, | ||
"character": 16 | ||
}, | ||
"source": "createUndefinedFunction17.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create function 'toUpperCase(...)'", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 28 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 28 | ||
} | ||
}, | ||
"newText": "\n\nfunction toUpperCase(any a) returns any|error {\n return ;\n}" | ||
} | ||
], | ||
"resolvable": true, | ||
"data": { | ||
"extName": "org.ballerinalang.langserver.codeaction.BallerinaCodeActionExtension", | ||
"codeActionName": "Create Function", | ||
"fileUri": "createUndefinedFunction17.bal", | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 8 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 27 | ||
} | ||
}, | ||
"actionData": { | ||
"key": "node.range", | ||
"value": { | ||
"start": { | ||
"line": 0.0, | ||
"character": 8.0 | ||
}, | ||
"end": { | ||
"line": 0.0, | ||
"character": 27.0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
57 changes: 57 additions & 0 deletions
57
...e/src/test/resources/codeaction/create-function/config/undefinedFunctionCodeAction29.json
This file contains 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,57 @@ | ||
{ | ||
"position": { | ||
"line": 0, | ||
"character": 50 | ||
}, | ||
"source": "createUndefinedFunction18.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create function 'toUpperCase(...)'", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 64 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 64 | ||
} | ||
}, | ||
"newText": "\n\nfunction toUpperCase(string letter) returns int {\n return 0;\n}" | ||
} | ||
], | ||
"resolvable": true, | ||
"data": { | ||
"extName": "org.ballerinalang.langserver.codeaction.BallerinaCodeActionExtension", | ||
"codeActionName": "Create Function", | ||
"fileUri": "createUndefinedFunction18.bal", | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 44 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 63 | ||
} | ||
}, | ||
"actionData": { | ||
"key": "node.range", | ||
"value": { | ||
"start": { | ||
"line": 0.0, | ||
"character": 44.0 | ||
}, | ||
"end": { | ||
"line": 0.0, | ||
"character": 63.0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.