-
Notifications
You must be signed in to change notification settings - Fork 758
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 #42093 from nipunayf/fix-42013
Support `create function` CA for workers and explicitly defined anonymous functions
- Loading branch information
Showing
14 changed files
with
654 additions
and
3 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
...es/codeaction/create-function/config/create_function_in_explicit_anonymous_function1.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": 4, | ||
"character": 16 | ||
}, | ||
"source": "create_function_in_explicit_anonymous_function.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create function 'foo(...)'", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 25, | ||
"character": 1 | ||
}, | ||
"end": { | ||
"line": 25, | ||
"character": 1 | ||
} | ||
}, | ||
"newText": "\n\nfunction foo() returns int {\n return 0;\n}" | ||
} | ||
], | ||
"resolvable": true, | ||
"data": { | ||
"extName": "org.ballerinalang.langserver.codeaction.BallerinaCodeActionExtension", | ||
"codeActionName": "Create Function", | ||
"fileUri": "create_function_in_explicit_anonymous_function.bal", | ||
"range": { | ||
"start": { | ||
"line": 4, | ||
"character": 15 | ||
}, | ||
"end": { | ||
"line": 4, | ||
"character": 20 | ||
} | ||
}, | ||
"actionData": { | ||
"key": "node.range", | ||
"value": { | ||
"start": { | ||
"line": 4.0, | ||
"character": 15.0 | ||
}, | ||
"end": { | ||
"line": 4.0, | ||
"character": 20.0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
57 changes: 57 additions & 0 deletions
57
...es/codeaction/create-function/config/create_function_in_explicit_anonymous_function2.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": 8, | ||
"character": 10 | ||
}, | ||
"source": "create_function_in_explicit_anonymous_function.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create function 'foo(...)'", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 25, | ||
"character": 1 | ||
}, | ||
"end": { | ||
"line": 25, | ||
"character": 1 | ||
} | ||
}, | ||
"newText": "\n\nfunction foo(int i) {\n \n}" | ||
} | ||
], | ||
"resolvable": true, | ||
"data": { | ||
"extName": "org.ballerinalang.langserver.codeaction.BallerinaCodeActionExtension", | ||
"codeActionName": "Create Function", | ||
"fileUri": "create_function_in_explicit_anonymous_function.bal", | ||
"range": { | ||
"start": { | ||
"line": 8, | ||
"character": 8 | ||
}, | ||
"end": { | ||
"line": 8, | ||
"character": 15 | ||
} | ||
}, | ||
"actionData": { | ||
"key": "node.range", | ||
"value": { | ||
"start": { | ||
"line": 8.0, | ||
"character": 8.0 | ||
}, | ||
"end": { | ||
"line": 8.0, | ||
"character": 15.0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
57 changes: 57 additions & 0 deletions
57
...es/codeaction/create-function/config/create_function_in_explicit_anonymous_function3.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": 13, | ||
"character": 17 | ||
}, | ||
"source": "create_function_in_explicit_anonymous_function.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create function 'foo(...)'", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 25, | ||
"character": 1 | ||
}, | ||
"end": { | ||
"line": 25, | ||
"character": 1 | ||
} | ||
}, | ||
"newText": "\n\nfunction foo() {\n \n}" | ||
} | ||
], | ||
"resolvable": true, | ||
"data": { | ||
"extName": "org.ballerinalang.langserver.codeaction.BallerinaCodeActionExtension", | ||
"codeActionName": "Create Function", | ||
"fileUri": "create_function_in_explicit_anonymous_function.bal", | ||
"range": { | ||
"start": { | ||
"line": 13, | ||
"character": 15 | ||
}, | ||
"end": { | ||
"line": 13, | ||
"character": 20 | ||
} | ||
}, | ||
"actionData": { | ||
"key": "node.range", | ||
"value": { | ||
"start": { | ||
"line": 13.0, | ||
"character": 15.0 | ||
}, | ||
"end": { | ||
"line": 13.0, | ||
"character": 20.0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
57 changes: 57 additions & 0 deletions
57
...es/codeaction/create-function/config/create_function_in_explicit_anonymous_function4.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": 17, | ||
"character": 17 | ||
}, | ||
"source": "create_function_in_explicit_anonymous_function.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create function 'foo(...)'", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 25, | ||
"character": 1 | ||
}, | ||
"end": { | ||
"line": 25, | ||
"character": 1 | ||
} | ||
}, | ||
"newText": "\n\nfunction foo() returns module1:TestRecord2 {\n return {};\n}" | ||
} | ||
], | ||
"resolvable": true, | ||
"data": { | ||
"extName": "org.ballerinalang.langserver.codeaction.BallerinaCodeActionExtension", | ||
"codeActionName": "Create Function", | ||
"fileUri": "create_function_in_explicit_anonymous_function.bal", | ||
"range": { | ||
"start": { | ||
"line": 17, | ||
"character": 15 | ||
}, | ||
"end": { | ||
"line": 17, | ||
"character": 20 | ||
} | ||
}, | ||
"actionData": { | ||
"key": "node.range", | ||
"value": { | ||
"start": { | ||
"line": 17.0, | ||
"character": 15.0 | ||
}, | ||
"end": { | ||
"line": 17.0, | ||
"character": 20.0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
57 changes: 57 additions & 0 deletions
57
...es/codeaction/create-function/config/create_function_in_explicit_anonymous_function5.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": 22, | ||
"character": 22 | ||
}, | ||
"source": "create_function_in_explicit_anonymous_function.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create function 'foo(...)'", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 25, | ||
"character": 1 | ||
}, | ||
"end": { | ||
"line": 25, | ||
"character": 1 | ||
} | ||
}, | ||
"newText": "\n\nfunction foo() returns int {\n return 0;\n}" | ||
} | ||
], | ||
"resolvable": true, | ||
"data": { | ||
"extName": "org.ballerinalang.langserver.codeaction.BallerinaCodeActionExtension", | ||
"codeActionName": "Create Function", | ||
"fileUri": "create_function_in_explicit_anonymous_function.bal", | ||
"range": { | ||
"start": { | ||
"line": 22, | ||
"character": 19 | ||
}, | ||
"end": { | ||
"line": 22, | ||
"character": 24 | ||
} | ||
}, | ||
"actionData": { | ||
"key": "node.range", | ||
"value": { | ||
"start": { | ||
"line": 22.0, | ||
"character": 19.0 | ||
}, | ||
"end": { | ||
"line": 22.0, | ||
"character": 24.0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.