aboutsummaryrefslogtreecommitdiffstats
path: root/qt-cpp/src/commands/scan-qt-kits.ts
blob: 0408686a2e64aea98fbc2bc4fb1dcbe1805b8c2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only

import * as vscode from 'vscode';

import { IsWindows, telemetry } from 'qt-lib';
import { kitManager } from '@/extension';
import { EXTENSION_ID } from '@/constants';

export function registerScanForQtKitsCommand() {
  return vscode.commands.registerCommand(
    `${EXTENSION_ID}.scanForQtKits`,
    async () => {
      telemetry.sendAction('scanForQtKits');
      if (IsWindows) {
        await vscode.commands.executeCommand('cmake.scanForKits');
      }
      await kitManager.checkForAllQtInstallations();
    }
  );
}