Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cursorless-talon/src/actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ def cursorless_vscode_command(command_id: str, target: CursorlessTarget):
Deprecated: prefer `cursorless_ide_command`
"""
# Deprecated 2026-08-31
actions.app.notify(
"Deprecated: cursorless_vscode_command is deprecated, prefer cursorless_ide_command"
)
Comment thread
AndreasArvidsson marked this conversation as resolved.
Resolved
return actions.user.cursorless_ide_command(command_id, target)

@staticmethod
Expand Down
2 changes: 0 additions & 2 deletions packages/app-vscode/src/createVscodeIde.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ import { FontMeasurementsImpl } from "./ide/vscode/hats/FontMeasurementsImpl";
import { VscodeHats } from "./ide/vscode/hats/VscodeHats";
import { VscodeFileSystem } from "./ide/vscode/VscodeFileSystem";
import { VscodeIDE } from "./ide/vscode/VscodeIDE";
import { vscodeApi } from "./vscodeApi";

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

const hats = new VscodeHats(
vscodeIDE,
vscodeApi,
context,
vscodeIDE.runMode === "test"
? new FakeFontMeasurements()
Expand Down
2 changes: 0 additions & 2 deletions packages/app-vscode/src/ide/vscode/VscodeKeyValueStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ import type {
import { KEY_VALUE_STORE_DEFAULTS } from "@cursorless/lib-common";
import { VERSION_KEY } from "../../ReleaseNotes";
import { DONT_SHOW_TALON_UPDATE_MESSAGE_KEY } from "../../ScopeTreeProvider";
import { PERFORMED_PR_1868_SHAPE_UPDATE_INIT_KEY } from "./hats/performPr1868ShapeUpdateInit";

export class VscodeKeyValueStore implements KeyValueStore {
constructor(private extensionContext: ExtensionContext) {
// Mark all keys for synchronization
extensionContext.globalState.setKeysForSync([
...Object.keys(KEY_VALUE_STORE_DEFAULTS),
VERSION_KEY,
PERFORMED_PR_1868_SHAPE_UPDATE_INIT_KEY,
DONT_SHOW_TALON_UPDATE_MESSAGE_KEY,
]);
}
Expand Down
20 changes: 1 addition & 19 deletions packages/app-vscode/src/ide/vscode/hats/VscodeHatRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@ import fs from "node:fs/promises";
import path from "node:path";
import { isEqual } from "lodash-es";
import vscode from "vscode";
import type {
Listener,
Messages,
PathChangeListener,
} from "@cursorless/lib-common";
import type { Listener, PathChangeListener } from "@cursorless/lib-common";
import { getErrorMessage, Notifier } from "@cursorless/lib-common";
import { walkFiles } from "@cursorless/lib-node-common";
import type { VscodeApi } from "@cursorless/lib-vscode-common";
import type { HatShape, VscodeHatStyleName } from "../hatStyles.types";
import { HAT_SHAPES } from "../hatStyles.types";
import { vscodeGetConfigurationString } from "../VscodeConfiguration";
Expand All @@ -19,7 +14,6 @@ import type {
} from "../VscodeEnabledHatStyleManager";
import type { FontMeasurements } from "./FontMeasurements";
import { getHatThemeColors } from "./getHatThemeColors";
import { performPr1868ShapeUpdateInit } from "./performPr1868ShapeUpdateInit";
import type { IndividualHatAdjustmentMap } from "./shapeAdjustments";
import {
DEFAULT_HAT_HEIGHT_EM,
Expand Down Expand Up @@ -72,9 +66,7 @@ export class VscodeHatRenderer {
private decoder = new TextDecoder("utf-8");

constructor(
private vscodeApi: VscodeApi,
private extensionContext: vscode.ExtensionContext,
private messages: Messages,
private enabledHatStyles: VscodeEnabledHatStyleManager,
private fontMeasurements: FontMeasurements,
) {
Expand Down Expand Up @@ -206,16 +198,6 @@ export class VscodeHatRenderer {
.getConfiguration("cursorless")
.get<IndividualHatAdjustmentMap>("individualHatAdjustments")!;

void performPr1868ShapeUpdateInit(
this.extensionContext,
this.vscodeApi,
this.messages,
this.enabledHatStyles.hatStyleMap,
userSizeAdjustment,
userVerticalOffset,
userIndividualAdjustments,
);

const hatSvgMap = Object.fromEntries(
await Promise.all(
HAT_SHAPES.map(async (shape) => {
Expand Down
6 changes: 1 addition & 5 deletions packages/app-vscode/src/ide/vscode/hats/VscodeHats.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import vscode from "vscode";
import type { Disposable } from "vscode";
import vscode from "vscode";
import type {
HatRange,
Hats,
Expand All @@ -10,7 +10,6 @@ import type {
TextEditor,
} from "@cursorless/lib-common";
import { Notifier } from "@cursorless/lib-common";
import type { VscodeApi } from "@cursorless/lib-vscode-common";
import { toVscodeRange } from "@cursorless/lib-vscode-common";
import type { VscodeHatStyleName } from "../hatStyles.types";
import { VscodeEnabledHatStyleManager } from "../VscodeEnabledHatStyleManager";
Expand All @@ -28,17 +27,14 @@ export class VscodeHats implements Hats {

constructor(
private ide: VscodeIDE,
vscodeApi: VscodeApi,
extensionContext: vscode.ExtensionContext,
fontMeasurements: FontMeasurements,
) {
this.enabledHatStyleManager = new VscodeEnabledHatStyleManager(
extensionContext,
);
this.hatRenderer = new VscodeHatRenderer(
vscodeApi,
extensionContext,
ide.messages,
this.enabledHatStyleManager,
fontMeasurements,
);
Expand Down

This file was deleted.

25 changes: 1 addition & 24 deletions packages/app-vscode/src/keyboard/KeyboardConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@ import type { VscodeApi } from "@cursorless/lib-vscode-common";
import type { KeyMap, SectionName, TokenType } from "./TokenTypeHelpers";
import type { SectionTypes, TokenTypeValueMap } from "./TokenTypes";

const LEGACY_PLURAL_SECTION_NAMES: Record<string, string> = {
action: "actions",
color: "colors",
shape: "shapes",
vscodeCommand: "vscodeCommands",
scope: "scopes",
};

/**
* Maps from the raw cursor style config value to the corresponding
* TextEditorCursorStyle enum value.
Expand Down Expand Up @@ -56,22 +48,7 @@ export class KeyboardConfig {
.getConfiguration("cursorless.experimental.keyboard.modal.keybindings")
.get<KeyMap<SectionTypes[S]>>(sectionName);

let section = getSection(sectionName);

if (section == null || Object.keys(section).length === 0) {
const legacySectionName = LEGACY_PLURAL_SECTION_NAMES[sectionName];

if (legacySectionName != null) {
section = getSection(legacySectionName);
if (section != null && Object.keys(section).length > 0) {
void this.vscodeApi.window.showWarningMessage(
`The config section "cursorless.experimental.keyboard.modal.keybindings.${legacySectionName}" is deprecated. Please rename it to "cursorless.experimental.keyboard.modal.keybindings.${sectionName}".`,
);
}
}
}

return section ?? {};
return getSection(sectionName) ?? {};
}

/**
Expand Down
Loading