Skip to content

Commit

Permalink
Suppressing prompt for swings
Browse files Browse the repository at this point in the history
  • Loading branch information
lostintangent authored Jul 8, 2021
1 parent 36ddbd4 commit e87ee05
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
10 changes: 9 additions & 1 deletion src/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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") ||
Expand All @@ -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);

Expand Down

0 comments on commit e87ee05

Please sign in to comment.