up
This commit is contained in:
@ -42,7 +42,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
console.log('Opened file:', filePath);
|
||||
|
||||
// vscode.window.showInformationMessage(`Opened file: ${filePath}`);
|
||||
await makeHttpRequest({ event: 'open', project: extractProjectName(filePath) });
|
||||
await makeHttpRequest({ event: 'open', project: extractProjectName(filePath), filePath });
|
||||
}
|
||||
});
|
||||
|
||||
@ -52,7 +52,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
console.log('Saved file:', filePath);
|
||||
|
||||
// vscode.window.showInformationMessage(`Saved file: ${filePath}`);
|
||||
await makeHttpRequest({ event: 'save', project: extractProjectName(filePath) });
|
||||
await makeHttpRequest({ event: 'save', project: extractProjectName(filePath), filePath });
|
||||
});
|
||||
|
||||
// detecte un focus / blur de la fenetre vscode
|
||||
@ -70,8 +70,17 @@ export function deactivate() { }
|
||||
* => monitoringserver
|
||||
*/
|
||||
function extractProjectName(path: string) {
|
||||
const match = path.match(/\/root\/docker\/([^/]+)/);
|
||||
return match?.[2];
|
||||
// des c'est l'un des fois l'autre ?
|
||||
// /root/docker/vscodestat/src/extension.ts
|
||||
// \root\docker\vscodestat\src\extension.ts
|
||||
path = path.replace(/\\/g, '/');
|
||||
|
||||
const match = path.match(/\/docker\/([^/]+)/);
|
||||
if (match) {
|
||||
return match[1];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user