Skip to content

Comments

Refactor migration libraries API#672

Merged
xlight05 merged 1 commit intoballerina-platform:copilot-library-unifyfrom
VellummyilumVinoth:refactor-libraries-migration
Feb 6, 2026
Merged

Refactor migration libraries API#672
xlight05 merged 1 commit intoballerina-platform:copilot-library-unifyfrom
VellummyilumVinoth:refactor-libraries-migration

Conversation

@VellummyilumVinoth
Copy link
Contributor

Description

This PR resolves comments for the PR: #636 (comment)

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

@VellummyilumVinoth VellummyilumVinoth force-pushed the refactor-libraries-migration branch 3 times, most recently from 48d3e3d to b6fabdc Compare February 3, 2026 10:04
@VellummyilumVinoth VellummyilumVinoth marked this pull request as ready for review February 3, 2026 10:04
@VellummyilumVinoth VellummyilumVinoth force-pushed the refactor-libraries-migration branch from b6fabdc to d22b281 Compare February 5, 2026 02:21
@VellummyilumVinoth VellummyilumVinoth force-pushed the refactor-libraries-migration branch from d22b281 to 23e49de Compare February 5, 2026 04:30
for (Symbol symbol : semanticModel.moduleSymbols()) {
switch (symbol.kind()) {
case CLASS:
ClassSymbolHandler.process(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this the pattern we use in this codebase?

Not a big fan of this since it only has a normal class with static process function?

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like other usages don't use visitors either. If the handlers are short, we can revert back to handling it here itself.

// Add varType using ConstantValue
String varTypeName = "";
Object constValue = constantSymbol.constValue();
if (constValue instanceof ConstantValue constantValue) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Check if theres a kind or type which we can do instanceof. There is, we should follow that approach

Copy link
Contributor

@xlight05 xlight05 left a comment

Choose a reason for hiding this comment

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

Lets address these too before merging this to main

for (Symbol symbol : semanticModel.moduleSymbols()) {
switch (symbol.kind()) {
case CLASS:
ClassSymbolHandler.process(
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like other usages don't use visitors either. If the handlers are short, we can revert back to handling it here itself.

@xlight05 xlight05 merged commit ed970e1 into ballerina-platform:copilot-library-unify Feb 6, 2026
1 of 3 checks passed
@xlight05
Copy link
Contributor

xlight05 commented Feb 6, 2026

We should move Copilot sepcific stuff to a package inside core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants