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

import * as vscode from 'vscode';

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

export function resetCommand() {
  return vscode.commands.registerCommand(`${EXTENSION_ID}.reset`, () => {
    telemetry.sendAction('reset');
    coreAPI?.reset();
    projectManager.reset();
    const extensions = ['qt-cpp', 'qt-qml', 'qt-ui'];
    extensions.forEach((extension) => {
      void vscode.commands.executeCommand(`${extension}.reset`);
    });
  });
}