Skip to content
Merged
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
f546c76
Add WI extension and related packages
gigara Oct 31, 2025
c02ef8d
Merge branch 'main' of https://github.com/wso2/vscode-extensions into…
gigara Oct 31, 2025
20b0106
Support Bal project open
kaumini Nov 7, 2025
771070c
Support Bal project open
kaumini Nov 7, 2025
d76490c
Add treeview commands
kaumini Nov 7, 2025
77864b7
Render Bi treeview and webviews if bal projecct
kaumini Nov 7, 2025
6a71aaa
Add svgs and codicons
kaumini Nov 7, 2025
a1fc49e
Support MI project open
kaumini Nov 9, 2025
2d3a9bf
Add new welcome view to WSO2 Integrator
kaumini Nov 9, 2025
4af1d2a
Render wi welcome view
kaumini Nov 10, 2025
40a63a2
Revert "Add new welcome view to WSO2 Integrator"
kaumini Nov 10, 2025
164ba05
Add BI creation form and add default integrator setting
kaumini Nov 10, 2025
dc1f1d9
Add import external view
kaumini Nov 10, 2025
f986372
Support samples view
kaumini Nov 10, 2025
146906f
Add context provider
kaumini Nov 11, 2025
aba040c
Add ui changes
kaumini Nov 11, 2025
00b0793
Add mi project form ui changes
kaumini Nov 11, 2025
b43e816
Complete bi project creation flow
kaumini Nov 11, 2025
0f16660
Show only wso2-integrator on activity bar
kaumini Nov 11, 2025
189f45d
Complete mi creation flow
kaumini Nov 11, 2025
6280c5b
Add statemachine and refactor base logic
gigara Nov 11, 2025
b55f298
Merge branch 'wso2-integrator' of https://github.com/wso2/vscode-exte…
kaumini Nov 12, 2025
2cf0ab8
Complete mi samples flow
kaumini Nov 12, 2025
195f1e9
Complete Migrate Integration
kaumini Nov 12, 2025
43dcd6b
Refactor webview rendering logic and remove unused methods
gigara Nov 13, 2025
a239a01
Enhance project type handling and update welcome screen content in st…
gigara Nov 13, 2025
c5876ec
Merge branch 'wso2-integrator' of https://github.com/wso2/vscode-exte…
gigara Nov 13, 2025
f5da3b4
Dynamically activate project explorer
gigara Nov 13, 2025
bc2a2cd
Enhance default integrator mode handling
gigara Nov 13, 2025
f11af15
Hide welcome view in WI mode
gigara Nov 13, 2025
eaa8145
Merge branch 'main' of https://github.com/wso2/vscode-extensions into…
gigara Nov 13, 2025
c708556
Revert BI ext changes
gigara Nov 14, 2025
55c0b9f
ignore env
kaumini Nov 14, 2025
7d6d438
Fix build failure
gigara Nov 14, 2025
2edac1c
Show welcome screen when no project open
kaumini Nov 14, 2025
b9906c5
Merge branch 'wso2-integrator' of https://github.com/wso2/vscode-exte…
kaumini Nov 14, 2025
a5344c9
remove redundant code
kaumini Nov 14, 2025
a9858b4
Fix extension activation issue
gigara Nov 14, 2025
820bb6a
Merge branch 'wso2-integrator' of https://github.com/wso2/vscode-exte…
gigara Nov 14, 2025
46c9bb7
Remove home icon
gigara Nov 14, 2025
e518b1e
Fix bi treeview in wi
kaumini Nov 14, 2025
98f4aab
Merge branch 'wso2-integrator' of https://github.com/wso2/vscode-exte…
gigara Nov 14, 2025
0b79b6d
Update workspaces/mi/mi-extension/src/visualizer/activate.ts
gigara Nov 17, 2025
eac7056
Update types
gigara Nov 17, 2025
df8b0db
Update repo
gigara Nov 17, 2025
a9393b7
Fix import
gigara Nov 17, 2025
6831a9a
Rename logger to bal logger
gigara Nov 17, 2025
44ebf1b
Use a js script to package vsix to avoid cross paltform issues
gigara Nov 17, 2025
fec6f55
Merge branch 'main' of https://github.com/wso2/vscode-extensions into…
gigara Nov 17, 2025
ff93bdf
Merge branch 'wso2-integrator' of https://github.com/wso2/vscode-exte…
gigara Nov 17, 2025
c0aeeb5
Improve package script
gigara Nov 17, 2025
31db42e
Improve WI detection logic
gigara Nov 17, 2025
7a3e9f6
Move WI ext id into a constant
gigara Nov 17, 2025
1066a3c
Sort log files before remove
gigara Nov 17, 2025
852c401
Add migration report for wi
kaumini Nov 17, 2025
b18201c
Merge branch 'main' of https://github.com/wso2/vscode-extensions into…
gigara Nov 19, 2025
c963d82
Remove BI extension's duplicate code from WI
gigara Nov 19, 2025
637c9f6
Update BI to contribute to the WI activity
gigara Nov 19, 2025
d4632a4
Refactor project explorer commands and add new view IDs for better co…
gigara Nov 19, 2025
cd4e45d
Hide BI activity in WI mode
gigara Nov 19, 2025
ed39df1
Remove WI packages from vscode repo
gigara Nov 19, 2025
807b1f8
Merge branch 'main' of https://github.com/wso2/vscode-extensions into…
gigara Nov 19, 2025
b7dd186
Merge branch 'wso2-integrator' of https://github.com/wso2/vscode-exte…
gigara Nov 19, 2025
2102269
Remove WSO2 Integrator Extension configuration and related watch task…
gigara Nov 19, 2025
80b7526
Add WI_PROJECT_EXPLORER_VIEW_REFRESH_COMMAND to constants and update …
gigara Nov 19, 2025
70dad0c
Fix mock services pane visibility condition
gigara Nov 20, 2025
e13cf7c
Enhance command visibility conditions for Ballerina and Micro Integra…
gigara Nov 20, 2025
d2dcfa4
Merge branch 'main' of https://github.com/wso2/vscode-extensions into…
gigara Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,33 @@
],
"preLaunchTask": "watch-mi-tests"
},
{
"name": "WSO2 Integrator Extension",
"type": "extensionHost",
"request": "launch",
"env": {
"WEB_VIEW_DEV_MODE": "true",
"WEB_VIEW_DEV_HOST": "http://localhost:3000",
},
"trace":true,
"debugWebviews": true,
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/workspaces/wi/wi-extension"
],
"outFiles": [
"${workspaceFolder}/workspaces/wi/wi-extension/dist/**/*.js",
"${workspaceFolder}/workspaces/wi/wi-webviews/lib/**/*"
],
"skipFiles": [
"**/node_modules/**"
],
"rendererDebugOptions": {
"sourceMaps": true,
"webRoot": "${workspaceFolder}/workspaces/wi/wi-webviews",
},
"preLaunchTask": "npm: watch-wi",
"envFile": "${workspaceFolder}/workspaces/wi/wi-extension/.env"
},
{
"name": "Ballerina Extension AI Tests",
"type": "extensionHost",
Expand All @@ -245,7 +272,8 @@
"--extensionTestsPath=${workspaceFolder}/workspaces/ballerina/ballerina-extension/out/test",
"${workspaceFolder}/workspaces/ballerina/ballerina-extension/test/data/bi_empty_project",
"${workspaceFolder}/workspaces/ballerina/ballerina-extension/test/data/bi_init",
"${workspaceFolder}/workspaces/ballerina/ballerina-extension/test/data/simple_order_management_system","${workspaceFolder}/workspaces/ballerina/ballerina-extension/test/data/ai_datamapper"
"${workspaceFolder}/workspaces/ballerina/ballerina-extension/test/data/simple_order_management_system",
"${workspaceFolder}/workspaces/ballerina/ballerina-extension/test/data/ai_datamapper"
],
"env": {
"LS_EXTENSIONS_PATH": "",
Expand Down Expand Up @@ -294,4 +322,4 @@
"preLaunchTask": "npm: watch-apk"
},
]
}
}
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,22 @@
"type": "npm",
"script": "watch",
"path": "workspaces/mi/mi-extension",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "npm: watch-wi",
"type": "npm",
"script": "watch",
"path": "workspaces/wi/wi-extension",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"clean": "rimraf ./dist",
"compile": "tsc -p .",
"watch": "tsc -p . -w",
"package": "if [ $isPreRelease = true ]; then vsce package --no-dependencies --pre-release; else vsce package --no-dependencies; fi",
"package": "node ../../common-libs/scripts/package-vsix.js",
"build": "pnpm clean && pnpm run copyFonts && webpack --mode production --devtool hidden-source-map && pnpm run package && pnpm run postbuild",
"compile-tests": "pnpm run compile",
"watch-tests": "pnpm run watch",
Expand Down
2 changes: 1 addition & 1 deletion workspaces/apk/apk-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"pretest": "npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js",
"build": "if [ $isPreRelease = true ]; then vsce package --no-dependencies --pre-release; else vsce package --no-dependencies; fi && pnpm run postbuild",
"build": "node ../../common-libs/scripts/package-vsix.js && pnpm run postbuild",
"postbuild": "pnpm run copyVSIX",
"copyVSIX": "copyfiles *.vsix ./vsix",
"copyVSIXToRoot": "copyfiles -f ./vsix/* ../../.."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export const BI_COMMANDS = {
BI_RUN_PROJECT: 'BI.project.run',
BI_DEBUG_PROJECT: 'BI.project.debug',
REFRESH_COMMAND: 'BI.project-explorer.refresh',
FOCUS_PROJECT_EXPLORER: 'BI.project-explorer.focus',
PROJECT_EXPLORER: 'BI.project-explorer',
ADD_CONNECTIONS: 'BI.project-explorer.add-connection',
ADD_CUSTOM_CONNECTOR: 'BI.project-explorer.add-custom-connector',
Expand All @@ -52,5 +51,7 @@ export const BI_COMMANDS = {
BI_EDIT_TEST_FUNCTION_DEF: 'BI.test.edit.function.def',
ADD_NATURAL_FUNCTION: 'BI.project-explorer.add-natural-function',
TOGGLE_TRACE_LOGS: 'BI.toggle.trace.logs',
ADD_INTEGRATION: 'BI.project-explorer.add-integration',
CREATE_BI_PROJECT: 'BI.project.createBIProjectPure',
CREATE_BI_MIGRATION_PROJECT: 'BI.project.createBIProjectMigration',
ADD_INTEGRATION: 'BI.project-explorer.add-integration'
};
2 changes: 1 addition & 1 deletion workspaces/ballerina/ballerina-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@
"test-coverage": "cross-env COVER_CONFIG=html pnpm run test",
"build-tm-grammar": "js-yaml grammar/ballerina-grammar/syntaxes/ballerina.tmLanguage.yaml > grammar/ballerina-grammar/syntaxes/ballerina.tmLanguage.json",
"lint": "tslint --fix 'src/**/*{.ts,.tsx}'",
"package": "if [ $isPreRelease = true ]; then vsce package --no-dependencies --pre-release; else vsce package --no-dependencies; fi",
"package": "node ../../common-libs/scripts/package-vsix.js",
"copyFonts": "copyfiles -f ./node_modules/@wso2/font-wso2-vscode/dist/* ./resources/font-wso2-vscode/dist/",
"copyVSIX": "copyfiles *.vsix ./vsix",
"copyVSIXToRoot": "copyfiles -f ./vsix/*.vsix ../../..",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { readFileSync, readdirSync, statSync } from "fs";
import path from "path";
import { isPositionEqual, isPositionWithinDeletedComponent } from "../../utils/history/util";
import { startDebugging } from "../editor-support/activator";
import { createBIProjectFromMigration, createBIProjectPure } from "../../utils/bi";
import { createVersionNumber, isSupportedSLVersion } from ".././../utils";
import { extension } from "../../BalExtensionContext";

Expand All @@ -60,7 +61,7 @@ function handleCommandWithContext(
// Scenario 1: Multi-package workspace invoked from command palette
if (isBalWorkspace && !item) {
const packageList = StateMachine.context().projectInfo?.children.map((child) => child.projectPath);

if (!packageList || packageList.length === 0) {
openView(EVENT_TYPE.OPEN_VIEW, { view, ...additionalViewParams });
return;
Expand All @@ -70,23 +71,23 @@ function handleCommandWithContext(
placeHolder: "Select a package"
}).then((selectedPackage) => {
if (selectedPackage) {
openView(EVENT_TYPE.OPEN_VIEW, {
view,
projectPath: selectedPackage,
...additionalViewParams
openView(EVENT_TYPE.OPEN_VIEW, {
view,
projectPath: selectedPackage,
...additionalViewParams
});
}
});
}
// Scenario 2: Invoked from tree view with item context
else if (item?.resourceUri) {
const projectPath = item.resourceUri.fsPath;
openView(EVENT_TYPE.OPEN_VIEW, {
view,
projectPath,
...additionalViewParams
openView(EVENT_TYPE.OPEN_VIEW, {
view,
projectPath,
...additionalViewParams
});
}
}
// Scenario 3: Default - no specific context
else {
openView(EVENT_TYPE.OPEN_VIEW, { view, ...additionalViewParams });
Expand All @@ -95,7 +96,7 @@ function handleCommandWithContext(

export function activate(context: BallerinaExtension) {
const isWorkspaceSupported = isSupportedSLVersion(extension.ballerinaExtInstance, createVersionNumber(2201, 13, 0));

// Set context for command visibility
commands.executeCommand('setContext', 'ballerina.bi.workspaceSupported', isWorkspaceSupported);

Expand Down Expand Up @@ -154,7 +155,7 @@ export function activate(context: BallerinaExtension) {
window.showErrorMessage('This command requires Ballerina version 2201.13.0 or higher. ');
return;
}

const projectPath = StateMachine.context().projectPath || StateMachine.context().workspacePath;
if (projectPath) {
openView(EVENT_TYPE.OPEN_VIEW, { view: MACHINE_VIEW.BIAddProjectForm });
Expand All @@ -173,6 +174,14 @@ export function activate(context: BallerinaExtension) {

commands.registerCommand(BI_COMMANDS.TOGGLE_TRACE_LOGS, toggleTraceLogs);

commands.registerCommand(BI_COMMANDS.CREATE_BI_PROJECT, (params) => {
return createBIProjectPure(params);
});

commands.registerCommand(BI_COMMANDS.CREATE_BI_MIGRATION_PROJECT, (params) => {
return createBIProjectFromMigration(params);
});

commands.registerCommand(BI_COMMANDS.DELETE_COMPONENT, async (item?: TreeItem & { info?: string }) => {
// Guard: DELETE requires a tree item context
if (!item) {
Expand Down
7 changes: 4 additions & 3 deletions workspaces/bi/bi-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
"ballerina-integrator": [
{
"id": "BI.project-explorer",
"name": ""
"name": "",
"when": "!config.integrator.defaultIntegrator"
}
]
},
Expand Down Expand Up @@ -162,7 +163,7 @@
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js",
"build": "pnpm run compile && pnpm run lint && pnpm run postbuild",
"package": "if [ $isPreRelease = true ]; then vsce package --no-dependencies --pre-release; else vsce package --no-dependencies; fi",
"package": "node ../../common-libs/scripts/package-vsix.js",
"copyFonts": "copyfiles -f ./node_modules/@wso2/font-wso2-vscode/dist/* ./resources/font-wso2-vscode/dist/",
"rebuild": "pnpm run clean && pnpm run compile && pnpm run postbuild",
"postbuild": "pnpm run copyFonts && pnpm run package && pnpm run copyVSIX",
Expand Down Expand Up @@ -200,4 +201,4 @@
"@playwright/test": "~1.55.1",
"@wso2/playwright-vscode-tester": "workspace:*"
}
}
}
5 changes: 5 additions & 0 deletions workspaces/bi/bi-extension/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@
* under the License.
*/

import { BI_COMMANDS } from "@wso2/ballerina-core";

// ADD ALL THE NON-SHARED BI ONLY ATTRIBUTES HERE.
export const WI_EXTENSION_ID = 'wso2.wso2-integrator';
export const WI_PROJECT_EXPLORER_VIEW_ID = 'wso2-integrator.explorer';
export const BI_PROJECT_EXPLORER_VIEW_ID = BI_COMMANDS.PROJECT_EXPLORER;
21 changes: 13 additions & 8 deletions workspaces/bi/bi-extension/src/project-explorer/activate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,30 @@ import { SHARED_COMMANDS, BI_COMMANDS } from '@wso2/ballerina-core';
import { ProjectExplorerEntry, ProjectExplorerEntryProvider } from './project-explorer-provider';
import { ExtensionContext, TreeView, commands, window, workspace } from 'vscode';
import { extension } from '../biExtentionContext';
import { BI_PROJECT_EXPLORER_VIEW_ID, WI_PROJECT_EXPLORER_VIEW_ID } from '../constants';

interface ExplorerActivationConfig {
context: ExtensionContext;
isBI: boolean;
isBallerinaPackage?: boolean;
isBallerinaWorkspace?: boolean;
isEmptyWorkspace?: boolean;
isInWI: boolean;
}

export function activateProjectExplorer(config: ExplorerActivationConfig) {
const { context, isBI, isBallerinaPackage, isBallerinaWorkspace, isEmptyWorkspace } = config;
const { context, isBI, isBallerinaPackage, isBallerinaWorkspace, isEmptyWorkspace, isInWI } = config;

if (extension.langClient && extension.biSupported) {
setLoadingStatus();
}

const treeviewId = isInWI ? WI_PROJECT_EXPLORER_VIEW_ID : BI_PROJECT_EXPLORER_VIEW_ID;
const projectExplorerDataProvider = new ProjectExplorerEntryProvider();
const projectTree = createProjectTree(projectExplorerDataProvider);
const projectTree = createProjectTree(projectExplorerDataProvider, treeviewId);

if (isBallerinaPackage || isBallerinaWorkspace) {
registerBallerinaCommands(projectExplorerDataProvider, isBI, isBallerinaWorkspace, isEmptyWorkspace);
registerBallerinaCommands(projectExplorerDataProvider, isBI, isInWI, isBallerinaWorkspace, isEmptyWorkspace);
}

handleVisibilityChangeEvents(
Expand All @@ -57,13 +60,14 @@ function setLoadingStatus() {
commands.executeCommand('setContext', 'BI.status', 'loading');
}

function createProjectTree(dataProvider: ProjectExplorerEntryProvider) {
return window.createTreeView(BI_COMMANDS.PROJECT_EXPLORER, { treeDataProvider: dataProvider });
function createProjectTree(dataProvider: ProjectExplorerEntryProvider, treeviewId: string) {
return window.createTreeView(treeviewId, { treeDataProvider: dataProvider });
}

function registerBallerinaCommands(
dataProvider: ProjectExplorerEntryProvider,
isBI: boolean,
isInWI: boolean,
isBallerinaWorkspace?: boolean,
isEmptyWorkspace?: boolean
) {
Expand All @@ -77,7 +81,7 @@ function registerBallerinaCommands(
}
}
if (isBI) {
registerBICommands();
registerBICommands(isInWI);
}
}

Expand Down Expand Up @@ -131,8 +135,9 @@ function handleNonBallerinaVisibility() {
commands.executeCommand(SHARED_COMMANDS.OPEN_BI_WELCOME);
}

function registerBICommands() {
commands.executeCommand(BI_COMMANDS.FOCUS_PROJECT_EXPLORER);
function registerBICommands(isInWI) {
const treeViewId = isInWI ? WI_PROJECT_EXPLORER_VIEW_ID : BI_PROJECT_EXPLORER_VIEW_ID;
commands.executeCommand(`${treeViewId}.focus`);
commands.executeCommand(SHARED_COMMANDS.SHOW_VISUALIZER);
commands.executeCommand('setContext', 'BI.project', true);
Comment on lines +160 to 164
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Add missing type annotation for isInWI parameter.

The parameter lacks a TypeScript type annotation, which is inconsistent with the rest of the file and may reduce type safety.

-function registerBICommands(isInWI) {
+function registerBICommands(isInWI: boolean) {
 	const treeViewId = isInWI ? WI_PROJECT_EXPLORER_VIEW_ID : BI_PROJECT_EXPLORER_VIEW_ID;
 	commands.executeCommand(`${treeViewId}.focus`);
 	commands.executeCommand(SHARED_COMMANDS.SHOW_VISUALIZER);
 	commands.executeCommand('setContext', 'BI.project', true);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
function registerBICommands(isInWI) {
const treeViewId = isInWI ? WI_PROJECT_EXPLORER_VIEW_ID : BI_PROJECT_EXPLORER_VIEW_ID;
commands.executeCommand(`${treeViewId}.focus`);
commands.executeCommand(SHARED_COMMANDS.SHOW_VISUALIZER);
commands.executeCommand('setContext', 'BI.project', true);
function registerBICommands(isInWI: boolean) {
const treeViewId = isInWI ? WI_PROJECT_EXPLORER_VIEW_ID : BI_PROJECT_EXPLORER_VIEW_ID;
commands.executeCommand(`${treeViewId}.focus`);
commands.executeCommand(SHARED_COMMANDS.SHOW_VISUALIZER);
commands.executeCommand('setContext', 'BI.project', true);
}
🤖 Prompt for AI Agents
In workspaces/bi/bi-extension/src/project-explorer/activate.ts around lines 160
to 164, the function parameter isInWI is missing a TypeScript type annotation;
update the function signature to include an explicit boolean type (e.g. isInWI:
boolean) to match the file's typing conventions and improve type safety, and
then run type-check to ensure no downstream signature issues.

}
9 changes: 7 additions & 2 deletions workspaces/bi/bi-extension/src/stateMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ import { assign, createMachine, interpret } from 'xstate';
import { activateProjectExplorer } from './project-explorer/activate';
import { extension } from './biExtentionContext';
import { fetchProjectInfo, ProjectInfo } from './utils';
import { WI_EXTENSION_ID } from './constants';
import * as vscode from 'vscode';

interface MachineContext {
isBI: boolean;
isBallerinaPackage?: boolean;
isBallerinaWorkspace?: boolean;
isEmptyWorkspace?: boolean;
isInWI: boolean;
}

const stateMachine = createMachine<MachineContext>({
Expand All @@ -34,7 +37,8 @@ const stateMachine = createMachine<MachineContext>({
initial: 'initialize',
predictableActionArguments: true,
context: {
isBI: false
isBI: false,
isInWI: vscode.extensions.getExtension(WI_EXTENSION_ID) ? true : false
},
states: {
initialize: {
Expand Down Expand Up @@ -71,7 +75,8 @@ const stateMachine = createMachine<MachineContext>({
isBI: context.isBI,
isBallerinaPackage: context.isBallerinaPackage,
isBallerinaWorkspace: context.isBallerinaWorkspace,
isEmptyWorkspace: context.isEmptyWorkspace
isEmptyWorkspace: context.isEmptyWorkspace,
isInWI: context.isInWI
});
}
},
Expand Down
2 changes: 1 addition & 1 deletion workspaces/common-libs/rpc-generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,14 @@ const handlerFunction = handlerSourceFile.addFunction({
}]
});
handleImportStatment(handlerSourceFile, 'vscode-messenger', 'Messenger');

// Add statements to the function
const managerObject = `const rpcManger = new ${managerClassName}();`
handlerFunction.addStatements(managerObject);
typeMethods.forEach(value => {
handleMessengerTypes(handlerFunction, value, handlerSourceFile);
})

console.log(`Adding handler function: ${headerComment}...`);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix incorrect variable in log message.

The log message uses headerComment, which is the multi-line license header text (lines 37-56), instead of a meaningful identifier. This will print the entire license to the console rather than identifying which handler is being added.

Apply this diff to fix the log message:

-console.log(`Adding handler function: ${headerComment}...`);
+console.log(`Adding handler function: ${handlerName}...`);

The handlerName variable (defined at line 316) contains the actual function name that's being registered.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
console.log(`Adding handler function: ${headerComment}...`);
console.log(`Adding handler function: ${handlerName}...`);
🤖 Prompt for AI Agents
In workspaces/common-libs/rpc-generator/index.js around line 334, the
console.log uses headerComment (the multi-line license header defined around
lines 37-56) instead of the actual handler identifier; replace the logged value
with handlerName (defined at line 316) so the message reads that the specific
handler function is being added rather than printing the license header.

handleImportStatment(handlerSourceFile, './rpc-manager', managerClassName);

// Format imports into new lines
Expand Down
10 changes: 5 additions & 5 deletions workspaces/common-libs/rpc-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"description": "Generate rpc-manager,rpc-handler and rpc-client ts files in relevant libraries",
"main": "index.js",
"config": {
"CORE_RPC_TYPE_FILE": "ai-panel/index.ts",
"CORE_RPC_TYPE_DIR": "../../ballerina/ballerina-core/",
"EXT_RPC_MANAGER_DIR": "../../ballerina/ballerina-extension/",
"RPC_CLIENT_DIR": "../../ballerina/ballerina-rpc-client/",
"CORE_MODULE_NAME": "@wso2/ballerina-core"
"CORE_RPC_TYPE_FILE": "main/index.ts",
"CORE_RPC_TYPE_DIR": "../../wi/wi-core/",
"EXT_RPC_MANAGER_DIR": "../../wi/wi-extension/",
"RPC_CLIENT_DIR": "../../wi/wi-rpc-client/",
"CORE_MODULE_NAME": "@wso2/wi-core"
},
"scripts": {
"generate": "node index.js"
Expand Down
Loading
Loading