Skip to content

Commit 787f9c7

Browse files
Remove deprecated code (#3321)
1 parent 821225c commit 787f9c7

7 files changed

Lines changed: 7 additions & 168 deletions

File tree

‎cursorless-talon/src/actions/actions.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ def cursorless_vscode_command(command_id: str, target: CursorlessTarget):
117117
118118
Deprecated: prefer `cursorless_ide_command`
119119
"""
120+
# Deprecated 2026-08-31
121+
actions.app.notify(
122+
"Deprecated: cursorless_vscode_command is deprecated, prefer cursorless_ide_command"
123+
)
120124
return actions.user.cursorless_ide_command(command_id, target)
121125

122126
@staticmethod

‎packages/app-vscode/src/createVscodeIde.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ import { FontMeasurementsImpl } from "./ide/vscode/hats/FontMeasurementsImpl";
77
import { VscodeHats } from "./ide/vscode/hats/VscodeHats";
88
import { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem";
99
import { VscodeIDE } from "./ide/vscode/VscodeIDE";
10-
import { vscodeApi } from "./vscodeApi";
1110

1211
export async function createVscodeIde(context: ExtensionContext) {
1312
const vscodeIDE = new VscodeIDE(context);
1413

1514
const hats = new VscodeHats(
1615
vscodeIDE,
17-
vscodeApi,
1816
context,
1917
vscodeIDE.runMode === "test"
2018
? new FakeFontMeasurements()

‎packages/app-vscode/src/ide/vscode/VscodeKeyValueStore.ts‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ import type {
77
import { KEY_VALUE_STORE_DEFAULTS } from "@cursorless/lib-common";
88
import { VERSION_KEY } from "../../ReleaseNotes";
99
import { DONT_SHOW_TALON_UPDATE_MESSAGE_KEY } from "../../ScopeTreeProvider";
10-
import { PERFORMED_PR_1868_SHAPE_UPDATE_INIT_KEY } from "./hats/performPr1868ShapeUpdateInit";
1110

1211
export class VscodeKeyValueStore implements KeyValueStore {
1312
constructor(private extensionContext: ExtensionContext) {
1413
// Mark all keys for synchronization
1514
extensionContext.globalState.setKeysForSync([
1615
...Object.keys(KEY_VALUE_STORE_DEFAULTS),
1716
VERSION_KEY,
18-
PERFORMED_PR_1868_SHAPE_UPDATE_INIT_KEY,
1917
DONT_SHOW_TALON_UPDATE_MESSAGE_KEY,
2018
]);
2119
}

‎packages/app-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts‎

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,9 @@ import fs from "node:fs/promises";
22
import path from "node:path";
33
import { isEqual } from "lodash-es";
44
import vscode from "vscode";
5-
import type {
6-
Listener,
7-
Messages,
8-
PathChangeListener,
9-
} from "@cursorless/lib-common";
5+
import type { Listener, PathChangeListener } from "@cursorless/lib-common";
106
import { getErrorMessage, Notifier } from "@cursorless/lib-common";
117
import { walkFiles } from "@cursorless/lib-node-common";
12-
import type { VscodeApi } from "@cursorless/lib-vscode-common";
138
import type { HatShape, VscodeHatStyleName } from "../hatStyles.types";
149
import { HAT_SHAPES } from "../hatStyles.types";
1510
import { vscodeGetConfigurationString } from "../VscodeConfiguration";
@@ -19,7 +14,6 @@ import type {
1914
} from "../VscodeEnabledHatStyleManager";
2015
import type { FontMeasurements } from "./FontMeasurements";
2116
import { getHatThemeColors } from "./getHatThemeColors";
22-
import { performPr1868ShapeUpdateInit } from "./performPr1868ShapeUpdateInit";
2317
import type { IndividualHatAdjustmentMap } from "./shapeAdjustments";
2418
import {
2519
DEFAULT_HAT_HEIGHT_EM,
@@ -72,9 +66,7 @@ export class VscodeHatRenderer {
7266
private decoder = new TextDecoder("utf-8");
7367

7468
constructor(
75-
private vscodeApi: VscodeApi,
7669
private extensionContext: vscode.ExtensionContext,
77-
private messages: Messages,
7870
private enabledHatStyles: VscodeEnabledHatStyleManager,
7971
private fontMeasurements: FontMeasurements,
8072
) {
@@ -206,16 +198,6 @@ export class VscodeHatRenderer {
206198
.getConfiguration("cursorless")
207199
.get<IndividualHatAdjustmentMap>("individualHatAdjustments")!;
208200

209-
void performPr1868ShapeUpdateInit(
210-
this.extensionContext,
211-
this.vscodeApi,
212-
this.messages,
213-
this.enabledHatStyles.hatStyleMap,
214-
userSizeAdjustment,
215-
userVerticalOffset,
216-
userIndividualAdjustments,
217-
);
218-
219201
const hatSvgMap = Object.fromEntries(
220202
await Promise.all(
221203
HAT_SHAPES.map(async (shape) => {

‎packages/app-vscode/src/ide/vscode/hats/VscodeHats.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import vscode from "vscode";
21
import type { Disposable } from "vscode";
2+
import vscode from "vscode";
33
import type {
44
HatRange,
55
Hats,
@@ -10,7 +10,6 @@ import type {
1010
TextEditor,
1111
} from "@cursorless/lib-common";
1212
import { Notifier } from "@cursorless/lib-common";
13-
import type { VscodeApi } from "@cursorless/lib-vscode-common";
1413
import { toVscodeRange } from "@cursorless/lib-vscode-common";
1514
import type { VscodeHatStyleName } from "../hatStyles.types";
1615
import { VscodeEnabledHatStyleManager } from "../VscodeEnabledHatStyleManager";
@@ -28,17 +27,14 @@ export class VscodeHats implements Hats {
2827

2928
constructor(
3029
private ide: VscodeIDE,
31-
vscodeApi: VscodeApi,
3230
extensionContext: vscode.ExtensionContext,
3331
fontMeasurements: FontMeasurements,
3432
) {
3533
this.enabledHatStyleManager = new VscodeEnabledHatStyleManager(
3634
extensionContext,
3735
);
3836
this.hatRenderer = new VscodeHatRenderer(
39-
vscodeApi,
4037
extensionContext,
41-
ide.messages,
4238
this.enabledHatStyleManager,
4339
fontMeasurements,
4440
);

‎packages/app-vscode/src/ide/vscode/hats/performPr1868ShapeUpdateInit.ts‎

Lines changed: 0 additions & 116 deletions
This file was deleted.

‎packages/app-vscode/src/keyboard/KeyboardConfig.ts‎

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ import type { VscodeApi } from "@cursorless/lib-vscode-common";
44
import type { KeyMap, SectionName, TokenType } from "./TokenTypeHelpers";
55
import type { SectionTypes, TokenTypeValueMap } from "./TokenTypes";
66

7-
const LEGACY_PLURAL_SECTION_NAMES: Record<string, string> = {
8-
action: "actions",
9-
color: "colors",
10-
shape: "shapes",
11-
vscodeCommand: "vscodeCommands",
12-
scope: "scopes",
13-
};
14-
157
/**
168
* Maps from the raw cursor style config value to the corresponding
179
* TextEditorCursorStyle enum value.
@@ -56,22 +48,7 @@ export class KeyboardConfig {
5648
.getConfiguration("cursorless.experimental.keyboard.modal.keybindings")
5749
.get<KeyMap<SectionTypes[S]>>(sectionName);
5850

59-
let section = getSection(sectionName);
60-
61-
if (section == null || Object.keys(section).length === 0) {
62-
const legacySectionName = LEGACY_PLURAL_SECTION_NAMES[sectionName];
63-
64-
if (legacySectionName != null) {
65-
section = getSection(legacySectionName);
66-
if (section != null && Object.keys(section).length > 0) {
67-
void this.vscodeApi.window.showWarningMessage(
68-
`The config section "cursorless.experimental.keyboard.modal.keybindings.${legacySectionName}" is deprecated. Please rename it to "cursorless.experimental.keyboard.modal.keybindings.${sectionName}".`,
69-
);
70-
}
71-
}
72-
}
73-
74-
return section ?? {};
51+
return getSection(sectionName) ?? {};
7552
}
7653

7754
/**

0 commit comments

Comments
 (0)