-
Notifications
You must be signed in to change notification settings - Fork 755
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 #41117 from pcnfernando/issue_37670
[Query Expression]Restrict result type being resolved as `map` without the query-construct-type
- Loading branch information
Showing
29 changed files
with
784 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
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
40 changes: 40 additions & 0 deletions
40
...ion/create-variable/config-rename-positional-capability/createVariableInQueryAction1.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,40 @@ | ||
{ | ||
"position": { | ||
"line": 2, | ||
"character": 4 | ||
}, | ||
"source": "createVariableInQueryAction1.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create variable", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 2, | ||
"character": 4 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"character": 4 | ||
} | ||
}, | ||
"newText": "int[] listResult = " | ||
} | ||
], | ||
"command": { | ||
"title": "Rename variable", | ||
"command": "ballerina.action.positional.rename", | ||
"arguments": [ | ||
"createVariableInQueryAction1.bal", | ||
{ | ||
"line": 2, | ||
"character": 10 | ||
} | ||
] | ||
}, | ||
"resolvable": false | ||
} | ||
] | ||
} |
40 changes: 40 additions & 0 deletions
40
...ion/create-variable/config-rename-positional-capability/createVariableInQueryAction2.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,40 @@ | ||
{ | ||
"position": { | ||
"line": 6, | ||
"character": 4 | ||
}, | ||
"source": "createVariableInQueryAction2.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create variable", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 6, | ||
"character": 4 | ||
}, | ||
"end": { | ||
"line": 6, | ||
"character": 4 | ||
} | ||
}, | ||
"newText": "xml<xml:Element> xmlResult = " | ||
} | ||
], | ||
"command": { | ||
"title": "Rename variable", | ||
"command": "ballerina.action.positional.rename", | ||
"arguments": [ | ||
"createVariableInQueryAction2.bal", | ||
{ | ||
"line": 6, | ||
"character": 21 | ||
} | ||
] | ||
}, | ||
"resolvable": false | ||
} | ||
] | ||
} |
40 changes: 40 additions & 0 deletions
40
...ion/create-variable/config-rename-positional-capability/createVariableInQueryAction3.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,40 @@ | ||
{ | ||
"position": { | ||
"line": 2, | ||
"character": 4 | ||
}, | ||
"source": "createVariableInQueryAction3.bal", | ||
"expected": [ | ||
{ | ||
"title": "Create variable", | ||
"kind": "quickfix", | ||
"edits": [ | ||
{ | ||
"range": { | ||
"start": { | ||
"line": 2, | ||
"character": 4 | ||
}, | ||
"end": { | ||
"line": 2, | ||
"character": 4 | ||
} | ||
}, | ||
"newText": "xml<xml> xmlResult = " | ||
} | ||
], | ||
"command": { | ||
"title": "Rename variable", | ||
"command": "ballerina.action.positional.rename", | ||
"arguments": [ | ||
"createVariableInQueryAction3.bal", | ||
{ | ||
"line": 2, | ||
"character": 13 | ||
} | ||
] | ||
}, | ||
"resolvable": false | ||
} | ||
] | ||
} |
8 changes: 8 additions & 0 deletions
8
...ion/create-variable/config-rename-positional-capability/createVariableInQueryAction4.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,8 @@ | ||
{ | ||
"position": { | ||
"line": 2, | ||
"character": 4 | ||
}, | ||
"source": "createVariableInQueryAction4.bal", | ||
"expected": [] | ||
} |
8 changes: 8 additions & 0 deletions
8
...ate-variable/config-rename-positional-capability/createVariableInQueryActionNegative.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,8 @@ | ||
{ | ||
"position": { | ||
"line": 2, | ||
"character": 4 | ||
}, | ||
"source": "createVariableInQueryAction4.bal", | ||
"expected": [] | ||
} |
4 changes: 4 additions & 0 deletions
4
...ore/src/test/resources/codeaction/create-variable/source/createVariableInQueryAction1.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,4 @@ | ||
public function func() { | ||
int[] x1 = [1, 2, 3, 4, 5]; | ||
from int element in x1 select element; | ||
} |
8 changes: 8 additions & 0 deletions
8
...ore/src/test/resources/codeaction/create-variable/source/createVariableInQueryAction2.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,8 @@ | ||
public function func() { | ||
xml book = xml `<book> | ||
<name>Sherlock Holmes</name> | ||
<author>Sir Arthur Conan Doyle</author> | ||
</book>`; | ||
|
||
from var x in book/<name> select x; | ||
} |
4 changes: 4 additions & 0 deletions
4
...ore/src/test/resources/codeaction/create-variable/source/createVariableInQueryAction3.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,4 @@ | ||
public function func() { | ||
xml x1 = xml `<book>The Lost World</book>`; | ||
from xml element in x1 select element; | ||
} |
4 changes: 4 additions & 0 deletions
4
...ore/src/test/resources/codeaction/create-variable/source/createVariableInQueryAction4.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,4 @@ | ||
public function func() { | ||
xml x1 = xml `<book>The Lost World</book>`; | ||
from xml element in x1 select element.toBalString(); | ||
} |
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.