= ({
+ state,
+}) => {
+ return (
+
+
{state.title}
+ {state.stepContent}
+
+ );
+};
diff --git a/packages/cursorless-vscode/src/VscodeTutorial.ts b/packages/cursorless-vscode/src/VscodeTutorial.ts
index 7aa9a61c47..ca66e35bf3 100644
--- a/packages/cursorless-vscode/src/VscodeTutorial.ts
+++ b/packages/cursorless-vscode/src/VscodeTutorial.ts
@@ -1,8 +1,5 @@
import { TutorialId, TutorialState } from "@cursorless/common";
-import {
- Tutorial,
- TutorialGetContentResponse,
-} from "@cursorless/cursorless-engine";
+import { Tutorial, TutorialContent } from "@cursorless/cursorless-engine";
import { VscodeApi } from "@cursorless/vscode-common";
import {
CancellationToken,
@@ -19,7 +16,7 @@ const VSCODE_TUTORIAL_WEBVIEW_ID = "cursorless.tutorial";
export class VscodeTutorial implements WebviewViewProvider {
private state: TutorialState = { type: "pickingTutorial" };
- private currentTutorial?: TutorialGetContentResponse;
+ private currentTutorial?: TutorialContent;
private view?: WebviewView;
constructor(
@@ -70,6 +67,7 @@ export class VscodeTutorial implements WebviewViewProvider {
stepNumber: 0,
stepContent: this.currentTutorial.steps[0].content,
stepCount: this.currentTutorial.steps.length,
+ title: this.currentTutorial.title,
});
if (this.view != null) {
@@ -79,9 +77,8 @@ export class VscodeTutorial implements WebviewViewProvider {
}
await this.tutorial.setupStep({
- version: 0,
fixturePath: this.currentTutorial.steps[0].fixturePath!,
- tutorialName: tutorialId,
+ tutorialId: tutorialId,
});
}
From c9f56b3342d9322ebede8bfbf295dd8fafd3ee6c Mon Sep 17 00:00:00 2001
From: Pokey Rule <755842+pokey@users.noreply.github.com>
Date: Thu, 28 Mar 2024 10:51:55 +0000
Subject: [PATCH 58/59] more tweaks
---
packages/cursorless-engine/src/core/TutorialImpl.ts | 12 ++++++------
.../src/TutorialStep.tsx | 3 ++-
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/packages/cursorless-engine/src/core/TutorialImpl.ts b/packages/cursorless-engine/src/core/TutorialImpl.ts
index eda9bcce89..50bdd00fd5 100644
--- a/packages/cursorless-engine/src/core/TutorialImpl.ts
+++ b/packages/cursorless-engine/src/core/TutorialImpl.ts
@@ -171,12 +171,11 @@ export class TutorialImpl implements Tutorial {
const editableEditor = ide().getEditableTextEditor(this.editor);
- await editableEditor.edit((editBuilder) => {
- editBuilder.replace(
- editableEditor.document.range,
- fixture.initialState.documentContents,
- );
- });
+ await editableEditor.edit([{
+ range: editableEditor.document.range,
+ text: fixture.initialState.documentContents,
+ isReplace: true,
+ }]);
// Ensure that the expected cursor/selections are present
editableEditor.selections = fixture.initialState.selections.map(
@@ -188,6 +187,7 @@ export class TutorialImpl implements Tutorial {
serializedMarksToTokenHats(fixture.initialState.marks, this.editor),
);
+ // TODO: Handle case where editor is in a background tab
await editableEditor.focus();
}
}
diff --git a/packages/cursorless-vscode-tutorial-webview/src/TutorialStep.tsx b/packages/cursorless-vscode-tutorial-webview/src/TutorialStep.tsx
index 27747dbbae..731713fa52 100644
--- a/packages/cursorless-vscode-tutorial-webview/src/TutorialStep.tsx
+++ b/packages/cursorless-vscode-tutorial-webview/src/TutorialStep.tsx
@@ -10,7 +10,8 @@ export const TutorialStep: FunctionComponent = ({
}) => {
return (
-
{state.title}
+
{state.title}
+
{state.stepContent}
);
From ad8a152d22ed60bacf541a3fd72da2c66cbd9f03 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci-lite[bot]"
<117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Date: Thu, 28 Mar 2024 21:49:57 +0000
Subject: [PATCH 59/59] [pre-commit.ci lite] apply automatic fixes
---
packages/cursorless-engine/src/core/TutorialImpl.ts | 6 ++++--
.../cursorless-vscode-tutorial-webview/src/TutorialStep.tsx | 6 ++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/packages/cursorless-engine/src/core/TutorialImpl.ts b/packages/cursorless-engine/src/core/TutorialImpl.ts
index 50bdd00fd5..ebe892a8da 100644
--- a/packages/cursorless-engine/src/core/TutorialImpl.ts
+++ b/packages/cursorless-engine/src/core/TutorialImpl.ts
@@ -171,11 +171,13 @@ export class TutorialImpl implements Tutorial {
const editableEditor = ide().getEditableTextEditor(this.editor);
- await editableEditor.edit([{
+ await editableEditor.edit([
+ {
range: editableEditor.document.range,
text: fixture.initialState.documentContents,
isReplace: true,
- }]);
+ },
+ ]);
// Ensure that the expected cursor/selections are present
editableEditor.selections = fixture.initialState.selections.map(
diff --git a/packages/cursorless-vscode-tutorial-webview/src/TutorialStep.tsx b/packages/cursorless-vscode-tutorial-webview/src/TutorialStep.tsx
index 731713fa52..5aec9e2e96 100644
--- a/packages/cursorless-vscode-tutorial-webview/src/TutorialStep.tsx
+++ b/packages/cursorless-vscode-tutorial-webview/src/TutorialStep.tsx
@@ -10,8 +10,10 @@ export const TutorialStep: FunctionComponent = ({
}) => {
return (
-
{state.title}
-
+
+ {state.title}
+
+
{state.stepContent}
);