feature: renommage disposable2/disposable3 en setUrlCommand/callUrlCommand

This commit is contained in:
2026-07-31 15:01:17 +02:00
parent 087dc3dad1
commit 30b87d515f
+4 -4
View File
@@ -4,7 +4,7 @@ export function activate(context: vscode.ExtensionContext) {
console.log('Congratulations, your extension "vscodestat" is now active!'); console.log('Congratulations, your extension "vscodestat" is now active!');
// commande pour definir l'url // commande pour definir l'url
const disposable2 = vscode.commands.registerCommand('vscodestat.setUrl', async () => { const setUrlCommand = vscode.commands.registerCommand('vscodestat.setUrl', async () => {
const url = await vscode.window.showInputBox({ const url = await vscode.window.showInputBox({
prompt: 'Enter the URL:', prompt: 'Enter the URL:',
placeHolder: '', placeHolder: '',
@@ -15,10 +15,10 @@ export function activate(context: vscode.ExtensionContext) {
vscode.window.showInformationMessage('URL set successfully.'); vscode.window.showInformationMessage('URL set successfully.');
} }
}); });
context.subscriptions.push(disposable2); context.subscriptions.push(setUrlCommand);
// commande pour tester l'url // commande pour tester l'url
const disposable3 = vscode.commands.registerCommand('vscodestat.callUrl', async () => { const callUrlCommand = vscode.commands.registerCommand('vscodestat.callUrl', async () => {
const storedUrl = vscode.workspace.getConfiguration().get('vscodestat.url') as string; const storedUrl = vscode.workspace.getConfiguration().get('vscodestat.url') as string;
if (!storedUrl) { if (!storedUrl) {
vscode.window.showWarningMessage('URL is not set. Please set the URL first.'); vscode.window.showWarningMessage('URL is not set. Please set the URL first.');
@@ -27,7 +27,7 @@ export function activate(context: vscode.ExtensionContext) {
await makeHttpRequest({ event: 'ping' }); await makeHttpRequest({ event: 'ping' });
vscode.window.showInformationMessage('callUrl done'); vscode.window.showInformationMessage('callUrl done');
}); });
context.subscriptions.push(disposable3); context.subscriptions.push(callUrlCommand);
// detecte une ouverture de fichier / nouvel onglet // detecte une ouverture de fichier / nouvel onglet
vscode.window.onDidChangeActiveTextEditor(async (editor) => { vscode.window.onDidChangeActiveTextEditor(async (editor) => {