Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
add trace
Browse files Browse the repository at this point in the history
  • Loading branch information
apupier committed Sep 27, 2023
1 parent 1f67508 commit 8330c61
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,14 @@ export const COMMAND_ID_START_JAVA_DEBUG = 'camelk.integrations.debug.java';
export const COMMAND_ID_CLASSPATH_REFRESH = 'camelk.classpath.refresh';

export async function activate(context: vscode.ExtensionContext) {
console.log('Begin activation');
stashedContext = context;
await telemetry.initializeTelemetry(context);
console.log('telemetry initialized');
camelKIntegrationsProvider = new CamelKNodeProvider(context);

console.log('Noede integration provider initialized');
applyUserSettings();

console.log('user settings applied');
mainOutputChannel = vscode.window.createOutputChannel("Apache Camel K");
registerCamelKSchemaProvider(mainOutputChannel);
myStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 100);
Expand All @@ -84,8 +86,9 @@ export async function activate(context: vscode.ExtensionContext) {
const tasksJson:vscode.DocumentSelector = { scheme: 'file', language: 'jsonc', pattern: '**/tasks.json' };
vscode.languages.registerCompletionItemProvider(tasksJson, new CamelKTaskCompletionItemProvider());

console.log('task and completion provider registerd');
await installDependencies(context).then ( (): void => {

console.log('in then afer installDepdencies');
createIntegrationsView();

// start the watch listener for auto-updates
Expand Down Expand Up @@ -195,10 +198,13 @@ export async function activate(context: vscode.ExtensionContext) {
await StartJavaDebuggerCommand.start(integrationItem);
telemetry.sendCommandTracking(COMMAND_ID_START_JAVA_DEBUG);
});
console.log('end of then afer installDepdencies');
});

console.log('install depdencies done');
initializeJavaDependenciesManager(context);

console.log('Java dependencies Manager initialized');

vscode.workspace.onDidChangeConfiguration(async (event) => {
await handleChangeRuntimeConfiguration();
closeLogViewWhenIntegrationRemoved = vscode.workspace.getConfiguration().get(config.REMOVE_LOGVIEW_ON_SHUTDOWN_KEY) as boolean;
Expand All @@ -220,6 +226,7 @@ export async function activate(context: vscode.ExtensionContext) {
});

(await telemetry.getTelemetryServiceInstance()).sendStartupEvent();
console.log('activation done');
}

function retrieveIntegratioName(selection: TreeNode) {
Expand Down Expand Up @@ -405,6 +412,7 @@ export async function installDependencies(context: vscode.ExtensionContext) {
try {
const kubectlCliVersion: string | undefined = await kubectlutils.getKubernetesVersion();
if (kubectlCliVersion) {
console.log(`Found Kubernetes CLI (kubectl) version ${kubectlCliVersion}...`);
shareMessageInMainOutputChannel(`Found Kubernetes CLI (kubectl) version ${kubectlCliVersion}...`);
gotKubernetes = true;
}
Expand All @@ -423,11 +431,14 @@ export async function installDependencies(context: vscode.ExtensionContext) {

async function installDependency(name: string, alreadyGot: boolean, context: vscode.ExtensionContext, installFunc: (context: vscode.ExtensionContext) => Promise<Errorable<null>>): Promise<void> {
if (!alreadyGot) {
console.log(`Installing ${name}...`);
shareMessageInMainOutputChannel(`Installing ${name}...`);
const result: Errorable<null> = await installFunc(context);
if (failed(result)) {
console.log(`Unable to install ${name}: ${result.error[0]}`);
utils.shareMessage(mainOutputChannel, `Unable to install ${name}: ${result.error[0]}`);
} else {
console.log(`Installed ${name}`);
shareMessageInMainOutputChannel('done');
}
}
Expand Down

0 comments on commit 8330c61

Please sign in to comment.