Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 0 additions & 6 deletions workspaces/ballerina/ballerina-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"activationEvents": [
"onStartupFinished",
"onLanguage:ballerina",
"onCommand:ballerina.showExamples",
"workspaceContains:**/Ballerina.toml",
"onNotebook:ballerina-notebook",
"onUri"
Expand Down Expand Up @@ -348,11 +347,6 @@
}
],
"commands": [
{
"command": "ballerina.showExamples",
"title": "Show Examples",
"category": "Ballerina"
},
{
"command": "ballerina.project.build",
"title": "Build",
Expand Down
5 changes: 3 additions & 2 deletions workspaces/ballerina/ballerina-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ export async function activateBallerina(): Promise<BallerinaExtension> {
activateEditorSupport(ballerinaExtInstance);

// <------------ MAIN FEATURES ----------->
// Enable Ballerina by examples
activateBBE(ballerinaExtInstance);
// TODO: Enable Ballerina by examples once the samples are available
// https://github.com/wso2/product-ballerina-integrator/issues/1967
// activateBBE(ballerinaExtInstance);

//Enable BI Feature
activateBIFeatures(ballerinaExtInstance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const PALETTE_COMMANDS = {
SHOW_DIAGRAM: 'ballerina.show.diagram',
SHOW_SOURCE: 'ballerina.show.source',
SHOW_ARCHITECTURE_VIEW: 'ballerina.view.architectureView',
SHOW_EXAMPLES: 'ballerina.showExamples',
REFRESH_SHOW_ARCHITECTURE_VIEW: "ballerina.view.architectureView.refresh",
RUN_CONFIG: 'ballerina.project.run.config',
CONFIG_CREATE_COMMAND: 'ballerina.project.config.create',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ function showExamples(context: ExtensionContext, langClient: ExtendedLangClient)
}

export function activate(ballerinaExtInstance: BallerinaExtension) {
const context = <ExtensionContext>ballerinaExtInstance.context;
const langClient = <ExtendedLangClient>ballerinaExtInstance.langClient;
const examplesListRenderer = commands.registerCommand(PALETTE_COMMANDS.SHOW_EXAMPLES, () => {
sendTelemetryEvent(ballerinaExtInstance, TM_EVENT_OPEN_EXAMPLES, CMP_EXAMPLES_VIEW);
showExamples(context, langClient);
});

context.subscriptions.push(examplesListRenderer);
// TODO: Implement this once the samples are available
// https://github.com/wso2/product-ballerina-integrator/issues/1967
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,4 @@ async function setupTestEnvironmentForBatch(projectPath: string): Promise<void>

// Give VSCode time to detect the workspace and trigger activation
await new Promise(resolve => setTimeout(resolve, TIMING.WORKSPACE_SETTLE_DELAY));

// Force extension activation by opening a Ballerina file
try {
const testBalFile = Uri.file(path.join(projectPath, FILES.MAIN_BAL));
await commands.executeCommand(VSCODE_COMMANDS.OPEN, testBalFile);
await new Promise(resolve => setTimeout(resolve, TIMING.FILE_OPEN_DELAY));
} catch (error) {
// Fallback: try to execute a ballerina command to force activation
try {
await commands.executeCommand(VSCODE_COMMANDS.SHOW_EXAMPLES);
} catch (cmdError) {
// Extension might still be loading
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,5 @@ observabilityIncluded = true
export const VSCODE_COMMANDS = {
CLOSE_ALL_EDITORS: "workbench.action.closeAllEditors",
OPEN: "vscode.open",
SHOW_EXAMPLES: "ballerina.showExamples",
AI_GENERATE_CODE_CORE: "ballerina.test.ai.generateCodeCore"
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ const PATHS = {

const VSCODE_COMMANDS = {
CLOSE_ALL_EDITORS: "workbench.action.closeAllEditors",
OPEN: "vscode.open",
SHOW_EXAMPLES: "ballerina.showExamples",
OPEN: "vscode.open"
};

/**
Expand All @@ -59,21 +58,6 @@ export async function setupTestEnvironment(): Promise<void> {
// Wait for workspace to settle and extension to activate
await new Promise(resolve => setTimeout(resolve, TIMING.WORKSPACE_SETTLE_DELAY));

// Force extension activation by opening a Ballerina file
try {
const PROJECT_ROOT = path.resolve(__dirname, PATHS.PROJECT_ROOT_RELATIVE);
const testBalFile = Uri.file(path.join(PROJECT_ROOT, "main.bal"));
await commands.executeCommand(VSCODE_COMMANDS.OPEN, testBalFile);
await new Promise(resolve => setTimeout(resolve, TIMING.FILE_OPEN_DELAY));
} catch (error) {
// Fallback: try to execute a ballerina command to force activation
try {
await commands.executeCommand(VSCODE_COMMANDS.SHOW_EXAMPLES);
} catch (cmdError) {
// Extension might still be loading
}
}

// Wait for extension to activate (it activates onStartupFinished)
// Give it sufficient time to load language server and initialize
console.log("Waiting for extension activation and language server initialization...");
Expand Down
Loading