-
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 #41773 from mindula/fix-41646
Add hover support for resource paths
- Loading branch information
Showing
15 changed files
with
223 additions
and
49 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
21 changes: 0 additions & 21 deletions
21
...modules/langserver-core/src/test/resources/hover/configs/hover_for_api_docs_negative.json
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
...er/modules/langserver-core/src/test/resources/hover/configs/hover_for_resource_path1.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,21 @@ | ||
{ | ||
"position": { | ||
"line": 28, | ||
"character": 34 | ||
}, | ||
"source": { | ||
"file": "hover_for_resource_path.bal" | ||
}, | ||
"expected": { | ||
"result": { | ||
"contents": { | ||
"kind": "markdown", | ||
"value": "Test Description.\n \n \n--- \n \n### Parameters \n \n`string` ***param1*** : parameter description \n`string` ***param2*** : parameter description \n`string` ***param3*** : parameter description \n`int...` ***param4*** : \n \n--- \n \n### Return \n`string` : return value description" | ||
} | ||
}, | ||
"id": { | ||
"left": "324" | ||
}, | ||
"jsonrpc": "2.0" | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...er/modules/langserver-core/src/test/resources/hover/configs/hover_for_resource_path2.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,21 @@ | ||
{ | ||
"position": { | ||
"line": 28, | ||
"character": 39 | ||
}, | ||
"source": { | ||
"file": "hover_for_resource_path.bal" | ||
}, | ||
"expected": { | ||
"result": { | ||
"contents": { | ||
"kind": "markdown", | ||
"value": "Test Description.\n \n \n--- \n \n### Parameters \n \n`string` ***param1*** : parameter description \n`string` ***param2*** : parameter description \n`string` ***param3*** : parameter description \n`int...` ***param4*** : \n \n--- \n \n### Return \n`string` : return value description" | ||
} | ||
}, | ||
"id": { | ||
"left": "324" | ||
}, | ||
"jsonrpc": "2.0" | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...er/modules/langserver-core/src/test/resources/hover/configs/hover_for_resource_path3.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,21 @@ | ||
{ | ||
"position": { | ||
"line": 28, | ||
"character": 55 | ||
}, | ||
"source": { | ||
"file": "hover_for_resource_path.bal" | ||
}, | ||
"expected": { | ||
"result": { | ||
"contents": { | ||
"kind": "markdown", | ||
"value": "Test Description.\n \n \n--- \n \n### Parameters \n \n`string` ***param1*** : parameter description \n`string` ***param2*** : parameter description \n`string` ***param3*** : parameter description \n`int...` ***param4*** : \n \n--- \n \n### Return \n`string` : return value description" | ||
} | ||
}, | ||
"id": { | ||
"left": "324" | ||
}, | ||
"jsonrpc": "2.0" | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...er/modules/langserver-core/src/test/resources/hover/configs/hover_for_resource_path4.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,21 @@ | ||
{ | ||
"position": { | ||
"line": 29, | ||
"character": 34 | ||
}, | ||
"source": { | ||
"file": "hover_for_resource_path.bal" | ||
}, | ||
"expected": { | ||
"result": { | ||
"contents": { | ||
"kind": "markdown", | ||
"value": "Description.\n \n \n--- \n \n### Parameters \n \n`int` ***ids*** : parameter description \n \n--- \n \n### Return \n`string` : return value description" | ||
} | ||
}, | ||
"id": { | ||
"left": "324" | ||
}, | ||
"jsonrpc": "2.0" | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...er/modules/langserver-core/src/test/resources/hover/configs/hover_for_resource_path5.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,21 @@ | ||
{ | ||
"position": { | ||
"line": 30, | ||
"character": 35 | ||
}, | ||
"source": { | ||
"file": "hover_for_resource_path.bal" | ||
}, | ||
"expected": { | ||
"result": { | ||
"contents": { | ||
"kind": "markdown", | ||
"value": "Description.\n \n \n--- \n \n### Parameters \n \n`int` ***ids*** : parameter description \n \n--- \n \n### Return \n`string` : return value description" | ||
} | ||
}, | ||
"id": { | ||
"left": "324" | ||
}, | ||
"jsonrpc": "2.0" | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...er/modules/langserver-core/src/test/resources/hover/configs/hover_for_resource_path6.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,21 @@ | ||
{ | ||
"position": { | ||
"line": 28, | ||
"character": 34 | ||
}, | ||
"source": { | ||
"file": "hover_for_resource_path.bal" | ||
}, | ||
"expected": { | ||
"result": { | ||
"contents": { | ||
"kind": "markdown", | ||
"value": "Test Description.\n \n \n--- \n \n### Parameters \n \n`string` ***param1*** : parameter description \n`string` ***param2*** : parameter description \n`string` ***param3*** : parameter description \n`int...` ***param4*** : \n \n--- \n \n### Return \n`string` : return value description" | ||
} | ||
}, | ||
"id": { | ||
"left": "324" | ||
}, | ||
"jsonrpc": "2.0" | ||
} | ||
} |
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
18 changes: 0 additions & 18 deletions
18
...r/modules/langserver-core/src/test/resources/hover/source/hover_for_api_docs_negative.bal
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
...erver/modules/langserver-core/src/test/resources/hover/source/hover_for_resource_path.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,32 @@ | ||
client class Client { | ||
# Test Description. | ||
# | ||
# + param1 - parameter description | ||
# + param2 - parameter description | ||
# + param3 - parameter description | ||
# + return - return value description | ||
resource function post path/[string param1]/path2/[string ...param2](string param3, int ...param4) returns string { | ||
return "post"; | ||
} | ||
|
||
# Description. | ||
# | ||
# + ids - parameter description | ||
# + return - return value description | ||
resource function get [int... ids]() returns string { | ||
return "get"; | ||
} | ||
|
||
# Description. | ||
# + return - return value description | ||
resource function get path2/[int... ]() returns string { | ||
return "get"; | ||
} | ||
} | ||
|
||
public function test() { | ||
Client cli = new Client(); | ||
string stringResult = cli->/path/[""]/path2/[""].post("", 1); | ||
string stringResult2 = cli->/[0]; | ||
string stringResult3 = cli->/[0]; | ||
} |