Skip to content

Commit cbf0445

Browse files
add notification for uninstalling twxs.cmake (#4299)
* add notification for uninstalling twxs.cmake * update changelog
1 parent d2e825e commit cbf0445

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## 1.20.x
44

5+
Improvements:
6+
7+
- Add notification suggesting users to uninstall twxs.cmake now that we have built-in Language Services. [#4288](https://github.com/microsoft/vscode-cmake-tools/issues/4288)
8+
59
Bug Fixes:
610

711
- Fix regression where we weren't properly expanding copyCompileCommands path. [#4294](https://github.com/microsoft/vscode-cmake-tools/issues/4294)

src/extension.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,6 +2358,29 @@ export async function activate(context: vscode.ExtensionContext): Promise<api.CM
23582358
await vscode.window.showWarningMessage(localize('uninstall.old.cmaketools', 'Please uninstall any older versions of the CMake Tools extension. It is now published by Microsoft starting with version 1.2.0.'));
23592359
}
23602360

2361+
const twxsExtension = vscode.extensions.getExtension('twxs.cmake');
2362+
const key = "ms-vscode.cmake-tools.twxs.cmake.showWarning";
2363+
const showTwxsWarning = context.globalState.get(key, true);
2364+
if (twxsExtension && showTwxsWarning) {
2365+
const twxsUninstallString = localize('uninstall.twxs.uninstall', 'Uninstall twxs.cmake');
2366+
void vscode.window.showWarningMessage(localize('uninstall.twxs.cmaketools', 'We recommend that you uninstall the twxs.cmake extension. The CMake Tools extension now provides Language Services and no longer depends on twxs.cmake.'),
2367+
twxsUninstallString).then(async (selection) => {
2368+
// Uninstall twxs.cmake if the user clicked the button or cancelled
2369+
if (selection === twxsUninstallString || selection === undefined) {
2370+
if (selection === twxsUninstallString) {
2371+
// Open extensions pane so user can uninstall the extension.
2372+
void vscode.commands.executeCommand(
2373+
"workbench.extensions.search",
2374+
"twxs.cmake"
2375+
);
2376+
}
2377+
2378+
// Don't show this warning again.
2379+
await context.globalState.update(key, false);
2380+
}
2381+
});
2382+
}
2383+
23612384
const CMAKE_LANGUAGE = "cmake";
23622385
const CMAKE_SELECTOR: vscode.DocumentSelector = [
23632386
{ language: CMAKE_LANGUAGE, scheme: 'file'},

0 commit comments

Comments
 (0)