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]: Improving Ballerina Resource Function Developer Experience in VS Code Extension #41563

Closed
RDPerera opened this issue Oct 24, 2023 · 3 comments
Labels
Reason/Other None of the other reasons. Team/LanguageServer/Extensions Any Language Sever Extension Team/LanguageServer Language Server Implementation related issues. #Compiler Team/VSCode Type/Improvement

Comments

@RDPerera
Copy link
Member

RDPerera commented Oct 24, 2023

Description

With the majority of Ballerina connectors using Ballerina resource functions, developer experience with resource functions plays a critical role in Ballerina.

The Ballerina VS Code extension provides support for handling resource functions effectively. However, we have identified the following issues and potential improvements:

Suggested Improvements

1. Auto-completion even after path parameters

Auto-Completion Issue

Currently, after entering a parameter, the auto-completion feature does not work as expected. It would be better to provide suggestions for resource paths after specifying a parameter.

2. Add descriptions when hovering over resource paths

Description Issue

VS Code currently provides descriptions only when hovering over parameters. We propose adding descriptions for resource paths when hovering over them.

3. Replace <path> with parameter names and types

<path> Issue

Parameter names for resource functions are displayed as "path" instead of their actual names and types.

4. List down all the paths to keyword.method() [eg: Calls.post]

Image

If we just type calls.post, it should list down all the paths to calls.post().

Steps to Reproduce

To reproduce the issue, follow these steps:

  1. Download the OpenAPI specification from Link to OpenAPI Spec.
  2. Generate and build resource functions using the Ballerina OpenAPI Tool by referring to the Ballerina OpenAPI Tools Documentation.
  3. Write the following example code:
import ballerinax/twilio;

public function createCall() returns error? {
    twilioresource:CreateCallRequest call = {
        To: toPhoneNumber,
        From: fromPhoneNumber,
        Url: recordingURL
    };
    twilioresource:ApiV2010AccountCall? response = check twilioClientResource->/Accounts/[accountSid]/Calls.post(call);
    if (response is twilioresource:ApiV2010AccountCall) {
        log:printInfo("Call made successfully.");
        log:printInfo(response.toString());
    } else {
        log:printError(response.toString());
    }
}

Additional Information

  • Ballerina Version: Ballerina 2201.8.0 (Swan Lake Update 8)
  • Operating System: macOS
  • VS Code Extension Version: v4.5.3

Describe your solution(s)

No response

Related area

-> Editor

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

@KavinduZoysa

@RDPerera RDPerera added Type/Improvement Team/LanguageServer Language Server Implementation related issues. #Compiler Team/LanguageServer/Extensions Any Language Sever Extension Team/VSCode labels Oct 24, 2023
@shafreenAnfar
Copy link
Contributor

Also, if we just type call.post, it should just list down all the paths to call.post

@RDPerera
Copy link
Member Author

RDPerera commented Nov 1, 2023

Also, if we just type call.post, it should just list down all the paths to call.post

Added to the issue.

@KavinduZoysa
Copy link
Contributor

Since #41636 is under discussion, and other issues are fixed, we can close this major issue.

@KavinduZoysa KavinduZoysa added the Reason/Other None of the other reasons. label Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reason/Other None of the other reasons. Team/LanguageServer/Extensions Any Language Sever Extension Team/LanguageServer Language Server Implementation related issues. #Compiler Team/VSCode Type/Improvement
Projects
None yet
Development

No branches or pull requests

4 participants
@shafreenAnfar @KavinduZoysa @RDPerera and others