Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement]: Provide completions after providing the accessor of a resource method #41639

Open
nipunayf opened this issue Nov 3, 2023 · 1 comment
Assignees
Labels
Area/Completion Issues related to Language Server Auto Completions Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Improvement

Comments

@nipunayf
Copy link
Contributor

nipunayf commented Nov 3, 2023

Description

The current implementation does not provide the possible paths as completions for a given resource accessor. In some cases, it would be convenient for the user to have access to the paths associated with a given accessor.

Describe your problem(s)

No response

Describe your solution(s)

Consider the following Ballerina example.

client class MyClient {
    resource function post first/[string param]/third () {}
    resource function post fourth/[string foo]/[int param2]() {}
    resource function put first/[string bar] () {}
    resource function get path() {}
}

function listAllPaths() {
    MyClient cl = new;
    cl->.p<cursor>
}

In the above syntax, it should provide all the available paths for the accessors that start with p, in this case, post and put.

Related area

-> Compilation

Related issue(s) (optional)

#41563

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@nipunayf nipunayf added Type/Improvement Team/LanguageServer Language Server Implementation related issues. #Compiler Area/Completion Issues related to Language Server Auto Completions labels Nov 3, 2023
@nipunayf nipunayf self-assigned this Nov 8, 2023
@nipunayf
Copy link
Contributor Author

nipunayf commented Nov 9, 2023

@shafreenAnfar As of the current implementation, the user can enter the accessor along with the resource paths without the . to get the relevant resources. For instance, if the user needs to determine the resources with third as a resource segment to add, he can simply type thirdpost. Once the user enters the ., it creates a new completion request with a different context, which requires a complex implementation for the LS to provide the expected completions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/Completion Issues related to Language Server Auto Completions Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Improvement
Projects
None yet
Development

No branches or pull requests

1 participant