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]: Introduce code actions to implement resource functions of a service object type #42758

Open
TharmiganK opened this issue May 15, 2024 · 0 comments
Assignees
Labels
Area/CodeAction Language Server Code Actions Team/LanguageServer Language Server Implementation related issues. #Compiler Type/Improvement

Comments

@TharmiganK
Copy link
Contributor

Description

$Subject

Currently we only have code actions to implement normal functions.

Describe your problem(s)

Consider the following sample:

import ballerina/http;

public type User record {|
    int id;
    string name;
    string email;
|};

public type UserNotFound record {|
    *http:NotFound;
    record {|
        int id;
        string message = "User not found";
    |} body;
|};

public type SocialMedia service object {
    *http:Service;
    resource function get users() returns User[]|error;
    resource function get users/[int id]() returns User|UserNotFound|error;

    function createInterceptors();
};

service SocialMedia on new http:Listener(8080) {

}

There is only one code action for the service declaration node: Implement createInterceptors method

Describe your solution(s)

It will be useful if we can have implementation code actions to the resource/remote methods with empty body.

Please note that, it is better if we can have a code action like implement all the methods to implement all of the methods.

Related area

-> Other Area

Related issue(s) (optional)

Required as a part of user experience with this new feature proposal: ballerina-platform/ballerina-library#6378

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

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

No branches or pull requests

2 participants