Skip to content

Commit fc824af

Browse files
Updates
1 parent b424e1d commit fc824af

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

packages/cursorless-tutorial/src/TutorialImpl.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ export class TutorialImpl implements Tutorial, CommandRunnerDecorator {
7575
this.reparseCurrentTutorial = this.reparseCurrentTutorial.bind(this);
7676
const debouncer = new Debouncer(() => this.checkPreconditions(), 100);
7777

78-
void this.loadTutorials().then(() => {
78+
void this.loadTutorials().then(async () => {
7979
if (this.state_.type === "loading") {
80-
this.setState(this.getPickingTutorialState());
80+
await this.setState(this.getPickingTutorialState());
8181
}
8282
});
8383

@@ -176,7 +176,7 @@ export class TutorialImpl implements Tutorial, CommandRunnerDecorator {
176176
);
177177

178178
this.currentTutorial = tutorialContent;
179-
this.setState(
179+
await this.setState(
180180
state.hasErrors
181181
? {
182182
...state,
@@ -211,7 +211,7 @@ export class TutorialImpl implements Tutorial, CommandRunnerDecorator {
211211
);
212212

213213
this.currentTutorial = tutorialContent;
214-
this.setState(state);
214+
await this.setState(state);
215215

216216
await this.setupStep();
217217
}
@@ -250,7 +250,7 @@ export class TutorialImpl implements Tutorial, CommandRunnerDecorator {
250250

251251
const nextStep = this.currentTutorial!.steps[newStepNumber];
252252

253-
this.setState({
253+
await this.setState({
254254
type: "doingTutorial",
255255
hasErrors: false,
256256
id: this.state_.id,
@@ -281,15 +281,15 @@ export class TutorialImpl implements Tutorial, CommandRunnerDecorator {
281281
}
282282

283283
async list() {
284-
this.setState(this.getPickingTutorialState());
284+
await this.setState(this.getPickingTutorialState());
285285
await this.setupStep();
286286
}
287287

288-
private setState(state: TutorialState) {
288+
private async setState(state: TutorialState) {
289289
this.state_ = state;
290290

291291
if (state.type === "doingTutorial") {
292-
void this.ide.keyValueStore.set(
292+
await this.ide.keyValueStore.set(
293293
"tutorialProgress",
294294
produce(this.ide.keyValueStore.get("tutorialProgress"), (draft) => {
295295
draft[state.id] = {
@@ -317,7 +317,7 @@ export class TutorialImpl implements Tutorial, CommandRunnerDecorator {
317317
);
318318

319319
if (this.editor !== editor && this.editor != null) {
320-
void this.ide.setHighlightRanges(HIGHLIGHT_COLOR, this.editor, []);
320+
await this.ide.setHighlightRanges(HIGHLIGHT_COLOR, this.editor, []);
321321
}
322322

323323
this.editor = editor;
@@ -353,7 +353,7 @@ export class TutorialImpl implements Tutorial, CommandRunnerDecorator {
353353
currentStep,
354354
);
355355
if (preConditionsMet !== this.state_.preConditionsMet) {
356-
this.setState({
356+
await this.setState({
357357
...this.state_,
358358
preConditionsMet,
359359
});

packages/cursorless-vscode/src/ide/vscode/hats/FakeFontMeasurements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class FakeFontMeasurements implements FontMeasurements {
55
characterWidth = 12;
66
characterHeight = 12;
77

8-
clearCache() {
8+
async clearCache() {
99
// Do nothing
1010
}
1111

packages/cursorless-vscode/src/ide/vscode/hats/FontMeasurements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ export interface FontMeasurements {
22
fontSize: number;
33
characterWidth: number;
44
characterHeight: number;
5-
clearCache(): void;
5+
clearCache(): Promise<void>;
66
calculate(): Promise<void>;
77
}

packages/cursorless-vscode/src/ide/vscode/hats/FontMeasurementsImpl.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export class FontMeasurementsImpl implements FontMeasurements {
2020

2121
constructor(private extensionContext: vscode.ExtensionContext) {}
2222

23-
clearCache() {
24-
void this.extensionContext.globalState.update("fontRatios", undefined);
23+
async clearCache() {
24+
await this.extensionContext.globalState.update("fontRatios", undefined);
2525
}
2626

2727
async calculate() {

packages/cursorless-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default class VscodeHatRenderer {
9595
}
9696

9797
public async forceRecomputeDecorationStyles() {
98-
this.fontMeasurements.clearCache();
98+
await this.fontMeasurements.clearCache();
9999
await this.recomputeDecorations();
100100
}
101101

@@ -203,7 +203,7 @@ export default class VscodeHatRenderer {
203203
.getConfiguration("cursorless")
204204
.get<IndividualHatAdjustmentMap>("individualHatAdjustments")!;
205205

206-
await performPr1868ShapeUpdateInit(
206+
void performPr1868ShapeUpdateInit(
207207
this.extensionContext,
208208
this.vscodeApi,
209209
this.messages,

0 commit comments

Comments
 (0)