-
Notifications
You must be signed in to change notification settings - Fork 736
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 #42574 from nipunayf/fix-42482
[Master] Add the relevant new import text edits via the `Create variable with type` code action
- Loading branch information
Showing
21 changed files
with
788 additions
and
55 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
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
42 changes: 42 additions & 0 deletions
42
.../create-variable/config-rename-positional-capability/createVariableWithInferredType1.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,42 @@ | ||
{ | ||
"position": { | ||
"line": 5, | ||
"character": 16 | ||
}, | ||
"source": "createVariableWithInferredType.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create variable", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 5, | ||
"character": 4 | ||
}, | ||
"end": { | ||
"line": 5, | ||
"character": 4 | ||
} | ||
}, | ||
"newText": "anydata|mod2:ClientError2 pull = " | ||
}, | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 0 | ||
} | ||
}, | ||
"newText": "import ballerina/module1.mod2;\n" | ||
} | ||
], | ||
"resolvable": false | ||
} | ||
] | ||
} |
42 changes: 42 additions & 0 deletions
42
.../create-variable/config-rename-positional-capability/createVariableWithInferredType2.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,42 @@ | ||
{ | ||
"position": { | ||
"line": 9, | ||
"character": 18 | ||
}, | ||
"source": "createVariableWithInferredType.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create variable", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 9, | ||
"character": 4 | ||
}, | ||
"end": { | ||
"line": 9, | ||
"character": 4 | ||
} | ||
}, | ||
"newText": "stream<targetType, mod2:ClientError2?> streamResult = " | ||
}, | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 0, | ||
"character": 0 | ||
}, | ||
"end": { | ||
"line": 0, | ||
"character": 0 | ||
} | ||
}, | ||
"newText": "import ballerina/module1.mod2;\n" | ||
} | ||
], | ||
"resolvable": false | ||
} | ||
] | ||
} |
29 changes: 29 additions & 0 deletions
29
.../create-variable/config-rename-positional-capability/createVariableWithInferredType3.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,29 @@ | ||
{ | ||
"position": { | ||
"line": 13, | ||
"character": 18 | ||
}, | ||
"source": "createVariableWithInferredType.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create variable", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 13, | ||
"character": 4 | ||
}, | ||
"end": { | ||
"line": 13, | ||
"character": 4 | ||
} | ||
}, | ||
"newText": "anydata|module1:ClientError clear = " | ||
} | ||
], | ||
"resolvable": false | ||
} | ||
] | ||
} |
29 changes: 29 additions & 0 deletions
29
.../create-variable/config-rename-positional-capability/createVariableWithInferredType4.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,29 @@ | ||
{ | ||
"position": { | ||
"line": 17, | ||
"character": 18 | ||
}, | ||
"source": "createVariableWithInferredType.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create variable", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 17, | ||
"character": 4 | ||
}, | ||
"end": { | ||
"line": 17, | ||
"character": 4 | ||
} | ||
}, | ||
"newText": "stream<targetType, module1:ClientError?> streamResult = " | ||
} | ||
], | ||
"resolvable": false | ||
} | ||
] | ||
} |
19 changes: 19 additions & 0 deletions
19
...e/src/test/resources/codeaction/create-variable/source/createVariableWithInferredType.bal
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,19 @@ | ||
import ballerina/module1; | ||
|
||
module1:Client 'client = new (url="http://ballerina.io"); | ||
|
||
function testImportedSimpleType() returns error? { | ||
'client->pull(path = "/path"); | ||
} | ||
|
||
function testImportedStreamType() returns error? { | ||
'client->/responses.delete() | ||
} | ||
|
||
function testSimpleType() returns error? { | ||
'client->clear(path = "/path"); | ||
} | ||
|
||
function testStreamType() returns error? { | ||
'client->/responses | ||
} |
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
Oops, something went wrong.