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

Implement the LS APIs to support function definitions #573

Merged
merged 12 commits into from
Feb 6, 2025

Conversation

nipunayf
Copy link
Contributor

@nipunayf nipunayf commented Feb 3, 2025

Purpose

The PR introduces the following changes to the existing APIs:

  1. Support function definition in the getNodeTemplate API
  2. Support writing a function definition in the getSourceCode API
    1. For new functions, ensure "functions.bal" exists, as the LS will provide the text edit at the end of this line.
    2. For existing functions, the text edit will only modify the function name and signature

The PR introduces a new API endpoint flowDesignService/functionDefinition that retrieves function definitions using the components API response.

@nipunayf nipunayf added the Area/FlowModel Related to the flow model generation LS extension label Feb 3, 2025
Copy link
Contributor

@NipunaRanasinghe NipunaRanasinghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have test cases to validate if this new API works for function names with special characters like escaped/unicode characters (e,g, function names with spaces)?

@nipunayf
Copy link
Contributor Author

nipunayf commented Feb 6, 2025

Do we have test cases to validate if this new API works for function names with special characters like escaped/unicode characters (e,g, function names with spaces)?

Added

Copy link
Contributor

@NipunaRanasinghe NipunaRanasinghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nipunayf nipunayf merged commit 0e3874d into ballerina-platform:main Feb 6, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/FlowModel Related to the flow model generation LS extension
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants