-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
231 additions
and
7 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
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
20 changes: 20 additions & 0 deletions
20
...odel-generator-ls-extension/src/test/resources/get_enclosed_func_def/config/service1.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,20 @@ | ||
{ | ||
"description": "", | ||
"filePath": "proj_1/graphql_service.bal", | ||
"position": { | ||
"line": 17, | ||
"offset": 25 | ||
}, | ||
"findClass": true, | ||
"response": { | ||
"filePath": "proj_1/graphql_service.bal", | ||
"startLine": { | ||
"line": 12, | ||
"offset": 0 | ||
}, | ||
"endLine": { | ||
"line": 30, | ||
"offset": 1 | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...odel-generator-ls-extension/src/test/resources/get_enclosed_func_def/config/service2.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,20 @@ | ||
{ | ||
"description": "", | ||
"filePath": "proj_1/graphql_service.bal", | ||
"position": { | ||
"line": 28, | ||
"offset": 18 | ||
}, | ||
"findClass": true, | ||
"response": { | ||
"filePath": "proj_1/graphql_service.bal", | ||
"startLine": { | ||
"line": 12, | ||
"offset": 0 | ||
}, | ||
"endLine": { | ||
"line": 30, | ||
"offset": 1 | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...odel-generator-ls-extension/src/test/resources/get_enclosed_func_def/config/service3.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,20 @@ | ||
{ | ||
"description": "", | ||
"filePath": "proj_1/graphql_service.bal", | ||
"position": { | ||
"line": 14, | ||
"offset": 26 | ||
}, | ||
"findClass": true, | ||
"response": { | ||
"filePath": "proj_1/graphql_service.bal", | ||
"startLine": { | ||
"line": 12, | ||
"offset": 0 | ||
}, | ||
"endLine": { | ||
"line": 30, | ||
"offset": 1 | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...odel-generator-ls-extension/src/test/resources/get_enclosed_func_def/config/service4.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,20 @@ | ||
{ | ||
"description": "", | ||
"filePath": "proj_1/graphql_service.bal", | ||
"position": { | ||
"line": 43, | ||
"offset": 22 | ||
}, | ||
"findClass": true, | ||
"response": { | ||
"filePath": "proj_1/graphql_service.bal", | ||
"startLine": { | ||
"line": 38, | ||
"offset": 0 | ||
}, | ||
"endLine": { | ||
"line": 58, | ||
"offset": 1 | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...odel-generator-ls-extension/src/test/resources/get_enclosed_func_def/config/service5.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,20 @@ | ||
{ | ||
"description": "", | ||
"filePath": "proj_1/graphql_service.bal", | ||
"position": { | ||
"line": 56, | ||
"offset": 35 | ||
}, | ||
"findClass": true, | ||
"response": { | ||
"filePath": "proj_1/graphql_service.bal", | ||
"startLine": { | ||
"line": 38, | ||
"offset": 0 | ||
}, | ||
"endLine": { | ||
"line": 58, | ||
"offset": 1 | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...odel-generator-ls-extension/src/test/resources/get_enclosed_func_def/config/service6.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,20 @@ | ||
{ | ||
"description": "", | ||
"filePath": "proj_1/services.bal", | ||
"position": { | ||
"line": 5, | ||
"offset": 24 | ||
}, | ||
"findClass": true, | ||
"response": { | ||
"filePath": "proj_1/services.bal", | ||
"startLine": { | ||
"line": 0, | ||
"offset": 0 | ||
}, | ||
"endLine": { | ||
"line": 21, | ||
"offset": 1 | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...odel-generator-ls-extension/src/test/resources/get_enclosed_func_def/config/service7.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,20 @@ | ||
{ | ||
"description": "", | ||
"filePath": "proj_1/services.bal", | ||
"position": { | ||
"line": 17, | ||
"offset": 31 | ||
}, | ||
"findClass": true, | ||
"response": { | ||
"filePath": "proj_1/services.bal", | ||
"startLine": { | ||
"line": 0, | ||
"offset": 0 | ||
}, | ||
"endLine": { | ||
"line": 21, | ||
"offset": 1 | ||
} | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
...r-ls-extension/src/test/resources/get_enclosed_func_def/source/proj_1/graphql_service.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,59 @@ | ||
import ballerina/graphql; | ||
|
||
public type AbstractProfile record {| | ||
string name; | ||
int age; | ||
Address address; | ||
|}; | ||
|
||
type UserName record {| | ||
string value; | ||
|}; | ||
|
||
service class UserProfile { | ||
private final string name; | ||
private final int age; | ||
|
||
function init(string name, int age) { | ||
self.name = name; | ||
self.age = age; | ||
} | ||
|
||
resource function get name() returns string { | ||
return self.name; | ||
} | ||
resource function get age() returns int { | ||
return self.age; | ||
} | ||
resource function get isAdult() returns boolean { | ||
return self.age > 21; | ||
} | ||
} | ||
|
||
public type Address record {| | ||
string number; | ||
string street; | ||
string city; | ||
|}; | ||
|
||
service /graphql on new graphql:Listener(9090) { | ||
resource function get profile21() returns AbstractProfile { | ||
return { | ||
name: "Walter White", | ||
age: 51, | ||
address: { | ||
number: "308", | ||
street: "Negra Arroyo Lane", | ||
city: "Albuquerque" | ||
} | ||
}; | ||
} | ||
|
||
resource function get profile() returns UserProfile { | ||
return new ("Walter White", 51); | ||
} | ||
|
||
remote function updateName(UserName userName) returns UserProfile { | ||
return new (userName.value, 51); | ||
} | ||
} |