diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..7543c2f --- /dev/null +++ b/LICENSE.md @@ -0,0 +1 @@ +soak diff --git a/package.json b/package.json index 1631a6b..1fe1743 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vscodestat", "displayName": "vscodestat", - "version": "1.0.8", + "version": "1.1.0", "description": "", "categories": [ "Other" diff --git a/src/extension.ts b/src/extension.ts index bdb9a14..4cfe135 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -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; } /*