From e87ee05221d2f8d00bce3572fdf67cc777b627a5 Mon Sep 17 00:00:00 2001 From: Jonathan Carter Date: Thu, 8 Jul 2021 22:36:48 +0000 Subject: [PATCH] Suppressing prompt for swings --- CHANGELOG.md | 4 ++++ package.json | 2 +- src/store/actions.ts | 10 +++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53a2037..d095422 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ - Automatically set the "pattern" record mode when you create a new tour, and select `None` for the git ref - Added support for opening a `*.tour` file in the VS Code notebook editor (Insiders only) +## v0.0.58 (07/08/2021) + +- The "Tours available!" prompt is now suppressed when opening a [CodeSwing](https://aka.ms/codeswing) workspace + ## v0.0.57 (07/08/2021) - Added a new `CodeTour: Custom Tour Directory` setting, that allows a project to specify a custom directory for their tours to be stored in diff --git a/package.json b/package.json index f943f67..c5d884f 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "CodeTour", "description": "VS Code extension that allows you to record and playback guided tours of codebases, directly within the editor", "publisher": "vsls-contrib", - "version": "0.0.57", + "version": "0.0.58", "author": { "name": "Microsoft Corporation" }, diff --git a/src/store/actions.ts b/src/store/actions.ts index 82f0072..f70a462 100644 --- a/src/store/actions.ts +++ b/src/store/actions.ts @@ -145,6 +145,11 @@ export async function moveCurrentCodeTourForward() { _onDidStartTour.fire([store.activeTour!.tour, store.activeTour!.step]); } +async function isCodeSwingWorkspace(uri: Uri) { + const files = await workspace.findFiles("codeswing.json"); + return files && files.length > 0; +} + function isLiveShareWorkspace(uri: Uri) { return ( uri.path.endsWith("Visual Studio Live Share.code-workspace") || @@ -162,7 +167,10 @@ export async function promptForTour( tours.length > 0 && !globalState.get(key) && !isLiveShareWorkspace(workspaceRoot) && - workspace.getConfiguration("codetour").get("promptForWorkspaceTours", true) + workspace + .getConfiguration(EXTENSION_NAME) + .get("promptForWorkspaceTours", true) && + !isCodeSwingWorkspace(workspaceRoot) ) { globalState.update(key, true);