This commit is contained in:
Raphael Piccolo 2024-04-04 10:04:05 +02:00
parent 56d78a93ec
commit 0dc1bb0767

View File

@ -30,7 +30,7 @@ export function activate(context: vscode.ExtensionContext) {
vscode.window.showWarningMessage('URL is not set. Please set the URL first.');
return;
}
await makeHttpRequest({});
await makeHttpRequest({ event: 'ping'});
});
context.subscriptions.push(disposable3);
@ -68,7 +68,7 @@ export function activate(context: vscode.ExtensionContext) {
console.log('Opened file:', filePath);
vscode.window.showInformationMessage(`Opened file: ${filePath}`);
await makeHttpRequest({ opened: filePath });
await makeHttpRequest({ event: 'open', project: extractProjectName(filePath) });
}
});
@ -78,7 +78,7 @@ export function activate(context: vscode.ExtensionContext) {
console.log('Saved file:', filePath);
vscode.window.showInformationMessage(`Saved file: ${filePath}`);
await makeHttpRequest({ saved: filePath });
await makeHttpRequest({ event: 'save', project: extractProjectName(filePath) });
});
// detecte un focus / blur de la fenetre vscode
@ -89,3 +89,8 @@ export function activate(context: vscode.ExtensionContext) {
}
export function deactivate() { }
function extractProjectName(path) {
const match = path.match(/\/root\/(docker|projects)\/([^/]+)/);
return match?.[1];
}