Skip to content

Commit d395437

Browse files
authored
Merge pull request #977 from madushajg/bi-multi-project-commands
Remove 'Show Examples' command and related functionality
2 parents 6334a41 + e929915 commit d395437

File tree

7 files changed

+6
-49
lines changed

7 files changed

+6
-49
lines changed

workspaces/ballerina/ballerina-extension/package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"activationEvents": [
2727
"onStartupFinished",
2828
"onLanguage:ballerina",
29-
"onCommand:ballerina.showExamples",
3029
"workspaceContains:**/Ballerina.toml",
3130
"onNotebook:ballerina-notebook",
3231
"onUri"
@@ -348,11 +347,6 @@
348347
}
349348
],
350349
"commands": [
351-
{
352-
"command": "ballerina.showExamples",
353-
"title": "Show Examples",
354-
"category": "Ballerina"
355-
},
356350
{
357351
"command": "ballerina.project.build",
358352
"title": "Build",

workspaces/ballerina/ballerina-extension/src/extension.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,9 @@ export async function activateBallerina(): Promise<BallerinaExtension> {
154154
activateEditorSupport(ballerinaExtInstance);
155155

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

160161
//Enable BI Feature
161162
activateBIFeatures(ballerinaExtInstance);

workspaces/ballerina/ballerina-extension/src/features/project/cmds/cmd-runner.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export const PALETTE_COMMANDS = {
5050
SHOW_DIAGRAM: 'ballerina.show.diagram',
5151
SHOW_SOURCE: 'ballerina.show.source',
5252
SHOW_ARCHITECTURE_VIEW: 'ballerina.view.architectureView',
53-
SHOW_EXAMPLES: 'ballerina.showExamples',
5453
REFRESH_SHOW_ARCHITECTURE_VIEW: "ballerina.view.architectureView.refresh",
5554
RUN_CONFIG: 'ballerina.project.run.config',
5655
CONFIG_CREATE_COMMAND: 'ballerina.project.config.create',

workspaces/ballerina/ballerina-extension/src/views/bbe/activator.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,6 @@ function showExamples(context: ExtensionContext, langClient: ExtendedLangClient)
104104
}
105105

106106
export function activate(ballerinaExtInstance: BallerinaExtension) {
107-
const context = <ExtensionContext>ballerinaExtInstance.context;
108-
const langClient = <ExtendedLangClient>ballerinaExtInstance.langClient;
109-
const examplesListRenderer = commands.registerCommand(PALETTE_COMMANDS.SHOW_EXAMPLES, () => {
110-
sendTelemetryEvent(ballerinaExtInstance, TM_EVENT_OPEN_EXAMPLES, CMP_EXAMPLES_VIEW);
111-
showExamples(context, langClient);
112-
});
113-
114-
context.subscriptions.push(examplesListRenderer);
107+
// TODO: Implement this once the samples are available
108+
// https://github.com/wso2/product-ballerina-integrator/issues/1967
115109
}

workspaces/ballerina/ballerina-extension/test/ai/evals/code/utils/batch-processing.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,4 @@ async function setupTestEnvironmentForBatch(projectPath: string): Promise<void>
102102

103103
// Give VSCode time to detect the workspace and trigger activation
104104
await new Promise(resolve => setTimeout(resolve, TIMING.WORKSPACE_SETTLE_DELAY));
105-
106-
// Force extension activation by opening a Ballerina file
107-
try {
108-
const testBalFile = Uri.file(path.join(projectPath, FILES.MAIN_BAL));
109-
await commands.executeCommand(VSCODE_COMMANDS.OPEN, testBalFile);
110-
await new Promise(resolve => setTimeout(resolve, TIMING.FILE_OPEN_DELAY));
111-
} catch (error) {
112-
// Fallback: try to execute a ballerina command to force activation
113-
try {
114-
await commands.executeCommand(VSCODE_COMMANDS.SHOW_EXAMPLES);
115-
} catch (cmdError) {
116-
// Extension might still be loading
117-
}
118-
}
119105
}

workspaces/ballerina/ballerina-extension/test/ai/evals/code/utils/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,5 @@ observabilityIncluded = true
7676
export const VSCODE_COMMANDS = {
7777
CLOSE_ALL_EDITORS: "workbench.action.closeAllEditors",
7878
OPEN: "vscode.open",
79-
SHOW_EXAMPLES: "ballerina.showExamples",
8079
AI_GENERATE_CODE_CORE: "ballerina.test.ai.generateCodeCore"
8180
} as const;

workspaces/ballerina/ballerina-extension/test/ai/integration_tests/libs/setup.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ const PATHS = {
3535

3636
const VSCODE_COMMANDS = {
3737
CLOSE_ALL_EDITORS: "workbench.action.closeAllEditors",
38-
OPEN: "vscode.open",
39-
SHOW_EXAMPLES: "ballerina.showExamples",
38+
OPEN: "vscode.open"
4039
};
4140

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

62-
// Force extension activation by opening a Ballerina file
63-
try {
64-
const PROJECT_ROOT = path.resolve(__dirname, PATHS.PROJECT_ROOT_RELATIVE);
65-
const testBalFile = Uri.file(path.join(PROJECT_ROOT, "main.bal"));
66-
await commands.executeCommand(VSCODE_COMMANDS.OPEN, testBalFile);
67-
await new Promise(resolve => setTimeout(resolve, TIMING.FILE_OPEN_DELAY));
68-
} catch (error) {
69-
// Fallback: try to execute a ballerina command to force activation
70-
try {
71-
await commands.executeCommand(VSCODE_COMMANDS.SHOW_EXAMPLES);
72-
} catch (cmdError) {
73-
// Extension might still be loading
74-
}
75-
}
76-
7761
// Wait for extension to activate (it activates onStartupFinished)
7862
// Give it sufficient time to load language server and initialize
7963
console.log("Waiting for extension activation and language server initialization...");

0 commit comments

Comments
 (0)