From 3b76300c97e0887a2acd98aaedd4cf794cc8ba84 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sat, 29 Aug 2026 23:09:24 +0200 Subject: [PATCH 1/6] Started working on generating actions/README.md --- .../src/references/ReferenceEntry.ts | 48 ++ .../src/references/actionReferenceGroups.ts | 159 +++++++ .../src/references/actionReferences.ts | 448 +++++++++++++++--- packages/lib-common/src/references/index.ts | 1 + packages/tool-meta-updater/src/cleanId.ts | 3 + packages/tool-meta-updater/src/metaUpdater.ts | 13 +- .../src/updateReferenceReadmeMd.ts | 37 ++ 7 files changed, 629 insertions(+), 80 deletions(-) create mode 100644 packages/lib-common/src/references/actionReferenceGroups.ts create mode 100644 packages/tool-meta-updater/src/cleanId.ts create mode 100644 packages/tool-meta-updater/src/updateReferenceReadmeMd.ts diff --git a/packages/lib-common/src/references/ReferenceEntry.ts b/packages/lib-common/src/references/ReferenceEntry.ts index fb44632f76..681b52f480 100644 --- a/packages/lib-common/src/references/ReferenceEntry.ts +++ b/packages/lib-common/src/references/ReferenceEntry.ts @@ -13,6 +13,54 @@ export interface ReferenceEntry extends SpokenFormReference { examples: ExampleDefinition[]; } +export interface GroupedReferenceEntry< + T extends string, +> extends ReferenceEntry { + group: { + id: T; + index: number; + }; +} + +type ActionReferenceGroupId = + | "cursor" + | "change" + | "clone" + | "clipboard" + | "swap" + | "indentation" + | "numbers" + | "emptyLines" + | "homophones" + | "rename" + | "scroll" + | "insert" + | "move" + | "reorder" + | "wrap" + | "navigation" + | "folding" + | "extract" + | "join" + | "break" + | "visual" + | "snippets" + | "git" + | "editor" + | "targetContext" + | "private"; + +export interface ReferenceGroup { + id: T; + name: string; + description: string[]; +} + +export type ActionReferenceGroup = ReferenceGroup; + +export type ActionReferenceEntry = + GroupedReferenceEntry; + interface SyntaxDefinition { pattern: string; description: string; diff --git a/packages/lib-common/src/references/actionReferenceGroups.ts b/packages/lib-common/src/references/actionReferenceGroups.ts new file mode 100644 index 0000000000..f28aaeb60e --- /dev/null +++ b/packages/lib-common/src/references/actionReferenceGroups.ts @@ -0,0 +1,159 @@ +import type { ActionReferenceGroup } from "./ReferenceEntry"; + +export const actionReferenceGroups: ActionReferenceGroup[] = [ + { + id: "cursor", + name: "Cursor movement", + description: [ + "Despite the name Cursorless, some of the most basic commands in Cursorless are for moving the cursor.", + "", + "Note that when combined with list targets, `take`/`pre`/`post` commands will result in multiple cursors.", + ], + }, + { + id: "change", + name: "Changing a target", + description: [ + "Actions that delete or change a target's text while keeping the cursor in a useful location.", + ], + }, + { + id: "clone", + name: "Clone", + description: [ + "Insert a copy of a target before or after itself and select the newly created copy.", + ], + }, + { + id: "clipboard", + name: "Cut, copy, and paste", + description: ["Transfer targets using the system clipboard."], + }, + { + id: "swap", + name: "Swap", + description: [ + "Swap two targets. If each side contains multiple targets, the targets are zipped together and swapped pairwise.", + ], + }, + { + id: "indentation", + name: "Indent and outdent", + description: ["Increase or decrease the indentation of a target."], + }, + { + id: "numbers", + name: "Increment and decrement", + description: ["Increase or decrease a number target."], + }, + { + id: "emptyLines", + name: "Insert empty lines or scopes", + description: [ + "Insert editable space before, after, or around a target.", + "", + "With a syntactic scope target, these actions insert the appropriate delimiters for a new instance of that scope.", + ], + }, + { + id: "homophones", + name: "Homophones", + description: ["Cycle a target through its homophones."], + }, + { + id: "rename", + name: "Rename", + description: ["Use the editor's rename operation on a target."], + }, + { + id: "scroll", + name: "Scroll", + description: [ + "Scroll a target to the top, center, or bottom of the viewport.", + ], + }, + { + id: "insert", + name: "Insert, use, and repeat", + description: [ + "Insert or use the contents of one target at the current selection or another destination.", + ], + }, + { + id: "move", + name: "Move and replace", + description: [ + "Move a target to the current selection or another destination.", + ], + }, + { + id: "reorder", + name: "Reverse, shuffle, and sort", + description: ["Change the order of multiple targets or selections."], + }, + { + id: "wrap", + name: "Wrap and rewrap", + description: [ + "Wrap a target with paired delimiters, or replace its existing delimiters.", + ], + }, + { + id: "navigation", + name: "Navigate and inspect", + description: [ + "Navigate to related code, search for a target, or show editor information and available fixes.", + ], + }, + { + id: "folding", + name: "Fold and unfold", + description: ["Fold or unfold the region containing a target."], + }, + { + id: "extract", + name: "Extract", + description: [ + "Extract a target into a variable using the editor's refactor action.", + ], + }, + { + id: "join", + name: "Join", + description: ["Join multiple lines into one line."], + }, + { + id: "break", + name: "Break", + description: ["Break a line in two before a target."], + }, + { + id: "visual", + name: "Visual feedback", + description: ["Temporarily identify or persistently highlight targets."], + }, + { + id: "snippets", + name: "Snippets", + description: ["Generate, insert, or wrap targets with snippets."], + }, + { + id: "git", + name: "Git", + description: ["Accept, revert, stage, or unstage Git changes."], + }, + { + id: "editor", + name: "Editor commands", + description: [ + "Run editor operations such as formatting, commenting, and toggling breakpoints.", + ], + }, + { + id: "targetContext", + name: "Target context", + description: [ + "Set contextual references that can be used to resolve later targets.", + ], + }, +]; diff --git a/packages/lib-common/src/references/actionReferences.ts b/packages/lib-common/src/references/actionReferences.ts index eb077f72d9..27594902f6 100644 --- a/packages/lib-common/src/references/actionReferences.ts +++ b/packages/lib-common/src/references/actionReferences.ts @@ -22,7 +22,7 @@ import { } from "./constants"; import { modifierReferences } from "./modifierReferences"; import { pairedDelimiterReferences } from "./pairedDelimiterReferences"; -import type { ReferenceEntry } from "./ReferenceEntry"; +import type { ActionReferenceEntry } from "./ReferenceEntry"; import { scopeReferences } from "./scopeReferences"; import { connectiveDefaultSpokenForms } from "./spokenForms/connectiveDefaultSpokenForms"; @@ -46,9 +46,76 @@ const ON = connectiveDefaultSpokenForms.on; type TalonSideActionType = "applyFormatter" | "nextHomophone"; export const actionReferences = { + setSelection: { + name: "Set selection", + defaultSpokenForm: SET_SELECTION, + group: { + id: "cursor", + index: 0, + }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Set selection to ${VAR_TARGET}.`, + cheatsheet: "Set selection", + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Selects the ${TARGET_DESC}.`, + }, + ], + }, + setSelectionBefore: { + name: "Set selection before", + defaultSpokenForm: "pre", + group: { + id: "cursor", + index: 1, + }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Set empty selection before ${VAR_TARGET}.`, + cheatsheet: "Set selection before", + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Places the cursor before the ${TARGET_DESC}.`, + }, + ], + }, + setSelectionAfter: { + name: "Set selection after", + defaultSpokenForm: "post", + group: { + id: "cursor", + index: 2, + }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Set empty selection after ${VAR_TARGET}.`, + cheatsheet: "Set selection after", + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Places the cursor after the ${TARGET_DESC}.`, + }, + ], + }, addSelection: { name: "Add selection", defaultSpokenForm: "append", + group: { + id: "cursor", + index: 3, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -63,9 +130,34 @@ export const actionReferences = { }, ], }, + addSelectionBefore: { + name: "Add selection before", + defaultSpokenForm: "append pre", + group: { + id: "cursor", + index: 4, + }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Adds empty selection before ${VAR_TARGET} to the current selection set.`, + cheatsheet: "Add selection before", + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Adds an empty selection before the ${TARGET_DESC}.`, + }, + ], + }, addSelectionAfter: { name: "Add selection after", defaultSpokenForm: "append post", + group: { + id: "cursor", + index: 5, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -80,26 +172,35 @@ export const actionReferences = { }, ], }, - addSelectionBefore: { - name: "Add selection before", - defaultSpokenForm: "append pre", + deselect: { + name: "Deselect", + defaultSpokenForm: "give", + group: { + id: "cursor", + index: 6, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Adds empty selection before ${VAR_TARGET} to the current selection set.`, - cheatsheet: "Add selection before", + description: `Deselect ${VAR_TARGET}.`, + cheatsheet: "Deselect", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Adds an empty selection before the ${TARGET_DESC}.`, + description: `Removes the ${TARGET_DESC} from the current selections.`, }, ], }, + breakLine: { name: "Break line", defaultSpokenForm: "break", + group: { + id: "break", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -117,6 +218,10 @@ export const actionReferences = { clearAndSetSelection: { name: "Change", defaultSpokenForm: "change", + group: { + id: "change", + index: 1, + }, legacySpokenForms: ["clear"], syntaxes: [ { @@ -135,6 +240,10 @@ export const actionReferences = { copyToClipboard: { name: "Copy to clipboard", defaultSpokenForm: "copy", + group: { + id: "clipboard", + index: 1, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -152,6 +261,10 @@ export const actionReferences = { cutToClipboard: { name: "Cut to clipboard", defaultSpokenForm: "carve", + group: { + id: "clipboard", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -169,6 +282,10 @@ export const actionReferences = { decrement: { name: "Decrement", defaultSpokenForm: "decrement", + group: { + id: "numbers", + index: 1, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -183,26 +300,13 @@ export const actionReferences = { }, ], }, - deselect: { - name: "Deselect", - defaultSpokenForm: "give", - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: `Deselect ${VAR_TARGET}.`, - cheatsheet: "Deselect", - }, - ], - examples: [ - { - command: DEFAULT_COMMAND, - description: `Removes the ${TARGET_DESC} from the current selections.`, - }, - ], - }, editNewLineAfter: { name: "Edit new line/scope after", defaultSpokenForm: "pour", + group: { + id: "emptyLines", + index: 1, + }, description: "Scope defaults to line.", syntaxes: [ { @@ -230,6 +334,10 @@ export const actionReferences = { editNewLineBefore: { name: "Edit new line/scope before", defaultSpokenForm: "drink", + group: { + id: "emptyLines", + index: 0, + }, description: "Scope defaults to line.", syntaxes: [ { @@ -257,6 +365,10 @@ export const actionReferences = { "experimental.setInstanceReference": { name: "Set instance reference", defaultSpokenForm: "from", + group: { + id: "targetContext", + index: 0, + }, description: "Sets the instance reference for the next 'instance of' action.", syntaxes: [ @@ -276,6 +388,10 @@ export const actionReferences = { extractVariable: { name: "Extract variable", defaultSpokenForm: "extract", + group: { + id: "extract", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -293,6 +409,10 @@ export const actionReferences = { findInDocument: { name: "Find in document", defaultSpokenForm: "scout", + group: { + id: "navigation", + index: 5, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -310,6 +430,10 @@ export const actionReferences = { findInWorkspace: { name: "Find in workspace", defaultSpokenForm: "scout all", + group: { + id: "navigation", + index: 6, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -327,6 +451,10 @@ export const actionReferences = { flashTargets: { name: "Flash target", defaultSpokenForm: "flash", + group: { + id: "visual", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -344,6 +472,10 @@ export const actionReferences = { foldRegion: { name: "Fold region", defaultSpokenForm: "fold", + group: { + id: "folding", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -361,6 +493,10 @@ export const actionReferences = { followLink: { name: "Follow link", defaultSpokenForm: "follow", + group: { + id: "navigation", + index: 7, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -378,6 +514,10 @@ export const actionReferences = { followLinkAside: { name: "Follow link aside", defaultSpokenForm: "follow split", + group: { + id: "navigation", + index: 8, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -395,6 +535,10 @@ export const actionReferences = { gitAccept: { name: "Git accept", defaultSpokenForm: "git accept", + group: { + id: "git", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -412,6 +556,10 @@ export const actionReferences = { gitRevert: { name: "Git revert", defaultSpokenForm: "git revert", + group: { + id: "git", + index: 1, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -429,6 +577,10 @@ export const actionReferences = { gitStage: { name: "Git stage", defaultSpokenForm: "git stage", + group: { + id: "git", + index: 2, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -446,6 +598,10 @@ export const actionReferences = { gitUnstage: { name: "Git unstage", defaultSpokenForm: "git unstage", + group: { + id: "git", + index: 3, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -463,6 +619,10 @@ export const actionReferences = { increment: { name: "Increment", defaultSpokenForm: "increment", + group: { + id: "numbers", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -480,6 +640,10 @@ export const actionReferences = { indentLine: { name: "Indent line", defaultSpokenForm: "indent", + group: { + id: "indentation", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -497,6 +661,10 @@ export const actionReferences = { insertCopyAfter: { name: "Insert copy after", defaultSpokenForm: "clone", + group: { + id: "clone", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -514,6 +682,10 @@ export const actionReferences = { insertCopyBefore: { name: "Insert copy before", defaultSpokenForm: "clone up", + group: { + id: "clone", + index: 1, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -531,6 +703,10 @@ export const actionReferences = { insertEmptyLineAfter: { name: "Insert empty line/scope after", defaultSpokenForm: "float", + group: { + id: "emptyLines", + index: 3, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -552,6 +728,10 @@ export const actionReferences = { insertEmptyLineBefore: { name: "Insert empty line/scope before", defaultSpokenForm: "drop", + group: { + id: "emptyLines", + index: 2, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -573,6 +753,10 @@ export const actionReferences = { insertEmptyLinesAround: { name: "Insert empty lines/scopes around", defaultSpokenForm: "puff", + group: { + id: "emptyLines", + index: 4, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -594,6 +778,10 @@ export const actionReferences = { joinLines: { name: "Join lines", defaultSpokenForm: "join", + group: { + id: "join", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -611,6 +799,10 @@ export const actionReferences = { outdentLine: { name: "Outdent line", defaultSpokenForm: "dedent", + group: { + id: "indentation", + index: 1, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -628,6 +820,10 @@ export const actionReferences = { randomizeTargets: { name: "Randomize targets", defaultSpokenForm: "shuffle", + group: { + id: "reorder", + index: 1, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -645,6 +841,10 @@ export const actionReferences = { remove: { name: "Remove", defaultSpokenForm: REMOVE, + group: { + id: "change", + index: 0, + }, description: "This action can be used to remove a target without moving the cursor.", syntaxes: [ @@ -664,6 +864,10 @@ export const actionReferences = { rename: { name: "Rename", defaultSpokenForm: "rename", + group: { + id: "rename", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -681,6 +885,10 @@ export const actionReferences = { revealDefinition: { name: "Reveal definition", defaultSpokenForm: "define", + group: { + id: "navigation", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -698,6 +906,10 @@ export const actionReferences = { revealTypeDefinition: { name: "Reveal type definition", defaultSpokenForm: "type deaf", + group: { + id: "navigation", + index: 1, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -715,6 +927,10 @@ export const actionReferences = { reverseTargets: { name: "Reverse targets", defaultSpokenForm: "reverse", + group: { + id: "reorder", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -732,6 +948,10 @@ export const actionReferences = { scrollToBottom: { name: "Scroll to bottom", defaultSpokenForm: "bottom", + group: { + id: "scroll", + index: 2, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -749,6 +969,10 @@ export const actionReferences = { scrollToCenter: { name: "Scroll to center", defaultSpokenForm: "center", + group: { + id: "scroll", + index: 1, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -766,6 +990,10 @@ export const actionReferences = { scrollToTop: { name: "Scroll to top", defaultSpokenForm: "crown", + group: { + id: "scroll", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -780,60 +1008,13 @@ export const actionReferences = { }, ], }, - setSelection: { - name: "Set selection", - defaultSpokenForm: SET_SELECTION, - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: `Set selection to ${VAR_TARGET}.`, - cheatsheet: "Set selection", - }, - ], - examples: [ - { - command: DEFAULT_COMMAND, - description: `Selects the ${TARGET_DESC}.`, - }, - ], - }, - setSelectionAfter: { - name: "Set selection after", - defaultSpokenForm: "post", - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: `Set empty selection after ${VAR_TARGET}.`, - cheatsheet: "Set selection after", - }, - ], - examples: [ - { - command: DEFAULT_COMMAND, - description: `Places the cursor after the ${TARGET_DESC}.`, - }, - ], - }, - setSelectionBefore: { - name: "Set selection before", - defaultSpokenForm: "pre", - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: `Set empty selection before ${VAR_TARGET}.`, - cheatsheet: "Set selection before", - }, - ], - examples: [ - { - command: DEFAULT_COMMAND, - description: `Places the cursor before the ${TARGET_DESC}.`, - }, - ], - }, showDebugHover: { name: "Show debug hover", defaultSpokenForm: "inspect", + group: { + id: "navigation", + index: 9, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -851,6 +1032,10 @@ export const actionReferences = { showHover: { name: "Show hover", defaultSpokenForm: "hover", + group: { + id: "navigation", + index: 3, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -868,6 +1053,10 @@ export const actionReferences = { showQuickFix: { name: "Show quick fix", defaultSpokenForm: "quick fix", + group: { + id: "navigation", + index: 4, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -885,6 +1074,10 @@ export const actionReferences = { showReferences: { name: "Show references", defaultSpokenForm: "reference", + group: { + id: "navigation", + index: 2, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -902,6 +1095,10 @@ export const actionReferences = { sortTargets: { name: "Sort targets", defaultSpokenForm: "sort", + group: { + id: "reorder", + index: 2, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -919,6 +1116,10 @@ export const actionReferences = { toggleLineBreakpoint: { name: "Toggle line/scope breakpoint", defaultSpokenForm: "break point", + group: { + id: "editor", + index: 2, + }, description: "Scope defaults to line.", syntaxes: [ { @@ -946,6 +1147,10 @@ export const actionReferences = { toggleLineComment: { name: "Toggle line comment", defaultSpokenForm: "comment", + group: { + id: "editor", + index: 1, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -963,6 +1168,10 @@ export const actionReferences = { unfoldRegion: { name: "Unfold region", defaultSpokenForm: "unfold", + group: { + id: "folding", + index: 1, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -980,6 +1189,10 @@ export const actionReferences = { callAsFunction: { name: "Call as function", defaultSpokenForm: "call", + group: { + id: "insert", + index: 1, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -1006,6 +1219,10 @@ export const actionReferences = { generateSnippet: { name: "Generate snippet", defaultSpokenForm: "snip make", + group: { + id: "snippets", + index: 0, + }, legacySpokenForms: ["snippet make"], syntaxes: [ { @@ -1024,6 +1241,10 @@ export const actionReferences = { highlight: { name: "Highlight", defaultSpokenForm: "highlight", + group: { + id: "visual", + index: 1, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -1041,6 +1262,10 @@ export const actionReferences = { insertSnippet: { name: "Insert snippet", defaultSpokenForm: "snip", + group: { + id: "snippets", + index: 1, + }, syntaxes: [ { pattern: `${VAR_SPOKEN_FORM} ${VAR_SNIPPET} ${VAR_DESTINATION}`, @@ -1058,6 +1283,10 @@ export const actionReferences = { moveToTarget: { name: "Move to target", defaultSpokenForm: "move", + group: { + id: "move", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -1084,6 +1313,10 @@ export const actionReferences = { pasteFromClipboard: { name: "Paste from clipboard", defaultSpokenForm: "paste", + group: { + id: "clipboard", + index: 2, + }, syntaxes: [ { pattern: `${VAR_SPOKEN_FORM} ${VAR_DESTINATION}`, @@ -1101,6 +1334,10 @@ export const actionReferences = { replaceWithTarget: { name: "Replace with target", defaultSpokenForm: "bring", + group: { + id: "insert", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -1127,6 +1364,10 @@ export const actionReferences = { rewrapWithPairedDelimiter: { name: "Rewrap with paired delimiter", defaultSpokenForm: "repack", + group: { + id: "wrap", + index: 1, + }, syntaxes: [ { pattern: `${VAR_PAIR} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, @@ -1144,6 +1385,10 @@ export const actionReferences = { swapTargets: { name: "Swap targets", defaultSpokenForm: "swap", + group: { + id: "swap", + index: 0, + }, syntaxes: [ { pattern: `${VAR_SPOKEN_FORM} ${WITH} ${VAR_TARGET}`, @@ -1170,6 +1415,10 @@ export const actionReferences = { wrapWithPairedDelimiter: { name: "Wrap with paired delimiter", defaultSpokenForm: "wrap", + group: { + id: "wrap", + index: 0, + }, syntaxes: [ { pattern: `${VAR_PAIR} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, @@ -1187,6 +1436,10 @@ export const actionReferences = { wrapWithSnippet: { name: "Wrap with snippet", defaultSpokenForm: "wrap", + group: { + id: "snippets", + index: 2, + }, syntaxes: [ { pattern: `${VAR_SNIPPET} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, @@ -1204,6 +1457,10 @@ export const actionReferences = { applyFormatter: { name: "Apply formatter", defaultSpokenForm: "format", + group: { + id: "editor", + index: 0, + }, syntaxes: [ { pattern: `${VAR_SPOKEN_FORM} ${VAR_FORMATTER} ${AT} ${VAR_TARGET}`, @@ -1221,6 +1478,10 @@ export const actionReferences = { nextHomophone: { name: "Next homophone", defaultSpokenForm: "phones", + group: { + id: "homophones", + index: 0, + }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -1241,6 +1502,10 @@ export const actionReferences = { "private.showParseTree": { name: "Show parse tree", defaultSpokenForm: "parse tree", + group: { + id: "private", + index: 0, + }, private: true, syntaxes: [ { @@ -1260,12 +1525,20 @@ export const actionReferences = { name: "Parsed", defaultSpokenForm: "parsed", private: true, + group: { + id: "private", + index: 1, + }, syntaxes: [], examples: [], }, "private.getTargets": { name: "Get targets", defaultSpokenForm: "get targets", + group: { + id: "private", + index: 2, + }, private: true, syntaxes: [], examples: [], @@ -1273,6 +1546,10 @@ export const actionReferences = { "private.setKeyboardTarget": { name: "Set keyboard target", defaultSpokenForm: "set keyboard target", + group: { + id: "private", + index: 3, + }, private: true, syntaxes: [], examples: [], @@ -1280,6 +1557,10 @@ export const actionReferences = { executeCommand: { name: "Execute command", defaultSpokenForm: "execute command", + group: { + id: "private", + index: 4, + }, private: true, syntaxes: [], examples: [], @@ -1287,6 +1568,10 @@ export const actionReferences = { editNew: { name: "Edit new", defaultSpokenForm: "edit new", + group: { + id: "private", + index: 5, + }, private: true, syntaxes: [], examples: [], @@ -1294,6 +1579,10 @@ export const actionReferences = { getText: { name: "Get text", defaultSpokenForm: "get text", + group: { + id: "private", + index: 6, + }, private: true, syntaxes: [], examples: [], @@ -1301,8 +1590,15 @@ export const actionReferences = { replace: { name: "Replace", defaultSpokenForm: "replace", + group: { + id: "private", + index: 7, + }, private: true, syntaxes: [], examples: [], }, -} as const satisfies Record; +} as const satisfies Record< + ActionType | TalonSideActionType, + ActionReferenceEntry +>; diff --git a/packages/lib-common/src/references/index.ts b/packages/lib-common/src/references/index.ts index d97391e702..e6625c1858 100644 --- a/packages/lib-common/src/references/index.ts +++ b/packages/lib-common/src/references/index.ts @@ -1,4 +1,5 @@ export * from "./actionReferences"; +export * from "./actionReferenceGroups"; export * from "./spokenForms/connectiveDefaultSpokenForms"; export * from "./spokenForms/graphemeDefaultSpokenForms"; export * from "./spokenForms/markDefaultSpokenForms"; diff --git a/packages/tool-meta-updater/src/cleanId.ts b/packages/tool-meta-updater/src/cleanId.ts new file mode 100644 index 0000000000..8c16dc4a07 --- /dev/null +++ b/packages/tool-meta-updater/src/cleanId.ts @@ -0,0 +1,3 @@ +export function cleanId(id: string): string { + return id.replace("private.", "").replace("experimental.", ""); +} diff --git a/packages/tool-meta-updater/src/metaUpdater.ts b/packages/tool-meta-updater/src/metaUpdater.ts index dd773f704c..3740e05ba0 100644 --- a/packages/tool-meta-updater/src/metaUpdater.ts +++ b/packages/tool-meta-updater/src/metaUpdater.ts @@ -6,17 +6,20 @@ import { readWantedLockfile } from "@pnpm/lockfile-file"; import { createUpdateOptions } from "@pnpm/meta-updater"; import { + actionReferenceGroups, actionReferences, languageScopeSupport, modifierReferences, scopeReferences, } from "@cursorless/lib-common"; +import { cleanId } from "./cleanId"; import type { Context } from "./Context"; import { textFormat } from "./textFormat"; import { updateLanguageMdx } from "./updateLanguageMdx"; import { updatePackageJson } from "./updatePackageJson"; import { updatePrivateScopeMdx } from "./updatePrivateScopeMdx"; import { updateReferenceMdx } from "./updateReferenceMdx"; +import { updateReferenceReadmeMd } from "./updateReferenceReadmeMd"; import { updatesScopeSupportFacetInfos } from "./updatesScopeSupportFacetInfos"; import { updateTSConfig } from "./updateTSConfig"; import { updateTSConfigBase } from "./updateTSConfigBase"; @@ -51,6 +54,12 @@ export const updater = async (workspaceDir: string) => { updateLanguageMdx.bind(null, languageId), ]), ), + [`${userDir}/actions/README.md`]: updateReferenceReadmeMd.bind( + null, + "Actions", + actionReferences, + actionReferenceGroups, + ), ...Object.fromEntries( Object.entries(actionReferences).map(([id, entry]) => [ `${userDir}/actions/${cleanId(id)}.mdx`, @@ -82,7 +91,3 @@ export const updater = async (workspaceDir: string) => { }, }); }; - -function cleanId(id: string): string { - return id.replace("private.", "").replace("experimental.", ""); -} diff --git a/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts b/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts new file mode 100644 index 0000000000..3d63f9c9e1 --- /dev/null +++ b/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts @@ -0,0 +1,37 @@ +import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; +import type { + GroupedReferenceEntry, + ReferenceGroup, +} from "@cursorless/lib-common"; +import { cleanId } from "./cleanId"; + +export function updateReferenceReadmeMd( + title: string, + entries: Record>, + groups: ReferenceGroup[], + actual: string | null, + options: FormatPluginFnOptions, +): string | null { + if (options.manifest.name !== "@cursorless/app-web-docs") { + return null; + } + + const expected: string[] = [`# ${title}`, ""]; + + for (const group of groups) { + if (group.id === "private") { + continue; + } + expected.push(`## ${group.name}`, ""); + const groupEntries = Object.entries(entries).filter( + ([, entry]) => entry.group.id === group.id, + ); + for (const [rawId, entry] of groupEntries) { + const id = cleanId(rawId); + expected.push(`- [${id}](./${id}.mdx) - ${entry.description}`); + } + expected.push(""); + } + + return expected.join("\n"); +} From 0d264c0304747418b1a46803b1b6d8e750715a93 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sun, 30 Aug 2026 00:08:18 +0200 Subject: [PATCH 2/6] Added generator file --- .../src/references/actionReferences.ts | 892 +++++++++--------- .../src/updateReferenceMdx.ts | 35 +- .../src/updateReferenceReadmeMd.ts | 21 +- .../src/util/formatVariables.ts | 11 + .../src/util/injectSpokenForm.ts | 16 + 5 files changed, 493 insertions(+), 482 deletions(-) create mode 100644 packages/tool-meta-updater/src/util/formatVariables.ts create mode 100644 packages/tool-meta-updater/src/util/injectSpokenForm.ts diff --git a/packages/lib-common/src/references/actionReferences.ts b/packages/lib-common/src/references/actionReferences.ts index 27594902f6..1f1e361b80 100644 --- a/packages/lib-common/src/references/actionReferences.ts +++ b/packages/lib-common/src/references/actionReferences.ts @@ -215,6 +215,29 @@ export const actionReferences = { }, ], }, + remove: { + name: "Remove", + defaultSpokenForm: REMOVE, + group: { + id: "change", + index: 0, + }, + description: + "This action can be used to remove a target without moving the cursor.", + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Remove ${VAR_TARGET}.`, + cheatsheet: "Remove", + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Removes the ${TARGET_DESC}.`, + }, + ], + }, clearAndSetSelection: { name: "Change", defaultSpokenForm: "change", @@ -237,6 +260,27 @@ export const actionReferences = { }, ], }, + cutToClipboard: { + name: "Cut to clipboard", + defaultSpokenForm: "carve", + group: { + id: "clipboard", + index: 0, + }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Cut ${VAR_TARGET} to clipboard.`, + cheatsheet: "Cut to clipboard", + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Cuts the ${TARGET_DESC} to the clipboard.`, + }, + ], + }, copyToClipboard: { name: "Copy to clipboard", defaultSpokenForm: "copy", @@ -258,24 +302,45 @@ export const actionReferences = { }, ], }, - cutToClipboard: { - name: "Cut to clipboard", - defaultSpokenForm: "carve", + pasteFromClipboard: { + name: "Paste from clipboard", + defaultSpokenForm: "paste", group: { id: "clipboard", + index: 2, + }, + syntaxes: [ + { + pattern: `${VAR_SPOKEN_FORM} ${VAR_DESTINATION}`, + description: `Paste from clipboard at ${VAR_DESTINATION}.`, + cheatsheet: `Paste from clipboard at ${VAR_DESTINATION}`, + }, + ], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${AFTER} ${TARGET}`, + description: `Pastes the clipboard contents after the ${TARGET_DESC}.`, + }, + ], + }, + increment: { + name: "Increment", + defaultSpokenForm: "increment", + group: { + id: "numbers", index: 0, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Cut ${VAR_TARGET} to clipboard.`, - cheatsheet: "Cut to clipboard", + description: `Increment number at ${VAR_TARGET}.`, + cheatsheet: "Increment number", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Cuts the ${TARGET_DESC} to the clipboard.`, + command: `${VAR_SPOKEN_FORM} ${TARGET_NUMBER}`, + description: `Increments the ${TARGET_NUMBER_DESC}.`, }, ], }, @@ -300,6 +365,37 @@ export const actionReferences = { }, ], }, + editNewLineBefore: { + name: "Edit new line/scope before", + defaultSpokenForm: "drink", + group: { + id: "emptyLines", + index: 0, + }, + description: "Scope defaults to line.", + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Edit new line before ${VAR_TARGET}.`, + cheatsheet: "Edit new line before", + }, + { + pattern: `${VAR_SPOKEN_FORM} ${VAR_SCOPE} ${VAR_TARGET}`, + description: `Edit new ${VAR_SCOPE} before ${VAR_TARGET}.`, + cheatsheet: `Edit new ${VAR_SCOPE} before`, + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Inserts a new line above the ${TARGET_DESC} and moves the cursor to it.`, + }, + { + command: `${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, + description: `Inserts the delimiters for a new collection item before the item containing the ${TARGET_DESC} and moves the cursor there.`, + }, + ], + }, editNewLineAfter: { name: "Edit new line/scope after", defaultSpokenForm: "pour", @@ -331,34 +427,78 @@ export const actionReferences = { }, ], }, - editNewLineBefore: { - name: "Edit new line/scope before", - defaultSpokenForm: "drink", + insertEmptyLineBefore: { + name: "Insert empty line/scope before", + defaultSpokenForm: "drop", group: { id: "emptyLines", - index: 0, + index: 2, }, - description: "Scope defaults to line.", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Edit new line before ${VAR_TARGET}.`, - cheatsheet: "Edit new line before", + description: `Insert empty line/scope before ${VAR_TARGET}.`, + cheatsheet: "Insert empty line/scope before", }, + ], + examples: [ { - pattern: `${VAR_SPOKEN_FORM} ${VAR_SCOPE} ${VAR_TARGET}`, - description: `Edit new ${VAR_SCOPE} before ${VAR_TARGET}.`, - cheatsheet: `Edit new ${VAR_SCOPE} before`, + command: DEFAULT_COMMAND, + description: `Inserts an empty line above the ${TARGET_DESC} without moving the cursor.`, + }, + { + command: `${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, + description: `Inserts the required delimiter before the collection item containing the ${TARGET_DESC}.`, + }, + ], + }, + insertEmptyLineAfter: { + name: "Insert empty line/scope after", + defaultSpokenForm: "float", + group: { + id: "emptyLines", + index: 3, + }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Insert empty line/scope after ${VAR_TARGET}.`, + cheatsheet: "Insert empty line/scope after", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Inserts a new line above the ${TARGET_DESC} and moves the cursor to it.`, + description: `Inserts an empty line below the ${TARGET_DESC} without moving the cursor.`, }, { command: `${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, - description: `Inserts the delimiters for a new collection item before the item containing the ${TARGET_DESC} and moves the cursor there.`, + description: `Inserts the required delimiter after the collection item containing the ${TARGET_DESC}.`, + }, + ], + }, + insertEmptyLinesAround: { + name: "Insert empty lines/scopes around", + defaultSpokenForm: "puff", + group: { + id: "emptyLines", + index: 4, + }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Insert empty lines/scopes around ${VAR_TARGET}.`, + cheatsheet: "Insert empty lines/scopes around", + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Inserts empty lines around the line containing the ${TARGET_DESC} without moving the cursor.`, + }, + { + command: `${VAR_SPOKEN_FORM} ${TOKEN} ${TARGET}`, + description: `Inserts spaces around the ${TARGET_DESC}.`, }, ], }, @@ -406,584 +546,570 @@ export const actionReferences = { }, ], }, - findInDocument: { - name: "Find in document", - defaultSpokenForm: "scout", + revealDefinition: { + name: "Reveal definition", + defaultSpokenForm: "define", group: { id: "navigation", - index: 5, + index: 0, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Find ${VAR_TARGET} in document.`, - cheatsheet: "Find in document", + description: `Reveal definition of ${VAR_TARGET}.`, + cheatsheet: "Reveal definition", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Searches the current document for the ${TARGET_DESC}.`, + description: `Opens the definition of the ${TARGET_DESC}.`, }, ], }, - findInWorkspace: { - name: "Find in workspace", - defaultSpokenForm: "scout all", + revealTypeDefinition: { + name: "Reveal type definition", + defaultSpokenForm: "type deaf", group: { id: "navigation", - index: 6, + index: 1, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Find ${VAR_TARGET} in workspace.`, - cheatsheet: "Find in workspace", + description: `Reveal type definition of ${VAR_TARGET}.`, + cheatsheet: "Reveal type definition", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Searches the workspace for the ${TARGET_DESC}.`, + description: `Opens the type definition of the ${TARGET_DESC}.`, }, ], }, - flashTargets: { - name: "Flash target", - defaultSpokenForm: "flash", + showReferences: { + name: "Show references", + defaultSpokenForm: "reference", group: { - id: "visual", - index: 0, + id: "navigation", + index: 2, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Flash ${VAR_TARGET}.`, - cheatsheet: "Flash target", + description: `Show references for ${VAR_TARGET}.`, + cheatsheet: "Show references", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Briefly flashes the ${TARGET_DESC}.`, + description: `Shows references to the ${TARGET_DESC}.`, }, ], }, - foldRegion: { - name: "Fold region", - defaultSpokenForm: "fold", + showHover: { + name: "Show hover", + defaultSpokenForm: "hover", group: { - id: "folding", - index: 0, + id: "navigation", + index: 3, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Fold region at ${VAR_TARGET}.`, - cheatsheet: "Fold region", + description: `Show hover for ${VAR_TARGET}.`, + cheatsheet: "Show hover", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, - description: `Folds the function containing the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Shows hover information for the ${TARGET_DESC}.`, }, ], }, - followLink: { - name: "Follow link", - defaultSpokenForm: "follow", + showQuickFix: { + name: "Show quick fix", + defaultSpokenForm: "quick fix", group: { id: "navigation", - index: 7, + index: 4, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Follow link at ${VAR_TARGET}.`, - cheatsheet: "Follow link", + description: `Show quick fix for ${VAR_TARGET}.`, + cheatsheet: "Show quick fix", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Opens the link containing the ${TARGET_DESC}.`, + description: `Shows quick fixes for the ${TARGET_DESC}.`, }, ], }, - followLinkAside: { - name: "Follow link aside", - defaultSpokenForm: "follow split", + findInDocument: { + name: "Find in document", + defaultSpokenForm: "scout", group: { id: "navigation", - index: 8, + index: 5, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Follow link at ${VAR_TARGET} aside (e.g. in a split view).`, - cheatsheet: "Follow link aside", + description: `Find ${VAR_TARGET} in document.`, + cheatsheet: "Find in document", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Opens the link containing the ${TARGET_DESC} in a split view.`, + description: `Searches the current document for the ${TARGET_DESC}.`, }, ], }, - gitAccept: { - name: "Git accept", - defaultSpokenForm: "git accept", + findInWorkspace: { + name: "Find in workspace", + defaultSpokenForm: "scout all", group: { - id: "git", - index: 0, + id: "navigation", + index: 6, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Accept Git change at ${VAR_TARGET}.`, - cheatsheet: "Git accept", + description: `Find ${VAR_TARGET} in workspace.`, + cheatsheet: "Find in workspace", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Accepts the Git change on the line containing the ${TARGET_DESC}.`, + description: `Searches the workspace for the ${TARGET_DESC}.`, }, ], }, - gitRevert: { - name: "Git revert", - defaultSpokenForm: "git revert", + followLink: { + name: "Follow link", + defaultSpokenForm: "follow", group: { - id: "git", - index: 1, + id: "navigation", + index: 7, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Revert Git change at ${VAR_TARGET}.`, - cheatsheet: "Git revert", + description: `Follow link at ${VAR_TARGET}.`, + cheatsheet: "Follow link", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Reverts the Git change on the line containing the ${TARGET_DESC}.`, + description: `Opens the link containing the ${TARGET_DESC}.`, }, ], }, - gitStage: { - name: "Git stage", - defaultSpokenForm: "git stage", + followLinkAside: { + name: "Follow link aside", + defaultSpokenForm: "follow split", group: { - id: "git", - index: 2, + id: "navigation", + index: 8, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Stage Git change at ${VAR_TARGET}.`, - cheatsheet: "Git stage", + description: `Follow link at ${VAR_TARGET} aside (e.g. in a split view).`, + cheatsheet: "Follow link aside", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Stages the Git change on the line containing the ${TARGET_DESC}.`, + description: `Opens the link containing the ${TARGET_DESC} in a split view.`, }, ], }, - gitUnstage: { - name: "Git unstage", - defaultSpokenForm: "git unstage", + showDebugHover: { + name: "Show debug hover", + defaultSpokenForm: "inspect", group: { - id: "git", - index: 3, + id: "navigation", + index: 9, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Unstage Git change at ${VAR_TARGET}.`, - cheatsheet: "Git unstage", + description: `Show debug hover for ${VAR_TARGET}.`, + cheatsheet: "Show debug hover", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Unstages the Git change on the line containing the ${TARGET_DESC}.`, + description: `Shows debug information for the ${TARGET_DESC}.`, }, ], }, - increment: { - name: "Increment", - defaultSpokenForm: "increment", + flashTargets: { + name: "Flash target", + defaultSpokenForm: "flash", group: { - id: "numbers", + id: "visual", index: 0, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Increment number at ${VAR_TARGET}.`, - cheatsheet: "Increment number", + description: `Flash ${VAR_TARGET}.`, + cheatsheet: "Flash target", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${TARGET_NUMBER}`, - description: `Increments the ${TARGET_NUMBER_DESC}.`, + command: DEFAULT_COMMAND, + description: `Briefly flashes the ${TARGET_DESC}.`, }, ], }, - indentLine: { - name: "Indent line", - defaultSpokenForm: "indent", + highlight: { + name: "Highlight", + defaultSpokenForm: "highlight", group: { - id: "indentation", - index: 0, + id: "visual", + index: 1, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Indent line containing ${VAR_TARGET}.`, - cheatsheet: "Indent line", + description: `Highlight ${VAR_TARGET}.`, + cheatsheet: "Highlight", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Indents the line containing the ${TARGET_DESC}.`, + description: `Highlights the ${TARGET_DESC}.`, }, ], }, - insertCopyAfter: { - name: "Insert copy after", - defaultSpokenForm: "clone", + foldRegion: { + name: "Fold region", + defaultSpokenForm: "fold", group: { - id: "clone", + id: "folding", index: 0, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Insert copy after ${VAR_TARGET}.`, - cheatsheet: "Insert copy after", + description: `Fold region at ${VAR_TARGET}.`, + cheatsheet: "Fold region", }, ], examples: [ { command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, - description: `Inserts a copy of the function containing the ${TARGET_DESC} after itself.`, + description: `Folds the function containing the ${TARGET_DESC}.`, }, ], }, - insertCopyBefore: { - name: "Insert copy before", - defaultSpokenForm: "clone up", + unfoldRegion: { + name: "Unfold region", + defaultSpokenForm: "unfold", group: { - id: "clone", + id: "folding", index: 1, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Insert copy before ${VAR_TARGET}.`, - cheatsheet: "Insert copy before", + description: `Unfold region at ${VAR_TARGET}.`, + cheatsheet: "Unfold region", }, ], examples: [ { command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, - description: `Inserts a copy of the function containing the ${TARGET_DESC} before itself.`, + description: `Unfolds the function containing the ${TARGET_DESC}.`, }, ], }, - insertEmptyLineAfter: { - name: "Insert empty line/scope after", - defaultSpokenForm: "float", + gitAccept: { + name: "Git accept", + defaultSpokenForm: "git accept", group: { - id: "emptyLines", - index: 3, + id: "git", + index: 0, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Insert empty line/scope after ${VAR_TARGET}.`, - cheatsheet: "Insert empty line/scope after", + description: `Accept Git change at ${VAR_TARGET}.`, + cheatsheet: "Git accept", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Inserts an empty line below the ${TARGET_DESC} without moving the cursor.`, - }, - { - command: `${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, - description: `Inserts the required delimiter after the collection item containing the ${TARGET_DESC}.`, + description: `Accepts the Git change on the line containing the ${TARGET_DESC}.`, }, ], }, - insertEmptyLineBefore: { - name: "Insert empty line/scope before", - defaultSpokenForm: "drop", + gitRevert: { + name: "Git revert", + defaultSpokenForm: "git revert", group: { - id: "emptyLines", - index: 2, + id: "git", + index: 1, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Insert empty line/scope before ${VAR_TARGET}.`, - cheatsheet: "Insert empty line/scope before", + description: `Revert Git change at ${VAR_TARGET}.`, + cheatsheet: "Git revert", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Inserts an empty line above the ${TARGET_DESC} without moving the cursor.`, - }, - { - command: `${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, - description: `Inserts the required delimiter before the collection item containing the ${TARGET_DESC}.`, + description: `Reverts the Git change on the line containing the ${TARGET_DESC}.`, }, ], }, - insertEmptyLinesAround: { - name: "Insert empty lines/scopes around", - defaultSpokenForm: "puff", + gitStage: { + name: "Git stage", + defaultSpokenForm: "git stage", group: { - id: "emptyLines", - index: 4, + id: "git", + index: 2, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Insert empty lines/scopes around ${VAR_TARGET}.`, - cheatsheet: "Insert empty lines/scopes around", + description: `Stage Git change at ${VAR_TARGET}.`, + cheatsheet: "Git stage", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Inserts empty lines around the line containing the ${TARGET_DESC} without moving the cursor.`, - }, - { - command: `${VAR_SPOKEN_FORM} ${TOKEN} ${TARGET}`, - description: `Inserts spaces around the ${TARGET_DESC}.`, + description: `Stages the Git change on the line containing the ${TARGET_DESC}.`, }, ], }, - joinLines: { - name: "Join lines", - defaultSpokenForm: "join", + gitUnstage: { + name: "Git unstage", + defaultSpokenForm: "git unstage", group: { - id: "join", - index: 0, + id: "git", + index: 3, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Join lines at ${VAR_TARGET}.`, - cheatsheet: "Join lines", + description: `Unstage Git change at ${VAR_TARGET}.`, + cheatsheet: "Git unstage", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Joins the line containing the ${TARGET_DESC} with the following line.`, + description: `Unstages the Git change on the line containing the ${TARGET_DESC}.`, }, ], }, - outdentLine: { - name: "Outdent line", - defaultSpokenForm: "dedent", + indentLine: { + name: "Indent line", + defaultSpokenForm: "indent", group: { id: "indentation", - index: 1, + index: 0, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Outdent line containing ${VAR_TARGET}.`, - cheatsheet: "Outdent line", + description: `Indent line containing ${VAR_TARGET}.`, + cheatsheet: "Indent line", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Decreases the indentation of the line containing the ${TARGET_DESC}.`, + description: `Indents the line containing the ${TARGET_DESC}.`, }, ], }, - randomizeTargets: { - name: "Randomize targets", - defaultSpokenForm: "shuffle", + outdentLine: { + name: "Outdent line", + defaultSpokenForm: "dedent", group: { - id: "reorder", + id: "indentation", index: 1, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Randomize ${VAR_TARGET}s.`, - cheatsheet: "Randomize targets", + description: `Outdent line containing ${VAR_TARGET}.`, + cheatsheet: "Outdent line", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, - description: `Randomizes the collection items associated with the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Decreases the indentation of the line containing the ${TARGET_DESC}.`, }, ], }, - remove: { - name: "Remove", - defaultSpokenForm: REMOVE, + insertCopyAfter: { + name: "Insert copy after", + defaultSpokenForm: "clone", group: { - id: "change", + id: "clone", index: 0, }, - description: - "This action can be used to remove a target without moving the cursor.", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Remove ${VAR_TARGET}.`, - cheatsheet: "Remove", + description: `Insert copy after ${VAR_TARGET}.`, + cheatsheet: "Insert copy after", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Removes the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Inserts a copy of the function containing the ${TARGET_DESC} after itself.`, }, ], }, - rename: { - name: "Rename", - defaultSpokenForm: "rename", + insertCopyBefore: { + name: "Insert copy before", + defaultSpokenForm: "clone up", group: { - id: "rename", - index: 0, + id: "clone", + index: 1, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Rename ${VAR_TARGET}.`, - cheatsheet: "Rename", + description: `Insert copy before ${VAR_TARGET}.`, + cheatsheet: "Insert copy before", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Starts renaming the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Inserts a copy of the function containing the ${TARGET_DESC} before itself.`, }, ], }, - revealDefinition: { - name: "Reveal definition", - defaultSpokenForm: "define", + joinLines: { + name: "Join lines", + defaultSpokenForm: "join", group: { - id: "navigation", + id: "join", index: 0, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Reveal definition of ${VAR_TARGET}.`, - cheatsheet: "Reveal definition", + description: `Join lines at ${VAR_TARGET}.`, + cheatsheet: "Join lines", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Opens the definition of the ${TARGET_DESC}.`, + description: `Joins the line containing the ${TARGET_DESC} with the following line.`, }, ], }, - revealTypeDefinition: { - name: "Reveal type definition", - defaultSpokenForm: "type deaf", + reverseTargets: { + name: "Reverse targets", + defaultSpokenForm: "reverse", group: { - id: "navigation", - index: 1, + id: "reorder", + index: 0, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Reveal type definition of ${VAR_TARGET}.`, - cheatsheet: "Reveal type definition", + description: `Reverse ${VAR_TARGET}s.`, + cheatsheet: "Reverse targets", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Opens the type definition of the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, + description: `Reverses the collection items associated with the ${TARGET_DESC}.`, }, ], }, - reverseTargets: { - name: "Reverse targets", - defaultSpokenForm: "reverse", + randomizeTargets: { + name: "Randomize targets", + defaultSpokenForm: "shuffle", group: { id: "reorder", - index: 0, + index: 1, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Reverse ${VAR_TARGET}s.`, - cheatsheet: "Reverse targets", + description: `Randomize ${VAR_TARGET}s.`, + cheatsheet: "Randomize targets", }, ], examples: [ { command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, - description: `Reverses the collection items associated with the ${TARGET_DESC}.`, + description: `Randomizes the collection items associated with the ${TARGET_DESC}.`, }, ], }, - scrollToBottom: { - name: "Scroll to bottom", - defaultSpokenForm: "bottom", + sortTargets: { + name: "Sort targets", + defaultSpokenForm: "sort", group: { - id: "scroll", + id: "reorder", index: 2, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Scroll ${VAR_TARGET} to bottom of the viewport.`, - cheatsheet: "Scroll to bottom", + description: `Sort ${VAR_TARGET}s.`, + cheatsheet: "Sort targets", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Scrolls the ${TARGET_DESC} to the bottom of the viewport.`, + command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, + description: `Sorts the collection items associated with the ${TARGET_DESC}.`, }, ], }, - scrollToCenter: { - name: "Scroll to center", - defaultSpokenForm: "center", + rename: { + name: "Rename", + defaultSpokenForm: "rename", group: { - id: "scroll", - index: 1, + id: "rename", + index: 0, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Scroll ${VAR_TARGET} to center of the viewport.`, - cheatsheet: "Scroll to center", + description: `Rename ${VAR_TARGET}.`, + cheatsheet: "Rename", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Scrolls the ${TARGET_DESC} to the center of the viewport.`, + description: `Starts renaming the ${TARGET_DESC}.`, }, ], }, @@ -1008,108 +1134,87 @@ export const actionReferences = { }, ], }, - showDebugHover: { - name: "Show debug hover", - defaultSpokenForm: "inspect", - group: { - id: "navigation", - index: 9, - }, - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: `Show debug hover for ${VAR_TARGET}.`, - cheatsheet: "Show debug hover", - }, - ], - examples: [ - { - command: DEFAULT_COMMAND, - description: `Shows debug information for the ${TARGET_DESC}.`, - }, - ], - }, - showHover: { - name: "Show hover", - defaultSpokenForm: "hover", + scrollToCenter: { + name: "Scroll to center", + defaultSpokenForm: "center", group: { - id: "navigation", - index: 3, + id: "scroll", + index: 1, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Show hover for ${VAR_TARGET}.`, - cheatsheet: "Show hover", + description: `Scroll ${VAR_TARGET} to center of the viewport.`, + cheatsheet: "Scroll to center", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Shows hover information for the ${TARGET_DESC}.`, + description: `Scrolls the ${TARGET_DESC} to the center of the viewport.`, }, ], }, - showQuickFix: { - name: "Show quick fix", - defaultSpokenForm: "quick fix", + scrollToBottom: { + name: "Scroll to bottom", + defaultSpokenForm: "bottom", group: { - id: "navigation", - index: 4, + id: "scroll", + index: 2, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Show quick fix for ${VAR_TARGET}.`, - cheatsheet: "Show quick fix", + description: `Scroll ${VAR_TARGET} to bottom of the viewport.`, + cheatsheet: "Scroll to bottom", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Shows quick fixes for the ${TARGET_DESC}.`, + description: `Scrolls the ${TARGET_DESC} to the bottom of the viewport.`, }, ], }, - showReferences: { - name: "Show references", - defaultSpokenForm: "reference", + applyFormatter: { + name: "Apply formatter", + defaultSpokenForm: "format", group: { - id: "navigation", - index: 2, + id: "editor", + index: 0, }, syntaxes: [ { - pattern: DEFAULT_PATTERN, - description: `Show references for ${VAR_TARGET}.`, - cheatsheet: "Show references", + pattern: `${VAR_SPOKEN_FORM} ${VAR_FORMATTER} ${AT} ${VAR_TARGET}`, + description: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}.`, + cheatsheet: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}`, }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Shows references to the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${FORMATTER_CAMEL} ${AT} ${TARGET}`, + description: `Reformats the ${TARGET_DESC} as camel case.`, }, ], }, - sortTargets: { - name: "Sort targets", - defaultSpokenForm: "sort", + toggleLineComment: { + name: "Toggle line comment", + defaultSpokenForm: "comment", group: { - id: "reorder", - index: 2, + id: "editor", + index: 1, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Sort ${VAR_TARGET}s.`, - cheatsheet: "Sort targets", + description: `Toggle line comment at ${VAR_TARGET}.`, + cheatsheet: "Toggle line comment", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, - description: `Sorts the collection items associated with the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Toggles the comment on the line containing the ${TARGET_DESC}.`, }, ], }, @@ -1144,45 +1249,33 @@ export const actionReferences = { }, ], }, - toggleLineComment: { - name: "Toggle line comment", - defaultSpokenForm: "comment", + replaceWithTarget: { + name: "Replace with target", + defaultSpokenForm: "bring", group: { - id: "editor", - index: 1, + id: "insert", + index: 0, }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Toggle line comment at ${VAR_TARGET}.`, - cheatsheet: "Toggle line comment", + description: `Insert copy of ${VAR_TARGET} at selection.`, + cheatsheet: `Insert copy of ${VAR_TARGET} at selection`, }, - ], - examples: [ { - command: DEFAULT_COMMAND, - description: `Toggles the comment on the line containing the ${TARGET_DESC}.`, + pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET} ${VAR_DESTINATION}`, + description: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}.`, + cheatsheet: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}`, }, ], - }, - unfoldRegion: { - name: "Unfold region", - defaultSpokenForm: "unfold", - group: { - id: "folding", - index: 1, - }, - syntaxes: [ + examples: [ { - pattern: DEFAULT_PATTERN, - description: `Unfold region at ${VAR_TARGET}.`, - cheatsheet: "Unfold region", + command: DEFAULT_COMMAND, + description: `Inserts a copy of the ${TARGET_DESC} at the current selection.`, }, - ], - examples: [ { - command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, - description: `Unfolds the function containing the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${TARGET} ${TO} ${TARGET_2}`, + description: `Replaces the ${TARGET_2_DESC} with a copy of the ${TARGET_DESC}.`, }, ], }, @@ -1238,45 +1331,45 @@ export const actionReferences = { }, ], }, - highlight: { - name: "Highlight", - defaultSpokenForm: "highlight", + insertSnippet: { + name: "Insert snippet", + defaultSpokenForm: "snip", group: { - id: "visual", + id: "snippets", index: 1, }, syntaxes: [ { - pattern: DEFAULT_PATTERN, - description: `Highlight ${VAR_TARGET}.`, - cheatsheet: "Highlight", + pattern: `${VAR_SPOKEN_FORM} ${VAR_SNIPPET} ${VAR_DESTINATION}`, + description: `Insert snippet at ${VAR_DESTINATION}.`, + cheatsheet: `Insert snippet at ${VAR_DESTINATION}`, }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Highlights the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${SNIPPET_IF} ${AFTER} ${TARGET}`, + description: `Inserts an if-statement snippet after the ${TARGET_DESC}.`, }, ], }, - insertSnippet: { - name: "Insert snippet", - defaultSpokenForm: "snip", + wrapWithSnippet: { + name: "Wrap with snippet", + defaultSpokenForm: "wrap", group: { id: "snippets", - index: 1, + index: 2, }, syntaxes: [ { - pattern: `${VAR_SPOKEN_FORM} ${VAR_SNIPPET} ${VAR_DESTINATION}`, - description: `Insert snippet at ${VAR_DESTINATION}.`, - cheatsheet: `Insert snippet at ${VAR_DESTINATION}`, + pattern: `${VAR_SNIPPET} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, + description: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}.`, + cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}`, }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${SNIPPET_IF} ${AFTER} ${TARGET}`, - description: `Inserts an if-statement snippet after the ${TARGET_DESC}.`, + command: `${SNIPPET_IF} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Wraps the ${TARGET_DESC} in an if-statement snippet.`, }, ], }, @@ -1310,54 +1403,24 @@ export const actionReferences = { }, ], }, - pasteFromClipboard: { - name: "Paste from clipboard", - defaultSpokenForm: "paste", - group: { - id: "clipboard", - index: 2, - }, - syntaxes: [ - { - pattern: `${VAR_SPOKEN_FORM} ${VAR_DESTINATION}`, - description: `Paste from clipboard at ${VAR_DESTINATION}.`, - cheatsheet: `Paste from clipboard at ${VAR_DESTINATION}`, - }, - ], - examples: [ - { - command: `${VAR_SPOKEN_FORM} ${AFTER} ${TARGET}`, - description: `Pastes the clipboard contents after the ${TARGET_DESC}.`, - }, - ], - }, - replaceWithTarget: { - name: "Replace with target", - defaultSpokenForm: "bring", + wrapWithPairedDelimiter: { + name: "Wrap with paired delimiter", + defaultSpokenForm: "wrap", group: { - id: "insert", + id: "wrap", index: 0, }, syntaxes: [ { - pattern: DEFAULT_PATTERN, - description: `Insert copy of ${VAR_TARGET} at selection.`, - cheatsheet: `Insert copy of ${VAR_TARGET} at selection`, - }, - { - pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET} ${VAR_DESTINATION}`, - description: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}.`, - cheatsheet: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}`, + pattern: `${VAR_PAIR} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, + description: `Wrap ${VAR_TARGET} with ${VAR_PAIR}.`, + cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_PAIR}`, }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Inserts a copy of the ${TARGET_DESC} at the current selection.`, - }, - { - command: `${VAR_SPOKEN_FORM} ${TARGET} ${TO} ${TARGET_2}`, - description: `Replaces the ${TARGET_2_DESC} with a copy of the ${TARGET_DESC}.`, + command: `${SQUARE} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Wraps the ${TARGET_DESC} in square brackets.`, }, ], }, @@ -1412,69 +1475,6 @@ export const actionReferences = { }, ], }, - wrapWithPairedDelimiter: { - name: "Wrap with paired delimiter", - defaultSpokenForm: "wrap", - group: { - id: "wrap", - index: 0, - }, - syntaxes: [ - { - pattern: `${VAR_PAIR} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, - description: `Wrap ${VAR_TARGET} with ${VAR_PAIR}.`, - cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_PAIR}`, - }, - ], - examples: [ - { - command: `${SQUARE} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Wraps the ${TARGET_DESC} in square brackets.`, - }, - ], - }, - wrapWithSnippet: { - name: "Wrap with snippet", - defaultSpokenForm: "wrap", - group: { - id: "snippets", - index: 2, - }, - syntaxes: [ - { - pattern: `${VAR_SNIPPET} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, - description: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}.`, - cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}`, - }, - ], - examples: [ - { - command: `${SNIPPET_IF} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Wraps the ${TARGET_DESC} in an if-statement snippet.`, - }, - ], - }, - applyFormatter: { - name: "Apply formatter", - defaultSpokenForm: "format", - group: { - id: "editor", - index: 0, - }, - syntaxes: [ - { - pattern: `${VAR_SPOKEN_FORM} ${VAR_FORMATTER} ${AT} ${VAR_TARGET}`, - description: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}.`, - cheatsheet: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}`, - }, - ], - examples: [ - { - command: `${VAR_SPOKEN_FORM} ${FORMATTER_CAMEL} ${AT} ${TARGET}`, - description: `Reformats the ${TARGET_DESC} as camel case.`, - }, - ], - }, nextHomophone: { name: "Next homophone", defaultSpokenForm: "phones", diff --git a/packages/tool-meta-updater/src/updateReferenceMdx.ts b/packages/tool-meta-updater/src/updateReferenceMdx.ts index e25f40d4d4..4ff3a02a92 100644 --- a/packages/tool-meta-updater/src/updateReferenceMdx.ts +++ b/packages/tool-meta-updater/src/updateReferenceMdx.ts @@ -1,7 +1,7 @@ import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; import type { ReferenceEntry } from "@cursorless/lib-common"; - -const VAR_SPOKEN_FORM = ""; +import { formatVariables } from "./util/formatVariables"; +import { injectSpokenForm } from "./util/injectSpokenForm"; export function updateReferenceMdx( kind: "action" | "modifier" | "scope", @@ -69,9 +69,7 @@ export function updateReferenceMdx( const pattern = formatVariables( injectSpokenForm(syntax.pattern, entry.defaultSpokenForm), ); - const description = formatVariables( - injectSpokenForm(syntax.description, entry.defaultSpokenForm), - ); + const description = formatVariables(syntax.description); expected.push(`- ${pattern}: ${description}`); } expected.push(""); @@ -104,33 +102,6 @@ function bold(value: string) { return `**${value}**`; } -function injectSpokenForm( - pattern: string, - defaultSpokenForm: string | undefined, -): string { - if (defaultSpokenForm == null) { - if (pattern.includes(VAR_SPOKEN_FORM)) { - throw new Error( - `Pattern "${pattern}" contains ${VAR_SPOKEN_FORM}, but no defaultSpokenForm is provided`, - ); - } - return pattern; - } - return pattern.replace(VAR_SPOKEN_FORM, defaultSpokenForm); -} - -function formatVariables(pattern: string): string { - return pattern - .split(/(<[\w ]+>)/gu) - .map((part) => { - if (part.startsWith("<") && part.endsWith(">")) { - return code(part); - } - return part; - }) - .join(""); -} - function formatGroup(lines: string[]): string[] { return lines.map((line, index) => index < lines.length - 1 ? `${line}\\` : line, diff --git a/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts b/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts index 3d63f9c9e1..3bec66110e 100644 --- a/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts +++ b/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts @@ -4,6 +4,8 @@ import type { ReferenceGroup, } from "@cursorless/lib-common"; import { cleanId } from "./cleanId"; +import { formatVariables } from "./util/formatVariables"; +import { injectSpokenForm } from "./util/injectSpokenForm"; export function updateReferenceReadmeMd( title: string, @@ -22,14 +24,25 @@ export function updateReferenceReadmeMd( if (group.id === "private") { continue; } + expected.push(`## ${group.name}`, ""); - const groupEntries = Object.entries(entries).filter( - ([, entry]) => entry.group.id === group.id, - ); + + const groupEntries = Object.entries(entries) + .filter(([, entry]) => entry.group.id === group.id) + .toSorted(([, a], [, b]) => a.group.index - b.group.index); + for (const [rawId, entry] of groupEntries) { const id = cleanId(rawId); - expected.push(`- [${id}](./${id}.mdx) - ${entry.description}`); + for (const syntax of entry.syntaxes) { + const pattern = injectSpokenForm( + syntax.pattern, + entry.defaultSpokenForm, + ); + const description = formatVariables(syntax.description); + expected.push(`- [\`"${pattern}"\`](./${id}.mdx) - ${description}`); + } } + expected.push(""); } diff --git a/packages/tool-meta-updater/src/util/formatVariables.ts b/packages/tool-meta-updater/src/util/formatVariables.ts new file mode 100644 index 0000000000..1d8df51837 --- /dev/null +++ b/packages/tool-meta-updater/src/util/formatVariables.ts @@ -0,0 +1,11 @@ +export function formatVariables(pattern: string): string { + return pattern + .split(/(<[\w ]+>)/gu) + .map((part) => { + if (part.startsWith("<") && part.endsWith(">")) { + return `\`${part}\``; + } + return part; + }) + .join(""); +} diff --git a/packages/tool-meta-updater/src/util/injectSpokenForm.ts b/packages/tool-meta-updater/src/util/injectSpokenForm.ts new file mode 100644 index 0000000000..f3ff8ddd0e --- /dev/null +++ b/packages/tool-meta-updater/src/util/injectSpokenForm.ts @@ -0,0 +1,16 @@ +const VAR_SPOKEN_FORM = ""; + +export function injectSpokenForm( + pattern: string, + defaultSpokenForm: string | undefined, +): string { + if (defaultSpokenForm == null) { + if (pattern.includes(VAR_SPOKEN_FORM)) { + throw new Error( + `Pattern "${pattern}" contains ${VAR_SPOKEN_FORM}, but no defaultSpokenForm is provided`, + ); + } + return pattern; + } + return pattern.replace(VAR_SPOKEN_FORM, defaultSpokenForm); +} From d445225eabfda4831277d2db9d110fa0ffb56746 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sun, 30 Aug 2026 00:18:41 +0200 Subject: [PATCH 3/6] Move files to util folder --- packages/tool-meta-updater/src/metaUpdater.ts | 6 +++--- packages/tool-meta-updater/src/updatePackageJson.ts | 2 +- packages/tool-meta-updater/src/updateReferenceReadmeMd.ts | 2 +- ...SupportFacetInfos.ts => updateScopeSupportFacetInfos.ts} | 2 +- packages/tool-meta-updater/src/updateTSConfig.ts | 2 +- packages/tool-meta-updater/src/{ => util}/cleanId.ts | 0 .../src/{ => util}/getCursorlessVscodeFields.ts | 0 packages/tool-meta-updater/src/{ => util}/toPosixPath.ts | 0 8 files changed, 7 insertions(+), 7 deletions(-) rename packages/tool-meta-updater/src/{updatesScopeSupportFacetInfos.ts => updateScopeSupportFacetInfos.ts} (96%) rename packages/tool-meta-updater/src/{ => util}/cleanId.ts (100%) rename packages/tool-meta-updater/src/{ => util}/getCursorlessVscodeFields.ts (100%) rename packages/tool-meta-updater/src/{ => util}/toPosixPath.ts (100%) diff --git a/packages/tool-meta-updater/src/metaUpdater.ts b/packages/tool-meta-updater/src/metaUpdater.ts index 3740e05ba0..cc06dc7d5a 100644 --- a/packages/tool-meta-updater/src/metaUpdater.ts +++ b/packages/tool-meta-updater/src/metaUpdater.ts @@ -12,7 +12,6 @@ import { modifierReferences, scopeReferences, } from "@cursorless/lib-common"; -import { cleanId } from "./cleanId"; import type { Context } from "./Context"; import { textFormat } from "./textFormat"; import { updateLanguageMdx } from "./updateLanguageMdx"; @@ -20,9 +19,10 @@ import { updatePackageJson } from "./updatePackageJson"; import { updatePrivateScopeMdx } from "./updatePrivateScopeMdx"; import { updateReferenceMdx } from "./updateReferenceMdx"; import { updateReferenceReadmeMd } from "./updateReferenceReadmeMd"; -import { updatesScopeSupportFacetInfos } from "./updatesScopeSupportFacetInfos"; +import { updateScopeSupportFacetInfos } from "./updateScopeSupportFacetInfos"; import { updateTSConfig } from "./updateTSConfig"; import { updateTSConfigBase } from "./updateTSConfigBase"; +import { cleanId } from "./util/cleanId"; export const updater = async (workspaceDir: string) => { const pnpmLockfile = await readWantedLockfile(workspaceDir, { @@ -47,7 +47,7 @@ export const updater = async (workspaceDir: string) => { "tsconfig.json": updateTSConfig.bind(null, context), "tsconfig.base.json": updateTSConfigBase.bind(null, context), "resources/fixtures/scope-support-facet-infos.md": - updatesScopeSupportFacetInfos, + updateScopeSupportFacetInfos, ...Object.fromEntries( Object.keys(languageScopeSupport).map((languageId) => [ `${userDir}/languages/${languageId}.mdx`, diff --git a/packages/tool-meta-updater/src/updatePackageJson.ts b/packages/tool-meta-updater/src/updatePackageJson.ts index d156df6b3c..0968cd62ee 100644 --- a/packages/tool-meta-updater/src/updatePackageJson.ts +++ b/packages/tool-meta-updater/src/updatePackageJson.ts @@ -3,7 +3,7 @@ import { isUndefined } from "lodash-es"; import type { PackageJson } from "type-fest"; import { omitByDeep } from "@cursorless/lib-common"; import type { Context } from "./Context"; -import { getCursorlessVscodeFields } from "./getCursorlessVscodeFields"; +import { getCursorlessVscodeFields } from "./util/getCursorlessVscodeFields"; const LIB_ENTRY_POINT = "./src/index.ts"; diff --git a/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts b/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts index 3bec66110e..dc75fb91fb 100644 --- a/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts +++ b/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts @@ -3,7 +3,7 @@ import type { GroupedReferenceEntry, ReferenceGroup, } from "@cursorless/lib-common"; -import { cleanId } from "./cleanId"; +import { cleanId } from "./util/cleanId"; import { formatVariables } from "./util/formatVariables"; import { injectSpokenForm } from "./util/injectSpokenForm"; diff --git a/packages/tool-meta-updater/src/updatesScopeSupportFacetInfos.ts b/packages/tool-meta-updater/src/updateScopeSupportFacetInfos.ts similarity index 96% rename from packages/tool-meta-updater/src/updatesScopeSupportFacetInfos.ts rename to packages/tool-meta-updater/src/updateScopeSupportFacetInfos.ts index 4c39aa4e44..1866289a34 100644 --- a/packages/tool-meta-updater/src/updatesScopeSupportFacetInfos.ts +++ b/packages/tool-meta-updater/src/updateScopeSupportFacetInfos.ts @@ -9,7 +9,7 @@ import { plaintextScopeSupportFacetInfos, } from "@cursorless/lib-common"; -export function updatesScopeSupportFacetInfos( +export function updateScopeSupportFacetInfos( actual: string | null, _options: FormatPluginFnOptions, ): string | null { diff --git a/packages/tool-meta-updater/src/updateTSConfig.ts b/packages/tool-meta-updater/src/updateTSConfig.ts index fc481c1ecf..2601460440 100644 --- a/packages/tool-meta-updater/src/updateTSConfig.ts +++ b/packages/tool-meta-updater/src/updateTSConfig.ts @@ -5,7 +5,7 @@ import { isEqual } from "lodash-es"; import normalizePath from "normalize-path"; import type { TsConfigJson } from "type-fest"; import type { Context } from "./Context"; -import { toPosixPath } from "./toPosixPath"; +import { toPosixPath } from "./util/toPosixPath"; const baseName = "tsconfig.base.json"; const webJsonName = "tsconfig.web.json"; diff --git a/packages/tool-meta-updater/src/cleanId.ts b/packages/tool-meta-updater/src/util/cleanId.ts similarity index 100% rename from packages/tool-meta-updater/src/cleanId.ts rename to packages/tool-meta-updater/src/util/cleanId.ts diff --git a/packages/tool-meta-updater/src/getCursorlessVscodeFields.ts b/packages/tool-meta-updater/src/util/getCursorlessVscodeFields.ts similarity index 100% rename from packages/tool-meta-updater/src/getCursorlessVscodeFields.ts rename to packages/tool-meta-updater/src/util/getCursorlessVscodeFields.ts diff --git a/packages/tool-meta-updater/src/toPosixPath.ts b/packages/tool-meta-updater/src/util/toPosixPath.ts similarity index 100% rename from packages/tool-meta-updater/src/toPosixPath.ts rename to packages/tool-meta-updater/src/util/toPosixPath.ts From 6ea42df567fcd93217a02ad91ea56805a739ac0a Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sun, 30 Aug 2026 00:36:32 +0200 Subject: [PATCH 4/6] Remove group description --- .../src/references/ReferenceEntry.ts | 1 - .../src/references/actionReferenceGroups.ts | 55 ------------------- 2 files changed, 56 deletions(-) diff --git a/packages/lib-common/src/references/ReferenceEntry.ts b/packages/lib-common/src/references/ReferenceEntry.ts index 681b52f480..274a4b79f9 100644 --- a/packages/lib-common/src/references/ReferenceEntry.ts +++ b/packages/lib-common/src/references/ReferenceEntry.ts @@ -53,7 +53,6 @@ type ActionReferenceGroupId = export interface ReferenceGroup { id: T; name: string; - description: string[]; } export type ActionReferenceGroup = ReferenceGroup; diff --git a/packages/lib-common/src/references/actionReferenceGroups.ts b/packages/lib-common/src/references/actionReferenceGroups.ts index f28aaeb60e..cbaf35c4cd 100644 --- a/packages/lib-common/src/references/actionReferenceGroups.ts +++ b/packages/lib-common/src/references/actionReferenceGroups.ts @@ -4,156 +4,101 @@ export const actionReferenceGroups: ActionReferenceGroup[] = [ { id: "cursor", name: "Cursor movement", - description: [ - "Despite the name Cursorless, some of the most basic commands in Cursorless are for moving the cursor.", - "", - "Note that when combined with list targets, `take`/`pre`/`post` commands will result in multiple cursors.", - ], }, { id: "change", name: "Changing a target", - description: [ - "Actions that delete or change a target's text while keeping the cursor in a useful location.", - ], }, { id: "clone", name: "Clone", - description: [ - "Insert a copy of a target before or after itself and select the newly created copy.", - ], }, { id: "clipboard", name: "Cut, copy, and paste", - description: ["Transfer targets using the system clipboard."], }, { id: "swap", name: "Swap", - description: [ - "Swap two targets. If each side contains multiple targets, the targets are zipped together and swapped pairwise.", - ], }, { id: "indentation", name: "Indent and outdent", - description: ["Increase or decrease the indentation of a target."], }, { id: "numbers", name: "Increment and decrement", - description: ["Increase or decrease a number target."], }, { id: "emptyLines", name: "Insert empty lines or scopes", - description: [ - "Insert editable space before, after, or around a target.", - "", - "With a syntactic scope target, these actions insert the appropriate delimiters for a new instance of that scope.", - ], }, { id: "homophones", name: "Homophones", - description: ["Cycle a target through its homophones."], }, { id: "rename", name: "Rename", - description: ["Use the editor's rename operation on a target."], }, { id: "scroll", name: "Scroll", - description: [ - "Scroll a target to the top, center, or bottom of the viewport.", - ], }, { id: "insert", name: "Insert, use, and repeat", - description: [ - "Insert or use the contents of one target at the current selection or another destination.", - ], }, { id: "move", name: "Move and replace", - description: [ - "Move a target to the current selection or another destination.", - ], }, { id: "reorder", name: "Reverse, shuffle, and sort", - description: ["Change the order of multiple targets or selections."], }, { id: "wrap", name: "Wrap and rewrap", - description: [ - "Wrap a target with paired delimiters, or replace its existing delimiters.", - ], }, { id: "navigation", name: "Navigate and inspect", - description: [ - "Navigate to related code, search for a target, or show editor information and available fixes.", - ], }, { id: "folding", name: "Fold and unfold", - description: ["Fold or unfold the region containing a target."], }, { id: "extract", name: "Extract", - description: [ - "Extract a target into a variable using the editor's refactor action.", - ], }, { id: "join", name: "Join", - description: ["Join multiple lines into one line."], }, { id: "break", name: "Break", - description: ["Break a line in two before a target."], }, { id: "visual", name: "Visual feedback", - description: ["Temporarily identify or persistently highlight targets."], }, { id: "snippets", name: "Snippets", - description: ["Generate, insert, or wrap targets with snippets."], }, { id: "git", name: "Git", - description: ["Accept, revert, stage, or unstage Git changes."], }, { id: "editor", name: "Editor commands", - description: [ - "Run editor operations such as formatting, commenting, and toggling breakpoints.", - ], }, { id: "targetContext", name: "Target context", - description: [ - "Set contextual references that can be used to resolve later targets.", - ], }, ]; From 54a1a8a476585c63294484aea2c3bed100d68165 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sun, 30 Aug 2026 01:10:29 +0200 Subject: [PATCH 5/6] Generate reference readme files --- .../src/docs/user/actions/README.md | 2 +- .../src/docs/user/modifiers/README.md | 57 + .../src/docs/user/scopes/README.md | 89 ++ .../src/references/ReferenceEntry.ts | 49 +- .../src/references/actionReferenceGroups.ts | 32 +- .../src/references/actionReferences.ts | 1219 +++++++---------- packages/lib-common/src/references/index.ts | 12 +- .../src/references/modifierReferenceGroups.ts | 38 + .../src/references/modifierReferences.ts | 138 +- .../src/references/scopeReferenceGroups.ts | 52 + .../src/references/scopeReferences.ts | 854 ++++++------ packages/tool-meta-updater/src/metaUpdater.ts | 14 + .../src/updatePrivateScopeMdx.ts | 2 +- .../src/updateReferenceMdx.ts | 2 +- .../src/updateReferenceReadmeMd.ts | 7 +- 15 files changed, 1378 insertions(+), 1189 deletions(-) create mode 100644 packages/app-web-docs/src/docs/user/modifiers/README.md create mode 100644 packages/app-web-docs/src/docs/user/scopes/README.md create mode 100644 packages/lib-common/src/references/modifierReferenceGroups.ts create mode 100644 packages/lib-common/src/references/scopeReferenceGroups.ts diff --git a/packages/app-web-docs/src/docs/user/actions/README.md b/packages/app-web-docs/src/docs/user/actions/README.md index 8a48498396..a0b42693e8 100644 --- a/packages/app-web-docs/src/docs/user/actions/README.md +++ b/packages/app-web-docs/src/docs/user/actions/README.md @@ -12,8 +12,8 @@ ## Changing a target -- [`"chuck "`](./remove.mdx) - Remove ``. - [`"change "`](./clearAndSetSelection.mdx) - Change `` by clearing it and leaving the cursor in its place. +- [`"chuck "`](./remove.mdx) - Remove ``. ## Clone diff --git a/packages/app-web-docs/src/docs/user/modifiers/README.md b/packages/app-web-docs/src/docs/user/modifiers/README.md new file mode 100644 index 0000000000..dd87980f7c --- /dev/null +++ b/packages/app-web-docs/src/docs/user/modifiers/README.md @@ -0,0 +1,57 @@ +# Modifiers + +## Positions + +- [`"start of"`](./startOf.mdx) - Empty position at start of target. +- [`"end of"`](./endOf.mdx) - Empty position at end of target. + +## Interiors and delimiters + +- [`"inside"`](./interiorOnly.mdx) - Interior only. +- [`"bounds"`](./excludeInterior.mdx) - Bounding paired delimiters. +- [`"leading"`](./leading.mdx) - Leading delimiter range. +- [`"trailing"`](./trailing.mdx) - Trailing delimiter range. + +## Scope navigation + +- [`""`](./containingScope.mdx) - Containing instance of ``. +- [`"every "`](./everyScope.mdx) - Every instance of ``. +- [`"grand "`](./ancestor.mdx) - Parent of the containing instance of ``. +- [`" "`](./ordinalScope.mdx) - `` instance of `` in iteration scope. +- [`" last "`](./ordinalScope.mdx) - ``-to-last instance of `` in iteration scope. +- [`"first s"`](./ordinalScope.mdx) - First `` instances of `` in iteration scope, as contiguous range. +- [`"every first s"`](./ordinalScope.mdx) - First `` instances of `` in iteration scope, as individual targets. +- [`"last s"`](./ordinalScope.mdx) - Last `` instances of `` in iteration scope, as contiguous range. +- [`"every last s"`](./ordinalScope.mdx) - Last `` instances of `` in iteration scope, as individual targets. +- [`"previous "`](./relativeScope.mdx) - Previous instance of ``. +- [`" previous "`](./relativeScope.mdx) - `` instance of `` before target. +- [`"next "`](./relativeScope.mdx) - Next instance of ``. +- [`" next "`](./relativeScope.mdx) - `` instance of `` after target. +- [`" backward"`](./relativeScope.mdx) - Single instance of `` including target, going backwards. +- [`" forward"`](./relativeScope.mdx) - Single instance of `` including target, going forwards. +- [`" s backward"`](./relativeScope.mdx) - `` instances of `` including target, going backwards, as contiguous range. +- [`"every s backward"`](./relativeScope.mdx) - `` instances of `` including target, going backwards, as individual targets. +- [`" s"`](./relativeScope.mdx) - `` instances of `` including target, going forwards, as contiguous range. +- [`"every s"`](./relativeScope.mdx) - `` instances of `` including target, going forwards, as individual targets. +- [`"previous s"`](./relativeScope.mdx) - Previous `` instances of ``, as contiguous range. +- [`"every previous s"`](./relativeScope.mdx) - Previous `` instances of ``, as individual targets. +- [`"next s"`](./relativeScope.mdx) - Next `` instances of ``, as contiguous range. +- [`"every next s"`](./relativeScope.mdx) - Next `` instances of ``, as individual targets. + +## Range extension + +- [`"head"`](./extendThroughStartOf.mdx) - Extend through start of line/pair. +- [`"head "`](./extendThroughStartOf.mdx) - Extend through start of ``. +- [`"tail"`](./extendThroughEndOf.mdx) - Extend through end of line/pair. +- [`"tail "`](./extendThroughEndOf.mdx) - Extend through end of ``. + +## Filters + +- [`"visible"`](./visible.mdx) - Visible in viewport. +- [`"content"`](./keepContentFilter.mdx) - Keep content filter. +- [`"empty"`](./keepEmptyFilter.mdx) - Keep empty filter. + +## Inference + +- [`"just"`](./toRawSelection.mdx) - No inference. +- [`"its"`](./inferPreviousMark.mdx) - Infer previous mark. diff --git a/packages/app-web-docs/src/docs/user/scopes/README.md b/packages/app-web-docs/src/docs/user/scopes/README.md new file mode 100644 index 0000000000..8d699855c7 --- /dev/null +++ b/packages/app-web-docs/src/docs/user/scopes/README.md @@ -0,0 +1,89 @@ +# Scopes + +## Characters and tokens + +- [`"char"`](./character.mdx) - Character. +- [`"sub"`](./word.mdx) - Sub token word. +- [`"token"`](./token.mdx) - Token. +- [`"identifier"`](./identifier.mdx) - Identifier. +- [`"glyph "`](./glyph.mdx) - Instance of single character ``. +- [`"paint"`](./nonWhitespaceSequence.mdx) - Non-whitespace sequence. +- [`"short paint"`](./boundedNonWhitespaceSequence.mdx) - Non-whitespace sequence bounded by surrounding pair delimiters. +- [`"link"`](./url.mdx) - URL. +- [`"regex"`](./regularExpression.mdx) - Regular expression. + +## Lines and documents + +- [`"line"`](./line.mdx) - Line. +- [`"full line"`](./fullLine.mdx) - Full line. +- [`"sentence"`](./sentence.mdx) - Sentence. +- [`"block"`](./paragraph.mdx) - Paragraph. +- [`"short block"`](./boundedParagraph.mdx) - Paragraph bounded by surrounding pair delimiters. +- [`"file"`](./document.mdx) - Document. +- [`"cell"`](./notebookCell.mdx) - Notebook cell. + +## Functions and calls + +- [`"arg"`](./argumentOrParameter.mdx) - Argument. +- [`"arg list"`](./argumentList.mdx) - Argument list. +- [`"lambda"`](./anonymousFunction.mdx) - Anonymous function. +- [`"funk"`](./namedFunction.mdx) - Named function. +- [`"funk name"`](./functionName.mdx) - Function name. +- [`"call"`](./functionCall.mdx) - Function call. +- [`"callee"`](./functionCallee.mdx) - Function callee. + +## Classes and objects + +- [`"class"`](./class.mdx) - Class. +- [`"class name"`](./className.mdx) - Class name. +- [`"instance"`](./instance.mdx) - Instance. +- [`"name"`](./name.mdx) - Name. +- [`"attribute"`](./attribute.mdx) - Attribute. +- [`"type"`](./type.mdx) - Type. +- [`"value"`](./value.mdx) - Value. + +## Collections + +- [`"list"`](./list.mdx) - List. +- [`"map"`](./map.mdx) - Map. +- [`"item"`](./collectionItem.mdx) - Collection item. +- [`"key"`](./collectionKey.mdx) - Collection key. + +## Statements and expressions + +- [`"state"`](./statement.mdx) - Statement. +- [`"branch"`](./branch.mdx) - Branch. +- [`"if state"`](./ifStatement.mdx) - If statement. +- [`"condition"`](./condition.mdx) - Condition. +- [`"comment"`](./comment.mdx) - Comment. +- [`"command"`](./command.mdx) - Command. + +## Markup + +- [`"element"`](./xmlElement.mdx) - XML element. +- [`"start tag"`](./xmlStartTag.mdx) - XML start tag. +- [`"end tag"`](./xmlEndTag.mdx) - XML end tag. +- [`"tags"`](./xmlBothTags.mdx) - XML start and end tags. +- [`"selector"`](./selector.mdx) - Selector. +- [`"unit"`](./unit.mdx) - Unit. + +## Document structure + +- [`"section"`](./section.mdx) - Section. +- [`"one section"`](./sectionLevelOne.mdx) - Section level one. +- [`"two section"`](./sectionLevelTwo.mdx) - Section level two. +- [`"three section"`](./sectionLevelThree.mdx) - Section level three. +- [`"four section"`](./sectionLevelFour.mdx) - Section level four. +- [`"five section"`](./sectionLevelFive.mdx) - Section level five. +- [`"six section"`](./sectionLevelSix.mdx) - Section level six. +- [`"part"`](./part.mdx) - Part. +- [`"chapter"`](./chapter.mdx) - Chapter. +- [`"subsection"`](./subSection.mdx) - Subsection. +- [`"subsubsection"`](./subSubSection.mdx) - Subsubsection. +- [`"paragraph"`](./namedParagraph.mdx) - Named paragraph. +- [`"subparagraph"`](./subParagraph.mdx) - Subparagraph. +- [`"environment"`](./environment.mdx) - Environment. + +## Paired delimiters + +- [`""`](./surroundingPair.mdx) - Surrounding pair. diff --git a/packages/lib-common/src/references/ReferenceEntry.ts b/packages/lib-common/src/references/ReferenceEntry.ts index 274a4b79f9..bb1d09d627 100644 --- a/packages/lib-common/src/references/ReferenceEntry.ts +++ b/packages/lib-common/src/references/ReferenceEntry.ts @@ -4,61 +4,24 @@ export interface SpokenFormReference { disabledByDefault?: boolean; } -export interface ReferenceEntry extends SpokenFormReference { +export interface ReferenceEntry extends SpokenFormReference { name: string; - nameShort?: string; legacySpokenForms?: string[]; description?: string; + group: GroupDefinition; syntaxes: SyntaxDefinition[]; examples: ExampleDefinition[]; } -export interface GroupedReferenceEntry< - T extends string, -> extends ReferenceEntry { - group: { - id: T; - index: number; - }; -} - -type ActionReferenceGroupId = - | "cursor" - | "change" - | "clone" - | "clipboard" - | "swap" - | "indentation" - | "numbers" - | "emptyLines" - | "homophones" - | "rename" - | "scroll" - | "insert" - | "move" - | "reorder" - | "wrap" - | "navigation" - | "folding" - | "extract" - | "join" - | "break" - | "visual" - | "snippets" - | "git" - | "editor" - | "targetContext" - | "private"; - export interface ReferenceGroup { id: T; name: string; } -export type ActionReferenceGroup = ReferenceGroup; - -export type ActionReferenceEntry = - GroupedReferenceEntry; +interface GroupDefinition { + id: T; + index: number; +} interface SyntaxDefinition { pattern: string; diff --git a/packages/lib-common/src/references/actionReferenceGroups.ts b/packages/lib-common/src/references/actionReferenceGroups.ts index cbaf35c4cd..ce6f3549a3 100644 --- a/packages/lib-common/src/references/actionReferenceGroups.ts +++ b/packages/lib-common/src/references/actionReferenceGroups.ts @@ -1,6 +1,34 @@ -import type { ActionReferenceGroup } from "./ReferenceEntry"; +import type { ReferenceGroup } from "./ReferenceEntry"; -export const actionReferenceGroups: ActionReferenceGroup[] = [ +export type ActionReferenceGroupId = + | "cursor" + | "change" + | "clone" + | "clipboard" + | "swap" + | "indentation" + | "numbers" + | "emptyLines" + | "homophones" + | "rename" + | "scroll" + | "insert" + | "move" + | "reorder" + | "wrap" + | "navigation" + | "folding" + | "extract" + | "join" + | "break" + | "visual" + | "snippets" + | "git" + | "editor" + | "targetContext" + | "private"; + +export const actionReferenceGroups: ReferenceGroup[] = [ { id: "cursor", name: "Cursor movement", diff --git a/packages/lib-common/src/references/actionReferences.ts b/packages/lib-common/src/references/actionReferences.ts index cf8e66cc3f..c238dba6c0 100644 --- a/packages/lib-common/src/references/actionReferences.ts +++ b/packages/lib-common/src/references/actionReferences.ts @@ -1,4 +1,5 @@ import type { ActionType } from "../types/command/ActionDescriptor"; +import type { ActionReferenceGroupId } from "./actionReferenceGroups"; import { FORMATTER_CAMEL, REMOVE, @@ -22,7 +23,7 @@ import { } from "./constants"; import { modifierReferences } from "./modifierReferences"; import { pairedDelimiterReferences } from "./pairedDelimiterReferences"; -import type { ActionReferenceEntry } from "./ReferenceEntry"; +import type { ReferenceEntry } from "./ReferenceEntry"; import { scopeReferences } from "./scopeReferences"; import { connectiveDefaultSpokenForms } from "./spokenForms/connectiveDefaultSpokenForms"; @@ -46,13 +47,11 @@ const ON = connectiveDefaultSpokenForms.on; type TalonSideActionType = "applyFormatter" | "nextHomophone"; export const actionReferences = { + // Group: cursor setSelection: { name: "Set selection", defaultSpokenForm: SET_SELECTION, - group: { - id: "cursor", - index: 0, - }, + group: { id: "cursor", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -70,10 +69,7 @@ export const actionReferences = { setSelectionBefore: { name: "Set selection before", defaultSpokenForm: "pre", - group: { - id: "cursor", - index: 1, - }, + group: { id: "cursor", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -91,10 +87,7 @@ export const actionReferences = { setSelectionAfter: { name: "Set selection after", defaultSpokenForm: "post", - group: { - id: "cursor", - index: 2, - }, + group: { id: "cursor", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -112,10 +105,7 @@ export const actionReferences = { addSelection: { name: "Add selection", defaultSpokenForm: "append", - group: { - id: "cursor", - index: 3, - }, + group: { id: "cursor", index: 3 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -133,10 +123,7 @@ export const actionReferences = { addSelectionBefore: { name: "Add selection before", defaultSpokenForm: "append pre", - group: { - id: "cursor", - index: 4, - }, + group: { id: "cursor", index: 4 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -154,10 +141,7 @@ export const actionReferences = { addSelectionAfter: { name: "Add selection after", defaultSpokenForm: "append post", - group: { - id: "cursor", - index: 5, - }, + group: { id: "cursor", index: 5 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -175,10 +159,7 @@ export const actionReferences = { deselect: { name: "Deselect", defaultSpokenForm: "give", - group: { - id: "cursor", - index: 6, - }, + group: { id: "cursor", index: 6 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -194,34 +175,30 @@ export const actionReferences = { ], }, - breakLine: { - name: "Break line", - defaultSpokenForm: "break", - group: { - id: "break", - index: 0, - }, + // Group: change + clearAndSetSelection: { + name: "Change", + defaultSpokenForm: "change", + group: { id: "change", index: 0 }, + legacySpokenForms: ["clear"], syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Breaks the line before ${VAR_TARGET}.`, - cheatsheet: "Breaks the line", + description: `Change ${VAR_TARGET} by clearing it and leaving the cursor in its place.`, + cheatsheet: "Change", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Breaks the line before the ${TARGET_DESC}.`, + description: `Changes the ${TARGET_DESC} by clearing it and leaving the cursor in its place.`, }, ], }, remove: { name: "Remove", defaultSpokenForm: REMOVE, - group: { - id: "change", - index: 0, - }, + group: { id: "change", index: 1 }, description: "This action can be used to remove a target without moving the cursor.", syntaxes: [ @@ -238,35 +215,50 @@ export const actionReferences = { }, ], }, - clearAndSetSelection: { - name: "Change", - defaultSpokenForm: "change", - group: { - id: "change", - index: 1, - }, - legacySpokenForms: ["clear"], + + // Group: clone + insertCopyAfter: { + name: "Insert copy after", + defaultSpokenForm: "clone", + group: { id: "clone", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Change ${VAR_TARGET} by clearing it and leaving the cursor in its place.`, - cheatsheet: "Change", + description: `Insert copy after ${VAR_TARGET}.`, + cheatsheet: "Insert copy after", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Changes the ${TARGET_DESC} by clearing it and leaving the cursor in its place.`, + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Inserts a copy of the function containing the ${TARGET_DESC} after itself.`, + }, + ], + }, + insertCopyBefore: { + name: "Insert copy before", + defaultSpokenForm: "clone up", + group: { id: "clone", index: 1 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Insert copy before ${VAR_TARGET}.`, + cheatsheet: "Insert copy before", + }, + ], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Inserts a copy of the function containing the ${TARGET_DESC} before itself.`, }, ], }, + + // Group: clipboard cutToClipboard: { name: "Cut to clipboard", defaultSpokenForm: "carve", - group: { - id: "clipboard", - index: 0, - }, + group: { id: "clipboard", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -284,10 +276,7 @@ export const actionReferences = { copyToClipboard: { name: "Copy to clipboard", defaultSpokenForm: "copy", - group: { - id: "clipboard", - index: 1, - }, + group: { id: "clipboard", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -305,10 +294,7 @@ export const actionReferences = { pasteFromClipboard: { name: "Paste from clipboard", defaultSpokenForm: "paste", - group: { - id: "clipboard", - index: 2, - }, + group: { id: "clipboard", index: 2 }, syntaxes: [ { pattern: `${VAR_SPOKEN_FORM} ${VAR_DESTINATION}`, @@ -323,13 +309,79 @@ export const actionReferences = { }, ], }, + + // Group: swap + swapTargets: { + name: "Swap targets", + defaultSpokenForm: "swap", + group: { id: "swap", index: 0 }, + syntaxes: [ + { + pattern: `${VAR_SPOKEN_FORM} ${WITH} ${VAR_TARGET}`, + description: `Swap selection with ${VAR_TARGET}.`, + cheatsheet: `Swap selection with ${VAR_TARGET}`, + }, + { + pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET_1} ${WITH} ${VAR_TARGET_2}`, + description: `Swap ${VAR_TARGET_1} with ${VAR_TARGET_2}.`, + cheatsheet: `Swap ${VAR_TARGET_1} with ${VAR_TARGET_2}`, + }, + ], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${WITH} ${TARGET}`, + description: `Swaps the current selection with the ${TARGET_DESC}.`, + }, + { + command: `${VAR_SPOKEN_FORM} ${TARGET} ${WITH} ${TARGET_2}`, + description: `Swaps the ${TARGET_DESC} and the ${TARGET_2_DESC}.`, + }, + ], + }, + + // Group: indentation + indentLine: { + name: "Indent line", + defaultSpokenForm: "indent", + group: { id: "indentation", index: 0 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Indent line containing ${VAR_TARGET}.`, + cheatsheet: "Indent line", + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Indents the line containing the ${TARGET_DESC}.`, + }, + ], + }, + outdentLine: { + name: "Outdent line", + defaultSpokenForm: "dedent", + group: { id: "indentation", index: 1 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Outdent line containing ${VAR_TARGET}.`, + cheatsheet: "Outdent line", + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Decreases the indentation of the line containing the ${TARGET_DESC}.`, + }, + ], + }, + + // Group: numbers increment: { name: "Increment", defaultSpokenForm: "increment", - group: { - id: "numbers", - index: 0, - }, + group: { id: "numbers", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -347,10 +399,7 @@ export const actionReferences = { decrement: { name: "Decrement", defaultSpokenForm: "decrement", - group: { - id: "numbers", - index: 1, - }, + group: { id: "numbers", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -365,13 +414,12 @@ export const actionReferences = { }, ], }, + + // Group: emptyLines editNewLineBefore: { name: "Edit new line/scope before", defaultSpokenForm: "drink", - group: { - id: "emptyLines", - index: 0, - }, + group: { id: "emptyLines", index: 0 }, description: "Scope defaults to line.", syntaxes: [ { @@ -399,10 +447,7 @@ export const actionReferences = { editNewLineAfter: { name: "Edit new line/scope after", defaultSpokenForm: "pour", - group: { - id: "emptyLines", - index: 1, - }, + group: { id: "emptyLines", index: 1 }, description: "Scope defaults to line.", syntaxes: [ { @@ -430,10 +475,7 @@ export const actionReferences = { insertEmptyLineBefore: { name: "Insert empty line/scope before", defaultSpokenForm: "drop", - group: { - id: "emptyLines", - index: 2, - }, + group: { id: "emptyLines", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -455,10 +497,7 @@ export const actionReferences = { insertEmptyLineAfter: { name: "Insert empty line/scope after", defaultSpokenForm: "float", - group: { - id: "emptyLines", - index: 3, - }, + group: { id: "emptyLines", index: 3 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -480,10 +519,7 @@ export const actionReferences = { insertEmptyLinesAround: { name: "Insert empty lines/scopes around", defaultSpokenForm: "puff", - group: { - id: "emptyLines", - index: 4, - }, + group: { id: "emptyLines", index: 4 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -502,998 +538,815 @@ export const actionReferences = { }, ], }, - "experimental.setInstanceReference": { - name: "Set instance reference", - defaultSpokenForm: "from", - group: { - id: "targetContext", - index: 0, - }, - description: - "Sets the instance reference for the next 'instance of' action.", + + // Group: homophones + nextHomophone: { + name: "Next homophone", + defaultSpokenForm: "phones", + group: { id: "homophones", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Set instance reference to ${VAR_TARGET}.`, - cheatsheet: "Set instance reference", + description: `Cycle to next homophone for ${VAR_TARGET}.`, + cheatsheet: "Cycle to next homophone", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET} ${SET_SELECTION} ${EVERY} ${INSTANCE} ${TARGET_2}`, - description: `Selects every instance of the ${TARGET_2_DESC} within the function containing the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Replaces the ${TARGET_DESC} with its next homophone.`, }, ], }, - extractVariable: { - name: "Extract variable", - defaultSpokenForm: "extract", - group: { - id: "extract", - index: 0, - }, + + // Group: rename + rename: { + name: "Rename", + defaultSpokenForm: "rename", + group: { id: "rename", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Extract variable from ${VAR_TARGET}.`, - cheatsheet: "Extract variable", + description: `Rename ${VAR_TARGET}.`, + cheatsheet: "Rename", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${VALUE} ${TARGET}`, - description: `Extracts the value containing the ${TARGET_DESC} into a variable.`, + command: DEFAULT_COMMAND, + description: `Starts renaming the ${TARGET_DESC}.`, }, ], }, - revealDefinition: { - name: "Reveal definition", - defaultSpokenForm: "define", - group: { - id: "navigation", - index: 0, - }, + + // Group: scroll + scrollToTop: { + name: "Scroll to top", + defaultSpokenForm: "crown", + group: { id: "scroll", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Reveal definition of ${VAR_TARGET}.`, - cheatsheet: "Reveal definition", + description: `Scroll ${VAR_TARGET} to top of the viewport.`, + cheatsheet: "Scroll to top", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Opens the definition of the ${TARGET_DESC}.`, + description: `Scrolls the ${TARGET_DESC} to the top of the viewport.`, }, ], }, - revealTypeDefinition: { - name: "Reveal type definition", - defaultSpokenForm: "type deaf", - group: { - id: "navigation", - index: 1, - }, + scrollToCenter: { + name: "Scroll to center", + defaultSpokenForm: "center", + group: { id: "scroll", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Reveal type definition of ${VAR_TARGET}.`, - cheatsheet: "Reveal type definition", + description: `Scroll ${VAR_TARGET} to center of the viewport.`, + cheatsheet: "Scroll to center", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Opens the type definition of the ${TARGET_DESC}.`, + description: `Scrolls the ${TARGET_DESC} to the center of the viewport.`, }, ], }, - showReferences: { - name: "Show references", - defaultSpokenForm: "reference", - group: { - id: "navigation", - index: 2, - }, + scrollToBottom: { + name: "Scroll to bottom", + defaultSpokenForm: "bottom", + group: { id: "scroll", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Show references for ${VAR_TARGET}.`, - cheatsheet: "Show references", + description: `Scroll ${VAR_TARGET} to bottom of the viewport.`, + cheatsheet: "Scroll to bottom", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Shows references to the ${TARGET_DESC}.`, + description: `Scrolls the ${TARGET_DESC} to the bottom of the viewport.`, }, ], }, - showHover: { - name: "Show hover", - defaultSpokenForm: "hover", - group: { - id: "navigation", - index: 3, - }, + + // Group: insert + replaceWithTarget: { + name: "Replace with target", + defaultSpokenForm: "bring", + group: { id: "insert", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Show hover for ${VAR_TARGET}.`, - cheatsheet: "Show hover", + description: `Insert copy of ${VAR_TARGET} at selection.`, + cheatsheet: `Insert copy of ${VAR_TARGET} at selection`, + }, + { + pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET} ${VAR_DESTINATION}`, + description: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}.`, + cheatsheet: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}`, }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Shows hover information for the ${TARGET_DESC}.`, + description: `Inserts a copy of the ${TARGET_DESC} at the current selection.`, + }, + { + command: `${VAR_SPOKEN_FORM} ${TARGET} ${TO} ${TARGET_2}`, + description: `Replaces the ${TARGET_2_DESC} with a copy of the ${TARGET_DESC}.`, }, ], }, - showQuickFix: { - name: "Show quick fix", - defaultSpokenForm: "quick fix", - group: { - id: "navigation", - index: 4, - }, + callAsFunction: { + name: "Call as function", + defaultSpokenForm: "call", + group: { id: "insert", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Show quick fix for ${VAR_TARGET}.`, - cheatsheet: "Show quick fix", + description: `Insert call to ${VAR_TARGET} on selection.`, + cheatsheet: `Insert call to ${VAR_TARGET} on selection`, + }, + { + pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET_1} ${ON} ${VAR_TARGET_2}`, + description: `Insert call to ${VAR_TARGET_1} on ${VAR_TARGET_2}.`, + cheatsheet: `Insert call to ${VAR_TARGET_1} on ${VAR_TARGET_2}`, }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Shows quick fixes for the ${TARGET_DESC}.`, + description: `Inserts a call to the ${TARGET_DESC} at the current selection.`, + }, + { + command: `${VAR_SPOKEN_FORM} ${TARGET} ${ON} ${TARGET_2}`, + description: `Inserts a call to the ${TARGET_DESC} on the ${TARGET_2_DESC}.`, }, ], }, - findInDocument: { - name: "Find in document", - defaultSpokenForm: "scout", - group: { - id: "navigation", - index: 5, - }, + + // Group: move + moveToTarget: { + name: "Move to target", + defaultSpokenForm: "move", + group: { id: "move", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Find ${VAR_TARGET} in document.`, - cheatsheet: "Find in document", + description: `Move ${VAR_TARGET} to selection.`, + cheatsheet: `Move ${VAR_TARGET} to selection`, + }, + { + pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET} ${VAR_DESTINATION}`, + description: `Move ${VAR_TARGET} to ${VAR_DESTINATION}.`, + cheatsheet: `Move ${VAR_TARGET} to ${VAR_DESTINATION}`, }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Searches the current document for the ${TARGET_DESC}.`, + description: `Moves the ${TARGET_DESC} to the current selection.`, + }, + { + command: `${VAR_SPOKEN_FORM} ${TARGET} ${AFTER} ${TARGET_2}`, + description: `Moves the ${TARGET_DESC} to after the ${TARGET_2_DESC}.`, }, ], }, - findInWorkspace: { - name: "Find in workspace", - defaultSpokenForm: "scout all", - group: { - id: "navigation", - index: 6, - }, + + // Group: reorder + reverseTargets: { + name: "Reverse targets", + defaultSpokenForm: "reverse", + group: { id: "reorder", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Find ${VAR_TARGET} in workspace.`, - cheatsheet: "Find in workspace", + description: `Reverse ${VAR_TARGET}s.`, + cheatsheet: "Reverse targets", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Searches the workspace for the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, + description: `Reverses the collection items associated with the ${TARGET_DESC}.`, }, ], }, - followLink: { - name: "Follow link", - defaultSpokenForm: "follow", - group: { - id: "navigation", - index: 7, - }, + randomizeTargets: { + name: "Randomize targets", + defaultSpokenForm: "shuffle", + group: { id: "reorder", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Follow link at ${VAR_TARGET}.`, - cheatsheet: "Follow link", + description: `Randomize ${VAR_TARGET}s.`, + cheatsheet: "Randomize targets", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Opens the link containing the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, + description: `Randomizes the collection items associated with the ${TARGET_DESC}.`, }, ], }, - followLinkAside: { - name: "Follow link aside", - defaultSpokenForm: "follow split", - group: { - id: "navigation", - index: 8, - }, + sortTargets: { + name: "Sort targets", + defaultSpokenForm: "sort", + group: { id: "reorder", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Follow link at ${VAR_TARGET} aside (e.g. in a split view).`, - cheatsheet: "Follow link aside", + description: `Sort ${VAR_TARGET}s.`, + cheatsheet: "Sort targets", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Opens the link containing the ${TARGET_DESC} in a split view.`, + command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, + description: `Sorts the collection items associated with the ${TARGET_DESC}.`, }, ], }, - showDebugHover: { - name: "Show debug hover", - defaultSpokenForm: "inspect", - group: { - id: "navigation", - index: 9, - }, + + // Group: wrap + wrapWithPairedDelimiter: { + name: "Wrap with paired delimiter/snippet", + defaultSpokenForm: "wrap", + group: { id: "wrap", index: 0 }, syntaxes: [ { - pattern: DEFAULT_PATTERN, - description: `Show debug hover for ${VAR_TARGET}.`, - cheatsheet: "Show debug hover", + pattern: `${VAR_PAIR} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, + description: `Wrap ${VAR_TARGET} with ${VAR_PAIR}.`, + cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_PAIR}`, + }, + { + pattern: `${VAR_SNIPPET} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, + description: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}.`, + cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}`, }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Shows debug information for the ${TARGET_DESC}.`, + command: `${SQUARE} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Wraps the ${TARGET_DESC} in square brackets.`, + }, + { + command: `${SNIPPET_IF} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Wraps the ${TARGET_DESC} in an if-statement snippet.`, }, ], }, - flashTargets: { - name: "Flash target", - defaultSpokenForm: "flash", - group: { - id: "visual", - index: 0, - }, + rewrapWithPairedDelimiter: { + name: "Rewrap with paired delimiter", + defaultSpokenForm: "repack", + group: { id: "wrap", index: 1 }, syntaxes: [ { - pattern: DEFAULT_PATTERN, - description: `Flash ${VAR_TARGET}.`, - cheatsheet: "Flash target", + pattern: `${VAR_PAIR} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, + description: `Rewrap ${VAR_TARGET} with ${VAR_PAIR}.`, + cheatsheet: `Rewrap ${VAR_TARGET} with ${VAR_PAIR}`, }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Briefly flashes the ${TARGET_DESC}.`, + command: `${CURLY} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Replaces the paired delimiters around the ${TARGET_DESC} with curly brackets.`, }, ], }, - highlight: { - name: "Highlight", - defaultSpokenForm: "highlight", - group: { - id: "visual", - index: 1, - }, + + // Group: navigation + revealDefinition: { + name: "Reveal definition", + defaultSpokenForm: "define", + group: { id: "navigation", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Highlight ${VAR_TARGET}.`, - cheatsheet: "Highlight", + description: `Reveal definition of ${VAR_TARGET}.`, + cheatsheet: "Reveal definition", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Highlights the ${TARGET_DESC}.`, + description: `Opens the definition of the ${TARGET_DESC}.`, }, ], }, - foldRegion: { - name: "Fold region", - defaultSpokenForm: "fold", - group: { - id: "folding", - index: 0, - }, + revealTypeDefinition: { + name: "Reveal type definition", + defaultSpokenForm: "type deaf", + group: { id: "navigation", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Fold region at ${VAR_TARGET}.`, - cheatsheet: "Fold region", + description: `Reveal type definition of ${VAR_TARGET}.`, + cheatsheet: "Reveal type definition", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, - description: `Folds the function containing the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Opens the type definition of the ${TARGET_DESC}.`, }, ], }, - unfoldRegion: { - name: "Unfold region", - defaultSpokenForm: "unfold", - group: { - id: "folding", - index: 1, - }, + showReferences: { + name: "Show references", + defaultSpokenForm: "reference", + group: { id: "navigation", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Unfold region at ${VAR_TARGET}.`, - cheatsheet: "Unfold region", + description: `Show references for ${VAR_TARGET}.`, + cheatsheet: "Show references", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, - description: `Unfolds the function containing the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Shows references to the ${TARGET_DESC}.`, }, ], }, - gitAccept: { - name: "Git accept", - defaultSpokenForm: "git accept", - group: { - id: "git", - index: 0, - }, + showHover: { + name: "Show hover", + defaultSpokenForm: "hover", + group: { id: "navigation", index: 3 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Accept Git change at ${VAR_TARGET}.`, - cheatsheet: "Git accept", + description: `Show hover for ${VAR_TARGET}.`, + cheatsheet: "Show hover", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Accepts the Git change on the line containing the ${TARGET_DESC}.`, + description: `Shows hover information for the ${TARGET_DESC}.`, }, ], }, - gitRevert: { - name: "Git revert", - defaultSpokenForm: "git revert", - group: { - id: "git", - index: 1, - }, + showQuickFix: { + name: "Show quick fix", + defaultSpokenForm: "quick fix", + group: { id: "navigation", index: 4 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Revert Git change at ${VAR_TARGET}.`, - cheatsheet: "Git revert", + description: `Show quick fix for ${VAR_TARGET}.`, + cheatsheet: "Show quick fix", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Reverts the Git change on the line containing the ${TARGET_DESC}.`, + description: `Shows quick fixes for the ${TARGET_DESC}.`, }, ], }, - gitStage: { - name: "Git stage", - defaultSpokenForm: "git stage", - group: { - id: "git", - index: 2, - }, + findInDocument: { + name: "Find in document", + defaultSpokenForm: "scout", + group: { id: "navigation", index: 5 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Stage Git change at ${VAR_TARGET}.`, - cheatsheet: "Git stage", + description: `Find ${VAR_TARGET} in document.`, + cheatsheet: "Find in document", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Stages the Git change on the line containing the ${TARGET_DESC}.`, + description: `Searches the current document for the ${TARGET_DESC}.`, }, ], }, - gitUnstage: { - name: "Git unstage", - defaultSpokenForm: "git unstage", - group: { - id: "git", - index: 3, - }, + findInWorkspace: { + name: "Find in workspace", + defaultSpokenForm: "scout all", + group: { id: "navigation", index: 6 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Unstage Git change at ${VAR_TARGET}.`, - cheatsheet: "Git unstage", + description: `Find ${VAR_TARGET} in workspace.`, + cheatsheet: "Find in workspace", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Unstages the Git change on the line containing the ${TARGET_DESC}.`, + description: `Searches the workspace for the ${TARGET_DESC}.`, }, ], }, - indentLine: { - name: "Indent line", - defaultSpokenForm: "indent", - group: { - id: "indentation", - index: 0, - }, + followLink: { + name: "Follow link", + defaultSpokenForm: "follow", + group: { id: "navigation", index: 7 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Indent line containing ${VAR_TARGET}.`, - cheatsheet: "Indent line", + description: `Follow link at ${VAR_TARGET}.`, + cheatsheet: "Follow link", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Indents the line containing the ${TARGET_DESC}.`, + description: `Opens the link containing the ${TARGET_DESC}.`, }, ], }, - outdentLine: { - name: "Outdent line", - defaultSpokenForm: "dedent", - group: { - id: "indentation", - index: 1, - }, + followLinkAside: { + name: "Follow link aside", + defaultSpokenForm: "follow split", + group: { id: "navigation", index: 8 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Outdent line containing ${VAR_TARGET}.`, - cheatsheet: "Outdent line", + description: `Follow link at ${VAR_TARGET} aside (e.g. in a split view).`, + cheatsheet: "Follow link aside", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Decreases the indentation of the line containing the ${TARGET_DESC}.`, + description: `Opens the link containing the ${TARGET_DESC} in a split view.`, }, ], }, - insertCopyAfter: { - name: "Insert copy after", - defaultSpokenForm: "clone", - group: { - id: "clone", - index: 0, - }, + showDebugHover: { + name: "Show debug hover", + defaultSpokenForm: "inspect", + group: { id: "navigation", index: 9 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Insert copy after ${VAR_TARGET}.`, - cheatsheet: "Insert copy after", + description: `Show debug hover for ${VAR_TARGET}.`, + cheatsheet: "Show debug hover", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, - description: `Inserts a copy of the function containing the ${TARGET_DESC} after itself.`, + command: DEFAULT_COMMAND, + description: `Shows debug information for the ${TARGET_DESC}.`, }, ], }, - insertCopyBefore: { - name: "Insert copy before", - defaultSpokenForm: "clone up", - group: { - id: "clone", - index: 1, - }, + + // Group: folding + foldRegion: { + name: "Fold region", + defaultSpokenForm: "fold", + group: { id: "folding", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Insert copy before ${VAR_TARGET}.`, - cheatsheet: "Insert copy before", + description: `Fold region at ${VAR_TARGET}.`, + cheatsheet: "Fold region", }, ], examples: [ { command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, - description: `Inserts a copy of the function containing the ${TARGET_DESC} before itself.`, + description: `Folds the function containing the ${TARGET_DESC}.`, }, ], }, - joinLines: { - name: "Join lines", - defaultSpokenForm: "join", - group: { - id: "join", - index: 0, - }, + unfoldRegion: { + name: "Unfold region", + defaultSpokenForm: "unfold", + group: { id: "folding", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Join lines at ${VAR_TARGET}.`, - cheatsheet: "Join lines", + description: `Unfold region at ${VAR_TARGET}.`, + cheatsheet: "Unfold region", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Joins the line containing the ${TARGET_DESC} with the following line.`, + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Unfolds the function containing the ${TARGET_DESC}.`, }, ], }, - reverseTargets: { - name: "Reverse targets", - defaultSpokenForm: "reverse", - group: { - id: "reorder", - index: 0, - }, + + // Group: extract + extractVariable: { + name: "Extract variable", + defaultSpokenForm: "extract", + group: { id: "extract", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Reverse ${VAR_TARGET}s.`, - cheatsheet: "Reverse targets", + description: `Extract variable from ${VAR_TARGET}.`, + cheatsheet: "Extract variable", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, - description: `Reverses the collection items associated with the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${VALUE} ${TARGET}`, + description: `Extracts the value containing the ${TARGET_DESC} into a variable.`, }, ], }, - randomizeTargets: { - name: "Randomize targets", - defaultSpokenForm: "shuffle", - group: { - id: "reorder", - index: 1, - }, + + // Group: join + joinLines: { + name: "Join lines", + defaultSpokenForm: "join", + group: { id: "join", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Randomize ${VAR_TARGET}s.`, - cheatsheet: "Randomize targets", + description: `Join lines at ${VAR_TARGET}.`, + cheatsheet: "Join lines", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, - description: `Randomizes the collection items associated with the ${TARGET_DESC}.`, - }, - ], - }, - sortTargets: { - name: "Sort targets", - defaultSpokenForm: "sort", - group: { - id: "reorder", - index: 2, - }, - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: `Sort ${VAR_TARGET}s.`, - cheatsheet: "Sort targets", - }, - ], - examples: [ - { - command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, - description: `Sorts the collection items associated with the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Joins the line containing the ${TARGET_DESC} with the following line.`, }, ], }, - rename: { - name: "Rename", - defaultSpokenForm: "rename", - group: { - id: "rename", - index: 0, - }, + + // Group: break + breakLine: { + name: "Break line", + defaultSpokenForm: "break", + group: { id: "break", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Rename ${VAR_TARGET}.`, - cheatsheet: "Rename", + description: `Breaks the line before ${VAR_TARGET}.`, + cheatsheet: "Breaks the line", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Starts renaming the ${TARGET_DESC}.`, + description: `Breaks the line before the ${TARGET_DESC}.`, }, ], }, - scrollToTop: { - name: "Scroll to top", - defaultSpokenForm: "crown", - group: { - id: "scroll", - index: 0, - }, + + // Group: visual + flashTargets: { + name: "Flash target", + defaultSpokenForm: "flash", + group: { id: "visual", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Scroll ${VAR_TARGET} to top of the viewport.`, - cheatsheet: "Scroll to top", + description: `Flash ${VAR_TARGET}.`, + cheatsheet: "Flash target", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Scrolls the ${TARGET_DESC} to the top of the viewport.`, + description: `Briefly flashes the ${TARGET_DESC}.`, }, ], }, - scrollToCenter: { - name: "Scroll to center", - defaultSpokenForm: "center", - group: { - id: "scroll", - index: 1, - }, + highlight: { + name: "Highlight", + defaultSpokenForm: "highlight", + group: { id: "visual", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Scroll ${VAR_TARGET} to center of the viewport.`, - cheatsheet: "Scroll to center", + description: `Highlight ${VAR_TARGET}.`, + cheatsheet: "Highlight", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Scrolls the ${TARGET_DESC} to the center of the viewport.`, + description: `Highlights the ${TARGET_DESC}.`, }, ], }, - scrollToBottom: { - name: "Scroll to bottom", - defaultSpokenForm: "bottom", - group: { - id: "scroll", - index: 2, - }, + + // Group: snippets + generateSnippet: { + name: "Generate snippet", + defaultSpokenForm: "snip make", + group: { id: "snippets", index: 0 }, + legacySpokenForms: ["snippet make"], syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Scroll ${VAR_TARGET} to bottom of the viewport.`, - cheatsheet: "Scroll to bottom", + description: `Generate snippet from ${VAR_TARGET}.`, + cheatsheet: "Generate snippet", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Scrolls the ${TARGET_DESC} to the bottom of the viewport.`, + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Generates a snippet from the function containing the ${TARGET_DESC}.`, }, ], }, - applyFormatter: { - name: "Apply formatter", - defaultSpokenForm: "format", - group: { - id: "editor", - index: 0, - }, + insertSnippet: { + name: "Insert snippet", + defaultSpokenForm: "snip", + group: { id: "snippets", index: 1 }, syntaxes: [ { - pattern: `${VAR_SPOKEN_FORM} ${VAR_FORMATTER} ${AT} ${VAR_TARGET}`, - description: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}.`, - cheatsheet: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}`, + pattern: `${VAR_SPOKEN_FORM} ${VAR_SNIPPET} ${VAR_DESTINATION}`, + description: `Insert snippet at ${VAR_DESTINATION}.`, + cheatsheet: `Insert snippet at ${VAR_DESTINATION}`, }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${FORMATTER_CAMEL} ${AT} ${TARGET}`, - description: `Reformats the ${TARGET_DESC} as camel case.`, + command: `${VAR_SPOKEN_FORM} ${SNIPPET_IF} ${AFTER} ${TARGET}`, + description: `Inserts an if-statement snippet after the ${TARGET_DESC}.`, }, ], }, - toggleLineComment: { - name: "Toggle line comment", - defaultSpokenForm: "comment", - group: { - id: "editor", - index: 1, - }, + + // Group: git + gitAccept: { + name: "Git accept", + defaultSpokenForm: "git accept", + group: { id: "git", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Toggle line comment at ${VAR_TARGET}.`, - cheatsheet: "Toggle line comment", + description: `Accept Git change at ${VAR_TARGET}.`, + cheatsheet: "Git accept", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Toggles the comment on the line containing the ${TARGET_DESC}.`, + description: `Accepts the Git change on the line containing the ${TARGET_DESC}.`, }, ], }, - toggleLineBreakpoint: { - name: "Toggle line/scope breakpoint", - defaultSpokenForm: "break point", - group: { - id: "editor", - index: 2, - }, - description: "Scope defaults to line.", + gitRevert: { + name: "Git revert", + defaultSpokenForm: "git revert", + group: { id: "git", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Toggle breakpoint on line containing ${VAR_TARGET}.`, - cheatsheet: "Toggle line breakpoint", - }, - { - pattern: `${VAR_SPOKEN_FORM} ${TOKEN} ${VAR_TARGET}`, - description: `Toggle inline breakpoint at ${VAR_TARGET}.`, - cheatsheet: "Toggle inline breakpoint", + description: `Revert Git change at ${VAR_TARGET}.`, + cheatsheet: "Git revert", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Toggles a breakpoint on the line containing the ${TARGET_DESC}.`, - }, - { - command: `${VAR_SPOKEN_FORM} ${TOKEN} ${TARGET}`, - description: `Toggles an inline breakpoint at the ${TARGET_DESC}.`, + description: `Reverts the Git change on the line containing the ${TARGET_DESC}.`, }, ], }, - replaceWithTarget: { - name: "Replace with target", - defaultSpokenForm: "bring", - group: { - id: "insert", - index: 0, - }, + gitStage: { + name: "Git stage", + defaultSpokenForm: "git stage", + group: { id: "git", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Insert copy of ${VAR_TARGET} at selection.`, - cheatsheet: `Insert copy of ${VAR_TARGET} at selection`, - }, - { - pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET} ${VAR_DESTINATION}`, - description: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}.`, - cheatsheet: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}`, + description: `Stage Git change at ${VAR_TARGET}.`, + cheatsheet: "Git stage", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Inserts a copy of the ${TARGET_DESC} at the current selection.`, - }, - { - command: `${VAR_SPOKEN_FORM} ${TARGET} ${TO} ${TARGET_2}`, - description: `Replaces the ${TARGET_2_DESC} with a copy of the ${TARGET_DESC}.`, + description: `Stages the Git change on the line containing the ${TARGET_DESC}.`, }, ], }, - callAsFunction: { - name: "Call as function", - defaultSpokenForm: "call", - group: { - id: "insert", - index: 1, - }, + gitUnstage: { + name: "Git unstage", + defaultSpokenForm: "git unstage", + group: { id: "git", index: 3 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Insert call to ${VAR_TARGET} on selection.`, - cheatsheet: `Insert call to ${VAR_TARGET} on selection`, - }, - { - pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET_1} ${ON} ${VAR_TARGET_2}`, - description: `Insert call to ${VAR_TARGET_1} on ${VAR_TARGET_2}.`, - cheatsheet: `Insert call to ${VAR_TARGET_1} on ${VAR_TARGET_2}`, + description: `Unstage Git change at ${VAR_TARGET}.`, + cheatsheet: "Git unstage", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Inserts a call to the ${TARGET_DESC} at the current selection.`, - }, - { - command: `${VAR_SPOKEN_FORM} ${TARGET} ${ON} ${TARGET_2}`, - description: `Inserts a call to the ${TARGET_DESC} on the ${TARGET_2_DESC}.`, - }, - ], - }, - generateSnippet: { - name: "Generate snippet", - defaultSpokenForm: "snip make", - group: { - id: "snippets", - index: 0, - }, - legacySpokenForms: ["snippet make"], - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: `Generate snippet from ${VAR_TARGET}.`, - cheatsheet: "Generate snippet", - }, - ], - examples: [ - { - command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, - description: `Generates a snippet from the function containing the ${TARGET_DESC}.`, + description: `Unstages the Git change on the line containing the ${TARGET_DESC}.`, }, ], }, - insertSnippet: { - name: "Insert snippet", - defaultSpokenForm: "snip", - group: { - id: "snippets", - index: 1, - }, + + // Group: editor + applyFormatter: { + name: "Apply formatter", + defaultSpokenForm: "format", + group: { id: "editor", index: 0 }, syntaxes: [ { - pattern: `${VAR_SPOKEN_FORM} ${VAR_SNIPPET} ${VAR_DESTINATION}`, - description: `Insert snippet at ${VAR_DESTINATION}.`, - cheatsheet: `Insert snippet at ${VAR_DESTINATION}`, + pattern: `${VAR_SPOKEN_FORM} ${VAR_FORMATTER} ${AT} ${VAR_TARGET}`, + description: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}.`, + cheatsheet: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}`, }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${SNIPPET_IF} ${AFTER} ${TARGET}`, - description: `Inserts an if-statement snippet after the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${FORMATTER_CAMEL} ${AT} ${TARGET}`, + description: `Reformats the ${TARGET_DESC} as camel case.`, }, ], }, - moveToTarget: { - name: "Move to target", - defaultSpokenForm: "move", - group: { - id: "move", - index: 0, - }, + toggleLineComment: { + name: "Toggle line comment", + defaultSpokenForm: "comment", + group: { id: "editor", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Move ${VAR_TARGET} to selection.`, - cheatsheet: `Move ${VAR_TARGET} to selection`, - }, - { - pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET} ${VAR_DESTINATION}`, - description: `Move ${VAR_TARGET} to ${VAR_DESTINATION}.`, - cheatsheet: `Move ${VAR_TARGET} to ${VAR_DESTINATION}`, + description: `Toggle line comment at ${VAR_TARGET}.`, + cheatsheet: "Toggle line comment", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Moves the ${TARGET_DESC} to the current selection.`, - }, - { - command: `${VAR_SPOKEN_FORM} ${TARGET} ${AFTER} ${TARGET_2}`, - description: `Moves the ${TARGET_DESC} to after the ${TARGET_2_DESC}.`, - }, - ], - }, - wrapWithPairedDelimiter: { - name: "Wrap with paired delimiter/snippet", - defaultSpokenForm: "wrap", - group: { - id: "wrap", - index: 0, - }, - syntaxes: [ - { - pattern: `${VAR_PAIR} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, - description: `Wrap ${VAR_TARGET} with ${VAR_PAIR}.`, - cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_PAIR}`, - }, - { - pattern: `${VAR_SNIPPET} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, - description: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}.`, - cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}`, - }, - ], - examples: [ - { - command: `${SQUARE} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Wraps the ${TARGET_DESC} in square brackets.`, - }, - { - command: `${SNIPPET_IF} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Wraps the ${TARGET_DESC} in an if-statement snippet.`, - }, - ], - }, - rewrapWithPairedDelimiter: { - name: "Rewrap with paired delimiter", - defaultSpokenForm: "repack", - group: { - id: "wrap", - index: 1, - }, - syntaxes: [ - { - pattern: `${VAR_PAIR} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, - description: `Rewrap ${VAR_TARGET} with ${VAR_PAIR}.`, - cheatsheet: `Rewrap ${VAR_TARGET} with ${VAR_PAIR}`, - }, - ], - examples: [ - { - command: `${CURLY} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Replaces the paired delimiters around the ${TARGET_DESC} with curly brackets.`, + description: `Toggles the comment on the line containing the ${TARGET_DESC}.`, }, ], }, - swapTargets: { - name: "Swap targets", - defaultSpokenForm: "swap", - group: { - id: "swap", - index: 0, - }, + toggleLineBreakpoint: { + name: "Toggle line/scope breakpoint", + defaultSpokenForm: "break point", + group: { id: "editor", index: 2 }, + description: "Scope defaults to line.", syntaxes: [ { - pattern: `${VAR_SPOKEN_FORM} ${WITH} ${VAR_TARGET}`, - description: `Swap selection with ${VAR_TARGET}.`, - cheatsheet: `Swap selection with ${VAR_TARGET}`, + pattern: DEFAULT_PATTERN, + description: `Toggle breakpoint on line containing ${VAR_TARGET}.`, + cheatsheet: "Toggle line breakpoint", }, { - pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET_1} ${WITH} ${VAR_TARGET_2}`, - description: `Swap ${VAR_TARGET_1} with ${VAR_TARGET_2}.`, - cheatsheet: `Swap ${VAR_TARGET_1} with ${VAR_TARGET_2}`, + pattern: `${VAR_SPOKEN_FORM} ${TOKEN} ${VAR_TARGET}`, + description: `Toggle inline breakpoint at ${VAR_TARGET}.`, + cheatsheet: "Toggle inline breakpoint", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${WITH} ${TARGET}`, - description: `Swaps the current selection with the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Toggles a breakpoint on the line containing the ${TARGET_DESC}.`, }, { - command: `${VAR_SPOKEN_FORM} ${TARGET} ${WITH} ${TARGET_2}`, - description: `Swaps the ${TARGET_DESC} and the ${TARGET_2_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${TOKEN} ${TARGET}`, + description: `Toggles an inline breakpoint at the ${TARGET_DESC}.`, }, ], }, - nextHomophone: { - name: "Next homophone", - defaultSpokenForm: "phones", - group: { - id: "homophones", - index: 0, - }, + + // Group: targetContext + "experimental.setInstanceReference": { + name: "Set instance reference", + defaultSpokenForm: "from", + group: { id: "targetContext", index: 0 }, + description: + "Sets the instance reference for the next 'instance of' action.", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Cycle to next homophone for ${VAR_TARGET}.`, - cheatsheet: "Cycle to next homophone", + description: `Set instance reference to ${VAR_TARGET}.`, + cheatsheet: "Set instance reference", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Replaces the ${TARGET_DESC} with its next homophone.`, + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET} ${SET_SELECTION} ${EVERY} ${INSTANCE} ${TARGET_2}`, + description: `Selects every instance of the ${TARGET_2_DESC} within the function containing the ${TARGET_DESC}.`, }, ], }, - // Private actions -------------------- - + // Group: private "private.showParseTree": { name: "Show parse tree", defaultSpokenForm: "parse tree", - group: { - id: "private", - index: 0, - }, + group: { id: "private", index: 0 }, private: true, syntaxes: [ { @@ -1513,20 +1366,14 @@ export const actionReferences = { name: "Parsed", defaultSpokenForm: "parsed", private: true, - group: { - id: "private", - index: 1, - }, + group: { id: "private", index: 1 }, syntaxes: [], examples: [], }, "private.getTargets": { name: "Get targets", defaultSpokenForm: "get targets", - group: { - id: "private", - index: 2, - }, + group: { id: "private", index: 2 }, private: true, syntaxes: [], examples: [], @@ -1534,10 +1381,7 @@ export const actionReferences = { "private.setKeyboardTarget": { name: "Set keyboard target", defaultSpokenForm: "set keyboard target", - group: { - id: "private", - index: 3, - }, + group: { id: "private", index: 3 }, private: true, syntaxes: [], examples: [], @@ -1545,10 +1389,7 @@ export const actionReferences = { executeCommand: { name: "Execute command", defaultSpokenForm: "execute command", - group: { - id: "private", - index: 4, - }, + group: { id: "private", index: 4 }, private: true, syntaxes: [], examples: [], @@ -1556,10 +1397,7 @@ export const actionReferences = { editNew: { name: "Edit new", defaultSpokenForm: "edit new", - group: { - id: "private", - index: 5, - }, + group: { id: "private", index: 5 }, private: true, syntaxes: [], examples: [], @@ -1567,10 +1405,7 @@ export const actionReferences = { getText: { name: "Get text", defaultSpokenForm: "get text", - group: { - id: "private", - index: 6, - }, + group: { id: "private", index: 6 }, private: true, syntaxes: [], examples: [], @@ -1578,10 +1413,7 @@ export const actionReferences = { replace: { name: "Replace", defaultSpokenForm: "replace", - group: { - id: "private", - index: 7, - }, + group: { id: "private", index: 7 }, private: true, syntaxes: [], examples: [], @@ -1589,15 +1421,12 @@ export const actionReferences = { wrapWithSnippet: { name: "Wrap with snippet", defaultSpokenForm: "wrap", - group: { - id: "private", - index: 8, - }, + group: { id: "private", index: 8 }, private: true, syntaxes: [], examples: [], }, } as const satisfies Record< ActionType | TalonSideActionType, - ActionReferenceEntry + ReferenceEntry >; diff --git a/packages/lib-common/src/references/index.ts b/packages/lib-common/src/references/index.ts index e6625c1858..514298b5ae 100644 --- a/packages/lib-common/src/references/index.ts +++ b/packages/lib-common/src/references/index.ts @@ -1,10 +1,12 @@ -export * from "./actionReferences"; export * from "./actionReferenceGroups"; -export * from "./spokenForms/connectiveDefaultSpokenForms"; -export * from "./spokenForms/graphemeDefaultSpokenForms"; -export * from "./spokenForms/markDefaultSpokenForms"; -export * from "./spokenForms/numberDefaultSpokenForms"; +export * from "./actionReferences"; +export * from "./modifierReferenceGroups"; export * from "./modifierReferences"; export * from "./pairedDelimiterReferences"; export * from "./ReferenceEntry"; +export * from "./scopeReferenceGroups"; export * from "./scopeReferences"; +export * from "./spokenForms/connectiveDefaultSpokenForms"; +export * from "./spokenForms/graphemeDefaultSpokenForms"; +export * from "./spokenForms/markDefaultSpokenForms"; +export * from "./spokenForms/numberDefaultSpokenForms"; diff --git a/packages/lib-common/src/references/modifierReferenceGroups.ts b/packages/lib-common/src/references/modifierReferenceGroups.ts new file mode 100644 index 0000000000..345ba069b0 --- /dev/null +++ b/packages/lib-common/src/references/modifierReferenceGroups.ts @@ -0,0 +1,38 @@ +import type { ReferenceGroup } from "./ReferenceEntry"; + +export type ModifierReferenceGroupId = + | "position" + | "delimiters" + | "scope" + | "range" + | "filters" + | "inference" + | "private"; + +export const modifierReferenceGroups: ReferenceGroup[] = + [ + { + id: "position", + name: "Positions", + }, + { + id: "delimiters", + name: "Interiors and delimiters", + }, + { + id: "scope", + name: "Scope navigation", + }, + { + id: "range", + name: "Range extension", + }, + { + id: "filters", + name: "Filters", + }, + { + id: "inference", + name: "Inference", + }, + ]; diff --git a/packages/lib-common/src/references/modifierReferences.ts b/packages/lib-common/src/references/modifierReferences.ts index 707cb70032..4c080ffec7 100644 --- a/packages/lib-common/src/references/modifierReferences.ts +++ b/packages/lib-common/src/references/modifierReferences.ts @@ -14,6 +14,7 @@ import { VAR_SCOPE, VAR_SPOKEN_FORM, } from "./constants"; +import type { ModifierReferenceGroupId } from "./modifierReferenceGroups"; import { pairedDelimiterReferences } from "./pairedDelimiterReferences"; import type { ReferenceEntry } from "./ReferenceEntry"; import { connectiveDefaultSpokenForms } from "./spokenForms/connectiveDefaultSpokenForms"; @@ -35,9 +36,11 @@ const LAST = connectiveDefaultSpokenForms.last; type AdditionalModifierReferenceType = "ancestor"; export const modifierReferences = { + // Group: position startOf: { name: "Start of", defaultSpokenForm: "start of", + group: { id: "position", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -55,6 +58,7 @@ export const modifierReferences = { endOf: { name: "End of", defaultSpokenForm: "end of", + group: { id: "position", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -69,9 +73,12 @@ export const modifierReferences = { }, ], }, + + // Group: delimiters interiorOnly: { name: "Interior only", defaultSpokenForm: "inside", + group: { id: "delimiters", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -89,6 +96,7 @@ export const modifierReferences = { excludeInterior: { name: "Exclude interior", defaultSpokenForm: "bounds", + group: { id: "delimiters", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -103,26 +111,47 @@ export const modifierReferences = { }, ], }, - visible: { - name: "Visible", - defaultSpokenForm: "visible", + leading: { + name: "Leading", + defaultSpokenForm: "leading", + group: { id: "delimiters", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Visible in viewport.", - cheatsheet: "Visible in viewport", + description: "Leading delimiter range.", + cheatsheet: "Leading delimiter range", }, ], examples: [ { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM}`, - description: - "Selects the content currently visible in the editor viewport.", + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, + description: `Selects the leading delimiter of the item containing the ${TARGET_DESC}.`, + }, + ], + }, + trailing: { + name: "Trailing", + defaultSpokenForm: "trailing", + group: { id: "delimiters", index: 3 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: "Trailing delimiter range.", + cheatsheet: "Trailing delimiter range", + }, + ], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, + description: `Selects the trailing delimiter of the item containing the ${TARGET_DESC}.`, }, ], }, + + // Group: scope containingScope: { name: "Containing scope", + group: { id: "scope", index: 0 }, syntaxes: [ { pattern: VAR_SCOPE, @@ -140,6 +169,7 @@ export const modifierReferences = { everyScope: { name: "Every scope", defaultSpokenForm: EVERY, + group: { id: "scope", index: 1 }, syntaxes: [ { pattern: `${VAR_SPOKEN_FORM} ${VAR_SCOPE}`, @@ -157,6 +187,7 @@ export const modifierReferences = { ancestor: { name: "Ancestor", defaultSpokenForm: "grand", + group: { id: "scope", index: 2 }, syntaxes: [ { pattern: `${VAR_SPOKEN_FORM} ${VAR_SCOPE}`, @@ -173,6 +204,7 @@ export const modifierReferences = { }, ordinalScope: { name: "Ordinal scope", + group: { id: "scope", index: 3 }, syntaxes: [ { pattern: `${VAR_ORDINAL} ${VAR_SCOPE}`, @@ -239,6 +271,7 @@ export const modifierReferences = { }, relativeScope: { name: "Relative scope", + group: { id: "scope", index: 4 }, syntaxes: [ { pattern: `${PREVIOUS} ${VAR_SCOPE}`, @@ -370,9 +403,12 @@ export const modifierReferences = { }, ], }, + + // Group: range extendThroughStartOf: { name: "Extend through start of", defaultSpokenForm: "head", + group: { id: "range", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -399,6 +435,7 @@ export const modifierReferences = { extendThroughEndOf: { name: "Extend through end of", defaultSpokenForm: "tail", + group: { id: "range", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -422,60 +459,31 @@ export const modifierReferences = { }, ], }, - leading: { - name: "Leading", - defaultSpokenForm: "leading", - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: "Leading delimiter range.", - cheatsheet: "Leading delimiter range", - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, - description: `Selects the leading delimiter of the item containing the ${TARGET_DESC}.`, - }, - ], - }, - trailing: { - name: "Trailing", - defaultSpokenForm: "trailing", - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: "Trailing delimiter range.", - cheatsheet: "Trailing delimiter range", - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, - description: `Selects the trailing delimiter of the item containing the ${TARGET_DESC}.`, - }, - ], - }, - toRawSelection: { - name: "Raw selection", - defaultSpokenForm: "just", + + // Group: filters + visible: { + name: "Visible", + defaultSpokenForm: "visible", + group: { id: "filters", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "No inference.", - cheatsheet: "No inference", + description: "Visible in viewport.", + cheatsheet: "Visible in viewport", }, ], examples: [ { - command: `${REMOVE} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Deletes only the ${TARGET_DESC}, leaving adjacent whitespace unchanged.`, + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM}`, + description: + "Selects the content currently visible in the editor viewport.", }, ], }, keepContentFilter: { name: "Keep content filter", defaultSpokenForm: "content", + group: { id: "filters", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -494,6 +502,7 @@ export const modifierReferences = { keepEmptyFilter: { name: "Keep empty filter", defaultSpokenForm: "empty", + group: { id: "filters", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -509,9 +518,30 @@ export const modifierReferences = { }, ], }, + + // Group: inference + toRawSelection: { + name: "Raw selection", + defaultSpokenForm: "just", + group: { id: "inference", index: 0 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: "No inference.", + cheatsheet: "No inference", + }, + ], + examples: [ + { + command: `${REMOVE} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Deletes only the ${TARGET_DESC}, leaving adjacent whitespace unchanged.`, + }, + ], + }, inferPreviousMark: { name: "Infer previous mark", defaultSpokenForm: "its", + group: { id: "inference", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -527,10 +557,11 @@ export const modifierReferences = { ], }, - // Private modifiers, but that has spoken forms + // Group: private preferredScope: { name: "Preferred scope", private: true, + group: { id: "private", index: 0 }, syntaxes: [ { pattern: VAR_SCOPE, @@ -545,27 +576,28 @@ export const modifierReferences = { }, ], }, - - // Modifiers without spoken forms modifyIfUntyped: { name: "Modify if untyped", private: true, + group: { id: "private", index: 1 }, syntaxes: [], examples: [], }, fallback: { name: "Fallback", private: true, + group: { id: "private", index: 2 }, syntaxes: [], examples: [], }, range: { name: "Range", private: true, + group: { id: "private", index: 3 }, syntaxes: [], examples: [], }, } as const satisfies Record< ModifierType | AdditionalModifierReferenceType, - ReferenceEntry + ReferenceEntry >; diff --git a/packages/lib-common/src/references/scopeReferenceGroups.ts b/packages/lib-common/src/references/scopeReferenceGroups.ts new file mode 100644 index 0000000000..d7e65a624c --- /dev/null +++ b/packages/lib-common/src/references/scopeReferenceGroups.ts @@ -0,0 +1,52 @@ +import type { ReferenceGroup } from "./ReferenceEntry"; + +export type ScopeReferenceGroupId = + | "tokens" + | "text" + | "functions" + | "objects" + | "collections" + | "statements" + | "markup" + | "documentStructure" + | "delimiters" + | "private"; + +export const scopeReferenceGroups: ReferenceGroup[] = [ + { + id: "tokens", + name: "Characters and tokens", + }, + { + id: "text", + name: "Lines and documents", + }, + { + id: "functions", + name: "Functions and calls", + }, + { + id: "objects", + name: "Classes and objects", + }, + { + id: "collections", + name: "Collections", + }, + { + id: "statements", + name: "Statements and expressions", + }, + { + id: "markup", + name: "Markup", + }, + { + id: "documentStructure", + name: "Document structure", + }, + { + id: "delimiters", + name: "Paired delimiters", + }, +]; diff --git a/packages/lib-common/src/references/scopeReferences.ts b/packages/lib-common/src/references/scopeReferences.ts index 8db034e79e..9faca99800 100644 --- a/packages/lib-common/src/references/scopeReferences.ts +++ b/packages/lib-common/src/references/scopeReferences.ts @@ -13,6 +13,7 @@ import { } from "./constants"; import { pairedDelimiterReferences } from "./pairedDelimiterReferences"; import type { ReferenceEntry } from "./ReferenceEntry"; +import type { ScopeReferenceGroupId } from "./scopeReferenceGroups"; import { connectiveDefaultSpokenForms } from "./spokenForms/connectiveDefaultSpokenForms"; import { graphemeDefaultSpokenForms } from "./spokenForms/graphemeDefaultSpokenForms"; @@ -24,1038 +25,1115 @@ const NEXT = connectiveDefaultSpokenForms.next; const FIRST = connectiveDefaultSpokenForms.first; export const scopeReferences = { - argumentOrParameter: { - name: "Argument or parameter", - defaultSpokenForm: "arg", + // Group: tokens + character: { + name: "Character", + group: { id: "tokens", index: 0 }, + defaultSpokenForm: "char", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Argument.", - cheatsheet: "Argument", + description: "Character.", + cheatsheet: "Character", }, ], examples: [ { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the argument or parameter containing the ${TARGET_DESC}.`, + command: `${SET_SELECTION} ${FIRST} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the first character in the ${TARGET_DESC}.`, }, ], }, - argumentList: { - name: "Argument list", - defaultSpokenForm: "arg list", + word: { + name: "Sub token word", + group: { id: "tokens", index: 1 }, + defaultSpokenForm: "sub", + legacySpokenForms: ["word"], syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Argument list.", - cheatsheet: "Argument list", + description: "Sub token word.", + cheatsheet: "Sub token word", }, ], examples: [ { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the argument list containing the ${TARGET_DESC}.`, + command: `${SET_SELECTION} ${FIRST} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the first sub token word in the ${TARGET_DESC}.`, }, ], }, - anonymousFunction: { - name: "Anonymous function", - defaultSpokenForm: "lambda", + token: { + name: "Token", + group: { id: "tokens", index: 2 }, + defaultSpokenForm: "token", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Anonymous function.", - cheatsheet: "Anonymous function", + description: "Token.", + cheatsheet: "Token", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the anonymous function containing the ${TARGET_DESC}.`, + description: `Selects the ${TARGET_DESC}.`, }, ], }, - attribute: { - name: "Attribute", - defaultSpokenForm: "attribute", + identifier: { + name: "Identifier", + group: { id: "tokens", index: 3 }, + defaultSpokenForm: "identifier", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Attribute.", - cheatsheet: "Attribute", + description: "Identifier.", + cheatsheet: "Identifier", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the attribute containing the ${TARGET_DESC}.`, + description: `Selects the identifier containing the ${TARGET_DESC}.`, }, ], }, - branch: { - name: "Branch", - defaultSpokenForm: "branch", + glyph: { + name: "Glyph", + group: { id: "tokens", index: 4 }, + defaultSpokenForm: "glyph", syntaxes: [ { - pattern: DEFAULT_PATTERN, - description: "Branch.", - cheatsheet: "Branch", + pattern: `${VAR_SPOKEN_FORM} ${VAR_CHARACTER}`, + description: `Instance of single character ${VAR_CHARACTER}.`, + cheatsheet: `Instance of single character ${VAR_CHARACTER}`, }, ], examples: [ { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the branch containing the ${TARGET_DESC}.`, + command: `${SET_SELECTION} ${NEXT} ${VAR_SPOKEN_FORM} ${AIR}`, + description: `Selects the next 'a'.`, }, ], }, - class: { - name: "Class", - defaultSpokenForm: "class", + nonWhitespaceSequence: { + name: "Non-whitespace sequence", + group: { id: "tokens", index: 5 }, + defaultSpokenForm: "paint", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Class.", - cheatsheet: "Class", + description: "Non-whitespace sequence.", + cheatsheet: "Non-whitespace sequence", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the class containing the ${TARGET_DESC}.`, + description: `Selects the non-whitespace sequence containing the ${TARGET_DESC}.`, }, ], }, - className: { - name: "Class name", - defaultSpokenForm: "class name", + boundedNonWhitespaceSequence: { + name: "Bounded non-whitespace sequence", + group: { id: "tokens", index: 6 }, + defaultSpokenForm: "short paint", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Class name.", - cheatsheet: "Class name", + description: + "Non-whitespace sequence bounded by surrounding pair delimiters.", + cheatsheet: + "Non-whitespace sequence bounded by surrounding pair delimiters", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the class name containing the ${TARGET_DESC}.`, + description: `Selects the bounded non-whitespace sequence containing the ${TARGET_DESC}.`, }, ], }, - collectionItem: { - name: "Collection item", - defaultSpokenForm: ITEM, + url: { + name: "URL", + group: { id: "tokens", index: 7 }, + defaultSpokenForm: "link", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Collection item.", - cheatsheet: "Collection item", + description: "URL.", + cheatsheet: "URL", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the collection item containing the ${TARGET_DESC}.`, + description: `Selects the url containing the ${TARGET_DESC}.`, }, ], }, - collectionKey: { - name: "Collection key", - defaultSpokenForm: "key", + regularExpression: { + name: "Regular expression", + group: { id: "tokens", index: 8 }, + defaultSpokenForm: "regex", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Collection key.", - cheatsheet: "Collection key", + description: "Regular expression.", + cheatsheet: "Regular expression", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the collection key containing the ${TARGET_DESC}.`, + description: `Selects the regular expression containing the ${TARGET_DESC}.`, }, ], }, - comment: { - name: "Comment", - defaultSpokenForm: "comment", + + // Group: text + line: { + name: "Line", + group: { id: "text", index: 0 }, + defaultSpokenForm: LINE, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Comment.", - cheatsheet: "Comment", + description: "Line.", + cheatsheet: "Line", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the comment containing the ${TARGET_DESC}.`, + description: `Selects the line containing the ${TARGET_DESC}.`, }, ], }, - functionCall: { - name: "Function call", - defaultSpokenForm: "call", + fullLine: { + name: "Full line", + group: { id: "text", index: 1 }, + defaultSpokenForm: "full line", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Function call.", - cheatsheet: "Function call", + description: "Full line.", + cheatsheet: "Full line", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the function call containing the ${TARGET_DESC}.`, + description: `Selects the full line containing the ${TARGET_DESC}.`, }, ], }, - functionCallee: { - name: "Function callee", - defaultSpokenForm: "callee", + sentence: { + name: "Sentence", + group: { id: "text", index: 2 }, + defaultSpokenForm: "sentence", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Function callee.", - cheatsheet: "Function callee", + description: "Sentence.", + cheatsheet: "Sentence", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the function callee containing the ${TARGET_DESC}.`, + description: `Selects the sentence containing the ${TARGET_DESC}.`, }, ], }, - functionName: { - name: "Function name", - defaultSpokenForm: "funk name", + paragraph: { + name: "Paragraph", + group: { id: "text", index: 3 }, + defaultSpokenForm: "block", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Function name.", - cheatsheet: "Function name", + description: "Paragraph.", + cheatsheet: "Paragraph", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the function name containing the ${TARGET_DESC}.`, + description: `Selects the paragraph containing the ${TARGET_DESC}.`, }, ], }, - ifStatement: { - name: "If statement", - defaultSpokenForm: "if state", + boundedParagraph: { + name: "Bounded paragraph", + group: { id: "text", index: 4 }, + defaultSpokenForm: "short block", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "If statement.", - cheatsheet: "If statement", + description: "Paragraph bounded by surrounding pair delimiters.", + cheatsheet: "Paragraph bounded by surrounding pair delimiters", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the if statement containing the ${TARGET_DESC}.`, + description: `Selects the bounded paragraph containing the ${TARGET_DESC}.`, }, ], }, - instance: { - name: "Instance", - defaultSpokenForm: "instance", + document: { + name: "Document", + group: { id: "text", index: 5 }, + defaultSpokenForm: "file", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Instance.", - cheatsheet: "Instance", + description: "Document.", + cheatsheet: "Document", }, ], examples: [ { - command: `${SET_SELECTION} ${EVERY} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects every instance of the ${TARGET_DESC}.`, + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the document containing the ${TARGET_DESC}.`, }, ], }, - list: { - name: "List", - defaultSpokenForm: "list", + notebookCell: { + name: "Notebook cell", + group: { id: "text", index: 6 }, + defaultSpokenForm: "cell", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "List.", - cheatsheet: "List", + description: "Notebook cell.", + cheatsheet: "Notebook cell", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the list containing the ${TARGET_DESC}.`, + description: `Selects the notebook cell containing the ${TARGET_DESC}.`, }, ], }, - map: { - name: "Map", - defaultSpokenForm: "map", + + // Group: functions + argumentOrParameter: { + name: "Argument or parameter", + group: { id: "functions", index: 0 }, + defaultSpokenForm: "arg", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Map.", - cheatsheet: "Map", + description: "Argument.", + cheatsheet: "Argument", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the map containing the ${TARGET_DESC}.`, + description: `Selects the argument or parameter containing the ${TARGET_DESC}.`, }, ], }, - name: { - name: "Name", - defaultSpokenForm: "name", + argumentList: { + name: "Argument list", + group: { id: "functions", index: 1 }, + defaultSpokenForm: "arg list", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Name.", - cheatsheet: "Name", + description: "Argument list.", + cheatsheet: "Argument list", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the name containing the ${TARGET_DESC}.`, + description: `Selects the argument list containing the ${TARGET_DESC}.`, }, ], }, - namedFunction: { - name: "Named function", - defaultSpokenForm: "funk", + anonymousFunction: { + name: "Anonymous function", + group: { id: "functions", index: 2 }, + defaultSpokenForm: "lambda", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Named function.", - cheatsheet: "Named function", + description: "Anonymous function.", + cheatsheet: "Anonymous function", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the named function containing the ${TARGET_DESC}.`, + description: `Selects the anonymous function containing the ${TARGET_DESC}.`, }, ], }, - regularExpression: { - name: "Regular expression", - defaultSpokenForm: "regex", + namedFunction: { + name: "Named function", + group: { id: "functions", index: 3 }, + defaultSpokenForm: "funk", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Regular expression.", - cheatsheet: "Regular expression", + description: "Named function.", + cheatsheet: "Named function", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the regular expression containing the ${TARGET_DESC}.`, + description: `Selects the named function containing the ${TARGET_DESC}.`, }, ], }, - statement: { - name: "Statement", - defaultSpokenForm: STATEMENT, + functionName: { + name: "Function name", + group: { id: "functions", index: 4 }, + defaultSpokenForm: "funk name", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Statement.", - cheatsheet: "Statement", + description: "Function name.", + cheatsheet: "Function name", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the statement containing the ${TARGET_DESC}.`, + description: `Selects the function name containing the ${TARGET_DESC}.`, }, ], }, - type: { - name: "Type", - defaultSpokenForm: "type", + functionCall: { + name: "Function call", + group: { id: "functions", index: 5 }, + defaultSpokenForm: "call", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Type.", - cheatsheet: "Type", + description: "Function call.", + cheatsheet: "Function call", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the type containing the ${TARGET_DESC}.`, + description: `Selects the function call containing the ${TARGET_DESC}.`, }, ], }, - value: { - name: "Value", - defaultSpokenForm: "value", + functionCallee: { + name: "Function callee", + group: { id: "functions", index: 6 }, + defaultSpokenForm: "callee", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Value.", - cheatsheet: "Value", + description: "Function callee.", + cheatsheet: "Function callee", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the value containing the ${TARGET_DESC}.`, + description: `Selects the function callee containing the ${TARGET_DESC}.`, }, ], }, - condition: { - name: "Condition", - defaultSpokenForm: "condition", + + // Group: objects + class: { + name: "Class", + group: { id: "objects", index: 0 }, + defaultSpokenForm: "class", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Condition.", - cheatsheet: "Condition", + description: "Class.", + cheatsheet: "Class", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the condition containing the ${TARGET_DESC}.`, + description: `Selects the class containing the ${TARGET_DESC}.`, }, ], }, - section: { - name: "Section", - defaultSpokenForm: "section", + className: { + name: "Class name", + group: { id: "objects", index: 1 }, + defaultSpokenForm: "class name", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section.", - cheatsheet: "Section", + description: "Class name.", + cheatsheet: "Class name", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section containing the ${TARGET_DESC}.`, + description: `Selects the class name containing the ${TARGET_DESC}.`, }, ], }, - sectionLevelOne: { - name: "Section level one", - defaultSpokenForm: "one section", - disabledByDefault: true, + instance: { + name: "Instance", + group: { id: "objects", index: 2 }, + defaultSpokenForm: "instance", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section level one.", - cheatsheet: "Section level one", + description: "Instance.", + cheatsheet: "Instance", }, ], examples: [ { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section level one containing the ${TARGET_DESC}.`, + command: `${SET_SELECTION} ${EVERY} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects every instance of the ${TARGET_DESC}.`, }, ], }, - sectionLevelTwo: { - name: "Section level two", - defaultSpokenForm: "two section", - disabledByDefault: true, + name: { + name: "Name", + group: { id: "objects", index: 3 }, + defaultSpokenForm: "name", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section level two.", - cheatsheet: "Section level two", + description: "Name.", + cheatsheet: "Name", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section level two containing the ${TARGET_DESC}.`, + description: `Selects the name containing the ${TARGET_DESC}.`, }, ], }, - sectionLevelThree: { - name: "Section level three", - defaultSpokenForm: "three section", - disabledByDefault: true, + attribute: { + name: "Attribute", + group: { id: "objects", index: 4 }, + defaultSpokenForm: "attribute", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section level three.", - cheatsheet: "Section level three", + description: "Attribute.", + cheatsheet: "Attribute", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section level three containing the ${TARGET_DESC}.`, + description: `Selects the attribute containing the ${TARGET_DESC}.`, }, ], }, - sectionLevelFour: { - name: "Section level four", - defaultSpokenForm: "four section", - disabledByDefault: true, + type: { + name: "Type", + group: { id: "objects", index: 5 }, + defaultSpokenForm: "type", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section level four.", - cheatsheet: "Section level four", + description: "Type.", + cheatsheet: "Type", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section level four containing the ${TARGET_DESC}.`, + description: `Selects the type containing the ${TARGET_DESC}.`, }, ], }, - sectionLevelFive: { - name: "Section level five", - defaultSpokenForm: "five section", - disabledByDefault: true, + value: { + name: "Value", + group: { id: "objects", index: 6 }, + defaultSpokenForm: "value", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section level five.", - cheatsheet: "Section level five", + description: "Value.", + cheatsheet: "Value", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section level five containing the ${TARGET_DESC}.`, + description: `Selects the value containing the ${TARGET_DESC}.`, }, ], }, - sectionLevelSix: { - name: "Section level six", - defaultSpokenForm: "six section", - disabledByDefault: true, + + // Group: collections + list: { + name: "List", + group: { id: "collections", index: 0 }, + defaultSpokenForm: "list", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section level six.", - cheatsheet: "Section level six", + description: "List.", + cheatsheet: "List", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section level six containing the ${TARGET_DESC}.`, + description: `Selects the list containing the ${TARGET_DESC}.`, }, ], }, - selector: { - name: "Selector", - defaultSpokenForm: "selector", + map: { + name: "Map", + group: { id: "collections", index: 1 }, + defaultSpokenForm: "map", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Selector.", - cheatsheet: "Selector", + description: "Map.", + cheatsheet: "Map", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the selector containing the ${TARGET_DESC}.`, + description: `Selects the map containing the ${TARGET_DESC}.`, }, ], }, - unit: { - name: "Unit", - defaultSpokenForm: "unit", + collectionItem: { + name: "Collection item", + group: { id: "collections", index: 2 }, + defaultSpokenForm: ITEM, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Unit.", - cheatsheet: "Unit", + description: "Collection item.", + cheatsheet: "Collection item", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the unit containing the ${TARGET_DESC}.`, + description: `Selects the collection item containing the ${TARGET_DESC}.`, }, ], }, - xmlBothTags: { - name: "XML both tags", - defaultSpokenForm: "tags", + collectionKey: { + name: "Collection key", + group: { id: "collections", index: 3 }, + defaultSpokenForm: "key", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "XML start and end tags.", - cheatsheet: "XML start and end tags", + description: "Collection key.", + cheatsheet: "Collection key", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects both tags of the XML element containing the ${TARGET_DESC}.`, + description: `Selects the collection key containing the ${TARGET_DESC}.`, }, ], }, - xmlElement: { - name: "XML element", - defaultSpokenForm: "element", + + // Group: statements + statement: { + name: "Statement", + group: { id: "statements", index: 0 }, + defaultSpokenForm: STATEMENT, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "XML element.", - cheatsheet: "XML element", + description: "Statement.", + cheatsheet: "Statement", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the XML element containing the ${TARGET_DESC}.`, + description: `Selects the statement containing the ${TARGET_DESC}.`, }, ], }, - xmlEndTag: { - name: "XML end tag", - defaultSpokenForm: "end tag", + branch: { + name: "Branch", + group: { id: "statements", index: 1 }, + defaultSpokenForm: "branch", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "XML end tag.", - cheatsheet: "XML end tag", + description: "Branch.", + cheatsheet: "Branch", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the XML end tag containing the ${TARGET_DESC}.`, + description: `Selects the branch containing the ${TARGET_DESC}.`, }, ], }, - xmlStartTag: { - name: "XML start tag", - defaultSpokenForm: "start tag", + ifStatement: { + name: "If statement", + group: { id: "statements", index: 2 }, + defaultSpokenForm: "if state", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "XML start tag.", - cheatsheet: "XML start tag", + description: "If statement.", + cheatsheet: "If statement", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the XML start tag containing the ${TARGET_DESC}.`, + description: `Selects the if statement containing the ${TARGET_DESC}.`, }, ], }, - part: { - name: "Part", - defaultSpokenForm: "part", + condition: { + name: "Condition", + group: { id: "statements", index: 3 }, + defaultSpokenForm: "condition", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Part.", - cheatsheet: "Part", + description: "Condition.", + cheatsheet: "Condition", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the part containing the ${TARGET_DESC}.`, + description: `Selects the condition containing the ${TARGET_DESC}.`, }, ], }, - chapter: { - name: "Chapter", - defaultSpokenForm: "chapter", + comment: { + name: "Comment", + group: { id: "statements", index: 4 }, + defaultSpokenForm: "comment", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Chapter.", - cheatsheet: "Chapter", + description: "Comment.", + cheatsheet: "Comment", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the chapter containing the ${TARGET_DESC}.`, + description: `Selects the comment containing the ${TARGET_DESC}.`, }, ], }, - subSection: { - name: "Subsection", - defaultSpokenForm: "subsection", + command: { + name: "Command", + group: { id: "statements", index: 5 }, + defaultSpokenForm: "command", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Subsection.", - cheatsheet: "Subsection", + description: "Command.", + cheatsheet: "Command", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the subsection containing the ${TARGET_DESC}.`, + description: `Selects the command containing the ${TARGET_DESC}.`, }, ], }, - subSubSection: { - name: "Subsubsection", - defaultSpokenForm: "subsubsection", + + // Group: markup + xmlElement: { + name: "XML element", + group: { id: "markup", index: 0 }, + defaultSpokenForm: "element", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Subsubsection.", - cheatsheet: "Subsubsection", + description: "XML element.", + cheatsheet: "XML element", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the subsubsection containing the ${TARGET_DESC}.`, + description: `Selects the XML element containing the ${TARGET_DESC}.`, }, ], }, - namedParagraph: { - name: "Named paragraph", - defaultSpokenForm: "paragraph", + xmlStartTag: { + name: "XML start tag", + group: { id: "markup", index: 1 }, + defaultSpokenForm: "start tag", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Named paragraph.", - cheatsheet: "Named paragraph", + description: "XML start tag.", + cheatsheet: "XML start tag", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the named paragraph containing the ${TARGET_DESC}.`, + description: `Selects the XML start tag containing the ${TARGET_DESC}.`, }, ], }, - subParagraph: { - name: "Subparagraph", - defaultSpokenForm: "subparagraph", + xmlEndTag: { + name: "XML end tag", + group: { id: "markup", index: 2 }, + defaultSpokenForm: "end tag", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Subparagraph.", - cheatsheet: "Subparagraph", + description: "XML end tag.", + cheatsheet: "XML end tag", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the subparagraph containing the ${TARGET_DESC}.`, + description: `Selects the XML end tag containing the ${TARGET_DESC}.`, }, ], }, - environment: { - name: "Environment", - defaultSpokenForm: "environment", + xmlBothTags: { + name: "XML both tags", + group: { id: "markup", index: 3 }, + defaultSpokenForm: "tags", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Environment.", - cheatsheet: "Environment", + description: "XML start and end tags.", + cheatsheet: "XML start and end tags", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the environment containing the ${TARGET_DESC}.`, + description: `Selects both tags of the XML element containing the ${TARGET_DESC}.`, }, ], }, - character: { - name: "Character", - defaultSpokenForm: "char", + selector: { + name: "Selector", + group: { id: "markup", index: 4 }, + defaultSpokenForm: "selector", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Character.", - cheatsheet: "Character", + description: "Selector.", + cheatsheet: "Selector", }, ], examples: [ { - command: `${SET_SELECTION} ${FIRST} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the first character in the ${TARGET_DESC}.`, + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the selector containing the ${TARGET_DESC}.`, }, ], }, - word: { - name: "Sub token word", - defaultSpokenForm: "sub", - legacySpokenForms: ["word"], + unit: { + name: "Unit", + group: { id: "markup", index: 5 }, + defaultSpokenForm: "unit", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Sub token word.", - cheatsheet: "Sub token word", + description: "Unit.", + cheatsheet: "Unit", }, ], examples: [ { - command: `${SET_SELECTION} ${FIRST} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the first sub token word in the ${TARGET_DESC}.`, + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the unit containing the ${TARGET_DESC}.`, }, ], }, - token: { - name: "Token", - defaultSpokenForm: "token", + + // Group: documentStructure + section: { + name: "Section", + group: { id: "documentStructure", index: 0 }, + defaultSpokenForm: "section", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Token.", - cheatsheet: "Token", + description: "Section.", + cheatsheet: "Section", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the ${TARGET_DESC}.`, + description: `Selects the section containing the ${TARGET_DESC}.`, }, ], }, - identifier: { - name: "Identifier", - defaultSpokenForm: "identifier", + sectionLevelOne: { + name: "Section level one", + group: { id: "documentStructure", index: 1 }, + defaultSpokenForm: "one section", + disabledByDefault: true, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Identifier.", - cheatsheet: "Identifier", + description: "Section level one.", + cheatsheet: "Section level one", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the identifier containing the ${TARGET_DESC}.`, + description: `Selects the section level one containing the ${TARGET_DESC}.`, }, ], }, - line: { - name: "Line", - defaultSpokenForm: LINE, + sectionLevelTwo: { + name: "Section level two", + group: { id: "documentStructure", index: 2 }, + defaultSpokenForm: "two section", + disabledByDefault: true, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Line.", - cheatsheet: "Line", + description: "Section level two.", + cheatsheet: "Section level two", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the line containing the ${TARGET_DESC}.`, + description: `Selects the section level two containing the ${TARGET_DESC}.`, }, ], }, - fullLine: { - name: "Full line", - defaultSpokenForm: "full line", + sectionLevelThree: { + name: "Section level three", + group: { id: "documentStructure", index: 3 }, + defaultSpokenForm: "three section", + disabledByDefault: true, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Full line.", - cheatsheet: "Full line", + description: "Section level three.", + cheatsheet: "Section level three", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the full line containing the ${TARGET_DESC}.`, + description: `Selects the section level three containing the ${TARGET_DESC}.`, }, ], }, - sentence: { - name: "Sentence", - defaultSpokenForm: "sentence", + sectionLevelFour: { + name: "Section level four", + group: { id: "documentStructure", index: 4 }, + defaultSpokenForm: "four section", + disabledByDefault: true, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Sentence.", - cheatsheet: "Sentence", + description: "Section level four.", + cheatsheet: "Section level four", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the sentence containing the ${TARGET_DESC}.`, + description: `Selects the section level four containing the ${TARGET_DESC}.`, }, ], }, - paragraph: { - name: "Paragraph", - defaultSpokenForm: "block", + sectionLevelFive: { + name: "Section level five", + group: { id: "documentStructure", index: 5 }, + defaultSpokenForm: "five section", + disabledByDefault: true, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Paragraph.", - cheatsheet: "Paragraph", + description: "Section level five.", + cheatsheet: "Section level five", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the paragraph containing the ${TARGET_DESC}.`, + description: `Selects the section level five containing the ${TARGET_DESC}.`, }, ], }, - boundedParagraph: { - name: "Bounded paragraph", - defaultSpokenForm: "short block", + sectionLevelSix: { + name: "Section level six", + group: { id: "documentStructure", index: 6 }, + defaultSpokenForm: "six section", + disabledByDefault: true, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Paragraph bounded by surrounding pair delimiters.", - cheatsheet: "Paragraph bounded by surrounding pair delimiters", + description: "Section level six.", + cheatsheet: "Section level six", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the bounded paragraph containing the ${TARGET_DESC}.`, + description: `Selects the section level six containing the ${TARGET_DESC}.`, }, ], }, - document: { - name: "Document", - defaultSpokenForm: "file", + part: { + name: "Part", + group: { id: "documentStructure", index: 7 }, + defaultSpokenForm: "part", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Document.", - cheatsheet: "Document", + description: "Part.", + cheatsheet: "Part", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the document containing the ${TARGET_DESC}.`, + description: `Selects the part containing the ${TARGET_DESC}.`, }, ], }, - nonWhitespaceSequence: { - name: "Non-whitespace sequence", - defaultSpokenForm: "paint", + chapter: { + name: "Chapter", + group: { id: "documentStructure", index: 8 }, + defaultSpokenForm: "chapter", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Non-whitespace sequence.", - cheatsheet: "Non-whitespace sequence", + description: "Chapter.", + cheatsheet: "Chapter", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the non-whitespace sequence containing the ${TARGET_DESC}.`, + description: `Selects the chapter containing the ${TARGET_DESC}.`, }, ], }, - boundedNonWhitespaceSequence: { - name: "Bounded non-whitespace sequence", - nameShort: "Bounded non-ws sequence", - defaultSpokenForm: "short paint", + subSection: { + name: "Subsection", + group: { id: "documentStructure", index: 9 }, + defaultSpokenForm: "subsection", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: - "Non-whitespace sequence bounded by surrounding pair delimiters.", - cheatsheet: - "Non-whitespace sequence bounded by surrounding pair delimiters", + description: "Subsection.", + cheatsheet: "Subsection", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the bounded non-whitespace sequence containing the ${TARGET_DESC}.`, + description: `Selects the subsection containing the ${TARGET_DESC}.`, }, ], }, - url: { - name: "URL", - defaultSpokenForm: "link", + subSubSection: { + name: "Subsubsection", + group: { id: "documentStructure", index: 10 }, + defaultSpokenForm: "subsubsection", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "URL.", - cheatsheet: "URL", + description: "Subsubsection.", + cheatsheet: "Subsubsection", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the url containing the ${TARGET_DESC}.`, + description: `Selects the subsubsection containing the ${TARGET_DESC}.`, }, ], }, - notebookCell: { - name: "Notebook cell", - defaultSpokenForm: "cell", + namedParagraph: { + name: "Named paragraph", + group: { id: "documentStructure", index: 11 }, + defaultSpokenForm: "paragraph", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Notebook cell.", - cheatsheet: "Notebook cell", + description: "Named paragraph.", + cheatsheet: "Named paragraph", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the notebook cell containing the ${TARGET_DESC}.`, + description: `Selects the named paragraph containing the ${TARGET_DESC}.`, }, ], }, - command: { - name: "Command", - defaultSpokenForm: "command", + subParagraph: { + name: "Subparagraph", + group: { id: "documentStructure", index: 12 }, + defaultSpokenForm: "subparagraph", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Command.", - cheatsheet: "Command", + description: "Subparagraph.", + cheatsheet: "Subparagraph", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the command containing the ${TARGET_DESC}.`, + description: `Selects the subparagraph containing the ${TARGET_DESC}.`, }, ], }, - glyph: { - name: "Glyph", - defaultSpokenForm: "glyph", + environment: { + name: "Environment", + group: { id: "documentStructure", index: 13 }, + defaultSpokenForm: "environment", syntaxes: [ { - pattern: `${VAR_SPOKEN_FORM} ${VAR_CHARACTER}`, - description: `Instance of single character ${VAR_CHARACTER}.`, - cheatsheet: `Instance of single character ${VAR_CHARACTER}`, + pattern: DEFAULT_PATTERN, + description: "Environment.", + cheatsheet: "Environment", }, ], examples: [ { - command: `${SET_SELECTION} ${NEXT} ${VAR_SPOKEN_FORM} ${AIR}`, - description: `Selects the next 'a'.`, + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the environment containing the ${TARGET_DESC}.`, }, ], }, + + // Group: delimiters surroundingPair: { name: "Surrounding pair", + group: { id: "delimiters", index: 0 }, syntaxes: [ { pattern: VAR_PAIR, @@ -1071,10 +1149,10 @@ export const scopeReferences = { ], }, - // Private scopes -------------------- - + // Group: private "private.fieldAccess": { name: "Field access", + group: { id: "private", index: 0 }, defaultSpokenForm: "access", private: true, syntaxes: [ @@ -1093,6 +1171,7 @@ export const scopeReferences = { }, string: { name: "String", + group: { id: "private", index: 1 }, defaultSpokenForm: "parse tree string", private: true, syntaxes: [ @@ -1111,6 +1190,7 @@ export const scopeReferences = { }, textFragment: { name: "Text fragment", + group: { id: "private", index: 2 }, defaultSpokenForm: "text fragment", private: true, syntaxes: [ @@ -1129,6 +1209,7 @@ export const scopeReferences = { }, disqualifyDelimiter: { name: "Disqualify delimiter", + group: { id: "private", index: 3 }, defaultSpokenForm: "disqualify delimiter", private: true, syntaxes: [ @@ -1147,6 +1228,7 @@ export const scopeReferences = { }, pairDelimiter: { name: "Pair delimiter", + group: { id: "private", index: 4 }, defaultSpokenForm: "pair delimiter", private: true, syntaxes: [ @@ -1165,6 +1247,7 @@ export const scopeReferences = { }, interior: { name: "Interior", + group: { id: "private", index: 5 }, defaultSpokenForm: "interior", private: true, syntaxes: [ @@ -1183,14 +1266,19 @@ export const scopeReferences = { }, surroundingPairInterior: { name: "Surrounding pair interior", + group: { id: "private", index: 6 }, private: true, syntaxes: [], examples: [], }, customRegex: { name: "Custom regex", + group: { id: "private", index: 7 }, private: true, syntaxes: [], examples: [], }, -} as const satisfies Record; +} as const satisfies Record< + ScopeTypeType, + ReferenceEntry +>; diff --git a/packages/tool-meta-updater/src/metaUpdater.ts b/packages/tool-meta-updater/src/metaUpdater.ts index cc06dc7d5a..953e34e80d 100644 --- a/packages/tool-meta-updater/src/metaUpdater.ts +++ b/packages/tool-meta-updater/src/metaUpdater.ts @@ -9,7 +9,9 @@ import { actionReferenceGroups, actionReferences, languageScopeSupport, + modifierReferenceGroups, modifierReferences, + scopeReferenceGroups, scopeReferences, } from "@cursorless/lib-common"; import type { Context } from "./Context"; @@ -60,6 +62,18 @@ export const updater = async (workspaceDir: string) => { actionReferences, actionReferenceGroups, ), + [`${userDir}/modifiers/README.md`]: updateReferenceReadmeMd.bind( + null, + "Modifiers", + modifierReferences, + modifierReferenceGroups, + ), + [`${userDir}/scopes/README.md`]: updateReferenceReadmeMd.bind( + null, + "Scopes", + scopeReferences, + scopeReferenceGroups, + ), ...Object.fromEntries( Object.entries(actionReferences).map(([id, entry]) => [ `${userDir}/actions/${cleanId(id)}.mdx`, diff --git a/packages/tool-meta-updater/src/updatePrivateScopeMdx.ts b/packages/tool-meta-updater/src/updatePrivateScopeMdx.ts index cda49c0a46..0af55742de 100644 --- a/packages/tool-meta-updater/src/updatePrivateScopeMdx.ts +++ b/packages/tool-meta-updater/src/updatePrivateScopeMdx.ts @@ -3,7 +3,7 @@ import type { ReferenceEntry } from "@cursorless/lib-common"; export function updatePrivateScopeMdx( id: string, - entry: ReferenceEntry, + entry: ReferenceEntry, actual: string | null, options: FormatPluginFnOptions, ): string | null { diff --git a/packages/tool-meta-updater/src/updateReferenceMdx.ts b/packages/tool-meta-updater/src/updateReferenceMdx.ts index 6c55db3869..826d2dc04a 100644 --- a/packages/tool-meta-updater/src/updateReferenceMdx.ts +++ b/packages/tool-meta-updater/src/updateReferenceMdx.ts @@ -7,7 +7,7 @@ import { injectSpokenForm } from "./util/injectSpokenForm"; export function updateReferenceMdx( kind: "action" | "modifier" | "scope", id: string, - entry: ReferenceEntry, + entry: ReferenceEntry, actual: string | null, options: FormatPluginFnOptions, ): string | null { diff --git a/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts b/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts index dc75fb91fb..8be2374d56 100644 --- a/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts +++ b/packages/tool-meta-updater/src/updateReferenceReadmeMd.ts @@ -1,15 +1,12 @@ import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; -import type { - GroupedReferenceEntry, - ReferenceGroup, -} from "@cursorless/lib-common"; +import type { ReferenceEntry, ReferenceGroup } from "@cursorless/lib-common"; import { cleanId } from "./util/cleanId"; import { formatVariables } from "./util/formatVariables"; import { injectSpokenForm } from "./util/injectSpokenForm"; export function updateReferenceReadmeMd( title: string, - entries: Record>, + entries: Record>, groups: ReferenceGroup[], actual: string | null, options: FormatPluginFnOptions, From f46fc0876118d0767f47022fe514ae98b48b2eff Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Sun, 30 Aug 2026 02:25:50 +0200 Subject: [PATCH 6/6] Additional descriptions --- .../src/docs/user/actions/README.md | 137 ++- .../src/docs/user/modifiers/README.md | 32 +- .../src/docs/user/scopes/README.md | 146 +-- .../docs/user/scopes/anonymousFunction.mdx | 2 +- .../src/docs/user/scopes/argumentList.mdx | 2 +- .../docs/user/scopes/argumentOrParameter.mdx | 2 +- .../src/docs/user/scopes/attribute.mdx | 2 +- .../src/docs/user/scopes/branch.mdx | 2 +- .../src/docs/user/scopes/chapter.mdx | 2 +- .../src/docs/user/scopes/character.mdx | 2 +- .../src/docs/user/scopes/class.mdx | 2 +- .../src/docs/user/scopes/className.mdx | 2 +- .../src/docs/user/scopes/collectionItem.mdx | 2 +- .../src/docs/user/scopes/collectionKey.mdx | 2 +- .../src/docs/user/scopes/command.mdx | 2 +- .../src/docs/user/scopes/comment.mdx | 2 +- .../src/docs/user/scopes/condition.mdx | 2 +- .../src/docs/user/scopes/document.mdx | 2 +- .../src/docs/user/scopes/environment.mdx | 2 +- .../src/docs/user/scopes/fullLine.mdx | 2 +- .../src/docs/user/scopes/functionCall.mdx | 2 +- .../src/docs/user/scopes/functionCallee.mdx | 2 +- .../src/docs/user/scopes/functionName.mdx | 2 +- .../src/docs/user/scopes/identifier.mdx | 2 +- .../src/docs/user/scopes/ifStatement.mdx | 2 +- .../src/docs/user/scopes/instance.mdx | 2 +- .../src/docs/user/scopes/line.mdx | 2 +- .../src/docs/user/scopes/list.mdx | 2 +- .../app-web-docs/src/docs/user/scopes/map.mdx | 2 +- .../src/docs/user/scopes/name.mdx | 2 +- .../src/docs/user/scopes/namedFunction.mdx | 2 +- .../src/docs/user/scopes/namedParagraph.mdx | 2 +- .../src/docs/user/scopes/notebookCell.mdx | 2 +- .../src/docs/user/scopes/paragraph.mdx | 2 +- .../src/docs/user/scopes/part.mdx | 2 +- .../docs/user/scopes/regularExpression.mdx | 2 +- .../src/docs/user/scopes/section.mdx | 2 +- .../src/docs/user/scopes/sectionLevelFive.mdx | 2 +- .../src/docs/user/scopes/sectionLevelFour.mdx | 2 +- .../src/docs/user/scopes/sectionLevelOne.mdx | 2 +- .../src/docs/user/scopes/sectionLevelSix.mdx | 2 +- .../docs/user/scopes/sectionLevelThree.mdx | 2 +- .../src/docs/user/scopes/sectionLevelTwo.mdx | 2 +- .../src/docs/user/scopes/selector.mdx | 2 +- .../src/docs/user/scopes/sentence.mdx | 2 +- .../src/docs/user/scopes/statement.mdx | 2 +- .../src/docs/user/scopes/subParagraph.mdx | 2 +- .../src/docs/user/scopes/subSection.mdx | 2 +- .../src/docs/user/scopes/subSubSection.mdx | 2 +- .../src/docs/user/scopes/surroundingPair.mdx | 2 +- .../src/docs/user/scopes/token.mdx | 2 +- .../src/docs/user/scopes/type.mdx | 2 +- .../src/docs/user/scopes/unit.mdx | 2 +- .../app-web-docs/src/docs/user/scopes/url.mdx | 2 +- .../src/docs/user/scopes/value.mdx | 2 +- .../src/docs/user/scopes/word.mdx | 2 +- .../src/docs/user/scopes/xmlBothTags.mdx | 2 +- .../src/docs/user/scopes/xmlElement.mdx | 2 +- .../src/docs/user/scopes/xmlEndTag.mdx | 2 +- .../src/docs/user/scopes/xmlStartTag.mdx | 2 +- .../src/references/actionReferenceGroups.ts | 95 +- .../src/references/actionReferences.ts | 894 +++++++++--------- .../src/references/modifierReferenceGroups.ts | 24 +- .../src/references/modifierReferences.ts | 240 ++--- .../src/references/scopeReferenceGroups.ts | 38 +- .../src/references/scopeReferences.ts | 887 ++++++++--------- 66 files changed, 1314 insertions(+), 1293 deletions(-) diff --git a/packages/app-web-docs/src/docs/user/actions/README.md b/packages/app-web-docs/src/docs/user/actions/README.md index a0b42693e8..bf9020f03d 100644 --- a/packages/app-web-docs/src/docs/user/actions/README.md +++ b/packages/app-web-docs/src/docs/user/actions/README.md @@ -15,33 +15,37 @@ - [`"change "`](./clearAndSetSelection.mdx) - Change `` by clearing it and leaving the cursor in its place. - [`"chuck "`](./remove.mdx) - Remove ``. -## Clone - -- [`"clone "`](./insertCopyAfter.mdx) - Insert copy after ``. -- [`"clone up "`](./insertCopyBefore.mdx) - Insert copy before ``. - -## Cut, copy, and paste +## Cut / copy / paste - [`"carve "`](./cutToClipboard.mdx) - Cut `` to clipboard. - [`"copy "`](./copyToClipboard.mdx) - Copy `` to clipboard. - [`"paste "`](./pasteFromClipboard.mdx) - Paste from clipboard at ``. +## Insert / use / repeat + +- [`"clone "`](./insertCopyAfter.mdx) - Insert copy after ``. +- [`"clone up "`](./insertCopyBefore.mdx) - Insert copy before ``. +- [`"bring "`](./replaceWithTarget.mdx) - Insert copy of `` at selection. +- [`"bring "`](./replaceWithTarget.mdx) - Copy `` to ``. +- [`"call "`](./callAsFunction.mdx) - Insert call to `` on selection. +- [`"call on "`](./callAsFunction.mdx) - Insert call to `` on ``. + ## Swap - [`"swap with "`](./swapTargets.mdx) - Swap selection with ``. - [`"swap with "`](./swapTargets.mdx) - Swap `` with ``. -## Indent and outdent +## Move / replace -- [`"indent "`](./indentLine.mdx) - Indent line containing ``. -- [`"dedent "`](./outdentLine.mdx) - Outdent line containing ``. +- [`"move "`](./moveToTarget.mdx) - Move `` to selection. +- [`"move "`](./moveToTarget.mdx) - Move `` to ``. -## Increment and decrement +## Indent / outdent -- [`"increment "`](./increment.mdx) - Increment number at ``. -- [`"decrement "`](./decrement.mdx) - Decrement number at ``. +- [`"indent "`](./indentLine.mdx) - Indent line containing ``. +- [`"dedent "`](./outdentLine.mdx) - Outdent line containing ``. -## Insert empty lines or scopes +## Insert empty lines / scopes - [`"drink "`](./editNewLineBefore.mdx) - Edit new line before ``. - [`"drink "`](./editNewLineBefore.mdx) - Edit new `` before ``. @@ -51,13 +55,38 @@ - [`"float "`](./insertEmptyLineAfter.mdx) - Insert empty line/scope after ``. - [`"puff "`](./insertEmptyLinesAround.mdx) - Insert empty lines/scopes around ``. -## Homophones +## Reverse / shuffle / sort -- [`"phones "`](./nextHomophone.mdx) - Cycle to next homophone for ``. +- [`"reverse "`](./reverseTargets.mdx) - Reverse ``s. +- [`"shuffle "`](./randomizeTargets.mdx) - Randomize ``s. +- [`"sort "`](./sortTargets.mdx) - Sort ``s. + +## Wrap / rewrap -## Rename +- [`" wrap "`](./wrapWithPairedDelimiter.mdx) - Wrap `` with ``. +- [`" wrap "`](./wrapWithPairedDelimiter.mdx) - Wrap `` with ``. +- [`" repack "`](./rewrapWithPairedDelimiter.mdx) - Rewrap `` with ``. + +## Increment / decrement + +- [`"increment "`](./increment.mdx) - Increment number at ``. +- [`"decrement "`](./decrement.mdx) - Decrement number at ``. + +## Refactor / fix - [`"rename "`](./rename.mdx) - Rename ``. +- [`"extract "`](./extractVariable.mdx) - Extract variable from ``. +- [`"quick fix "`](./showQuickFix.mdx) - Show quick fix for ``. + +## Join / break + +- [`"join "`](./joinLines.mdx) - Join lines at ``. +- [`"break "`](./breakLine.mdx) - Breaks the line before ``. + +## Snippets + +- [`"snip make "`](./generateSnippet.mdx) - Generate snippet from ``. +- [`"snip "`](./insertSnippet.mdx) - Insert snippet at ``. ## Scroll @@ -65,70 +94,44 @@ - [`"center "`](./scrollToCenter.mdx) - Scroll `` to center of the viewport. - [`"bottom "`](./scrollToBottom.mdx) - Scroll `` to bottom of the viewport. -## Insert, use, and repeat +## Fold / unfold -- [`"bring "`](./replaceWithTarget.mdx) - Insert copy of `` at selection. -- [`"bring "`](./replaceWithTarget.mdx) - Copy `` to ``. -- [`"call "`](./callAsFunction.mdx) - Insert call to `` on selection. -- [`"call on "`](./callAsFunction.mdx) - Insert call to `` on ``. +- [`"fold "`](./foldRegion.mdx) - Fold region at ``. +- [`"unfold "`](./unfoldRegion.mdx) - Unfold region at ``. + +## Homophones -## Move and replace +- [`"phones "`](./nextHomophone.mdx) - Cycle to next homophone for ``. -- [`"move "`](./moveToTarget.mdx) - Move `` to selection. -- [`"move "`](./moveToTarget.mdx) - Move `` to ``. +## Format -## Reverse, shuffle, and sort +- [`"format at "`](./applyFormatter.mdx) - Reformat `` as ``. -- [`"reverse "`](./reverseTargets.mdx) - Reverse ``s. -- [`"shuffle "`](./randomizeTargets.mdx) - Randomize ``s. -- [`"sort "`](./sortTargets.mdx) - Sort ``s. +## Instance reference -## Wrap and rewrap +- [`"from "`](./setInstanceReference.mdx) - Set instance reference to ``. -- [`" wrap "`](./wrapWithPairedDelimiter.mdx) - Wrap `` with ``. -- [`" wrap "`](./wrapWithPairedDelimiter.mdx) - Wrap `` with ``. -- [`" repack "`](./rewrapWithPairedDelimiter.mdx) - Rewrap `` with ``. +## Comment + +- [`"comment "`](./toggleLineComment.mdx) - Toggle line comment at ``. + +## Breakpoint -## Navigate and inspect +- [`"break point "`](./toggleLineBreakpoint.mdx) - Toggle breakpoint on line containing ``. +- [`"break point token "`](./toggleLineBreakpoint.mdx) - Toggle inline breakpoint at ``. + +## Navigate / inspect - [`"define "`](./revealDefinition.mdx) - Reveal definition of ``. - [`"type deaf "`](./revealTypeDefinition.mdx) - Reveal type definition of ``. - [`"reference "`](./showReferences.mdx) - Show references for ``. - [`"hover "`](./showHover.mdx) - Show hover for ``. -- [`"quick fix "`](./showQuickFix.mdx) - Show quick fix for ``. - [`"scout "`](./findInDocument.mdx) - Find `` in document. - [`"scout all "`](./findInWorkspace.mdx) - Find `` in workspace. - [`"follow "`](./followLink.mdx) - Follow link at ``. - [`"follow split "`](./followLinkAside.mdx) - Follow link at `` aside (e.g. in a split view). - [`"inspect "`](./showDebugHover.mdx) - Show debug hover for ``. -## Fold and unfold - -- [`"fold "`](./foldRegion.mdx) - Fold region at ``. -- [`"unfold "`](./unfoldRegion.mdx) - Unfold region at ``. - -## Extract - -- [`"extract "`](./extractVariable.mdx) - Extract variable from ``. - -## Join - -- [`"join "`](./joinLines.mdx) - Join lines at ``. - -## Break - -- [`"break "`](./breakLine.mdx) - Breaks the line before ``. - -## Visual feedback - -- [`"flash "`](./flashTargets.mdx) - Flash ``. -- [`"highlight "`](./highlight.mdx) - Highlight ``. - -## Snippets - -- [`"snip make "`](./generateSnippet.mdx) - Generate snippet from ``. -- [`"snip "`](./insertSnippet.mdx) - Insert snippet at ``. - ## Git - [`"git accept "`](./gitAccept.mdx) - Accept Git change at ``. @@ -136,13 +139,7 @@ - [`"git stage "`](./gitStage.mdx) - Stage Git change at ``. - [`"git unstage "`](./gitUnstage.mdx) - Unstage Git change at ``. -## Editor commands - -- [`"format at "`](./applyFormatter.mdx) - Reformat `` as ``. -- [`"comment "`](./toggleLineComment.mdx) - Toggle line comment at ``. -- [`"break point "`](./toggleLineBreakpoint.mdx) - Toggle breakpoint on line containing ``. -- [`"break point token "`](./toggleLineBreakpoint.mdx) - Toggle inline breakpoint at ``. - -## Target context +## Visual feedback -- [`"from "`](./setInstanceReference.mdx) - Set instance reference to ``. +- [`"flash "`](./flashTargets.mdx) - Flash ``. +- [`"highlight "`](./highlight.mdx) - Highlight ``. diff --git a/packages/app-web-docs/src/docs/user/modifiers/README.md b/packages/app-web-docs/src/docs/user/modifiers/README.md index dd87980f7c..d5345e2794 100644 --- a/packages/app-web-docs/src/docs/user/modifiers/README.md +++ b/packages/app-web-docs/src/docs/user/modifiers/README.md @@ -1,28 +1,22 @@ # Modifiers -## Positions - -- [`"start of"`](./startOf.mdx) - Empty position at start of target. -- [`"end of"`](./endOf.mdx) - Empty position at end of target. - -## Interiors and delimiters - -- [`"inside"`](./interiorOnly.mdx) - Interior only. -- [`"bounds"`](./excludeInterior.mdx) - Bounding paired delimiters. -- [`"leading"`](./leading.mdx) - Leading delimiter range. -- [`"trailing"`](./trailing.mdx) - Trailing delimiter range. - -## Scope navigation +## Scope containment - [`""`](./containingScope.mdx) - Containing instance of ``. - [`"every "`](./everyScope.mdx) - Every instance of ``. - [`"grand "`](./ancestor.mdx) - Parent of the containing instance of ``. + +## Ordinal scope + - [`" "`](./ordinalScope.mdx) - `` instance of `` in iteration scope. - [`" last "`](./ordinalScope.mdx) - ``-to-last instance of `` in iteration scope. - [`"first s"`](./ordinalScope.mdx) - First `` instances of `` in iteration scope, as contiguous range. - [`"every first s"`](./ordinalScope.mdx) - First `` instances of `` in iteration scope, as individual targets. - [`"last s"`](./ordinalScope.mdx) - Last `` instances of `` in iteration scope, as contiguous range. - [`"every last s"`](./ordinalScope.mdx) - Last `` instances of `` in iteration scope, as individual targets. + +## Relative scope + - [`"previous "`](./relativeScope.mdx) - Previous instance of ``. - [`" previous "`](./relativeScope.mdx) - `` instance of `` before target. - [`"next "`](./relativeScope.mdx) - Next instance of ``. @@ -38,6 +32,13 @@ - [`"next s"`](./relativeScope.mdx) - Next `` instances of ``, as contiguous range. - [`"every next s"`](./relativeScope.mdx) - Next `` instances of ``, as individual targets. +## Interiors / delimiters + +- [`"inside"`](./interiorOnly.mdx) - Interior only. +- [`"bounds"`](./excludeInterior.mdx) - Bounding paired delimiters. +- [`"leading"`](./leading.mdx) - Leading delimiter range. +- [`"trailing"`](./trailing.mdx) - Trailing delimiter range. + ## Range extension - [`"head"`](./extendThroughStartOf.mdx) - Extend through start of line/pair. @@ -45,6 +46,11 @@ - [`"tail"`](./extendThroughEndOf.mdx) - Extend through end of line/pair. - [`"tail "`](./extendThroughEndOf.mdx) - Extend through end of ``. +## Positions + +- [`"start of"`](./startOf.mdx) - Empty position at start of target. +- [`"end of"`](./endOf.mdx) - Empty position at end of target. + ## Filters - [`"visible"`](./visible.mdx) - Visible in viewport. diff --git a/packages/app-web-docs/src/docs/user/scopes/README.md b/packages/app-web-docs/src/docs/user/scopes/README.md index 8d699855c7..19e6b4ad48 100644 --- a/packages/app-web-docs/src/docs/user/scopes/README.md +++ b/packages/app-web-docs/src/docs/user/scopes/README.md @@ -1,89 +1,89 @@ # Scopes -## Characters and tokens - -- [`"char"`](./character.mdx) - Character. -- [`"sub"`](./word.mdx) - Sub token word. -- [`"token"`](./token.mdx) - Token. -- [`"identifier"`](./identifier.mdx) - Identifier. -- [`"glyph "`](./glyph.mdx) - Instance of single character ``. +## Text-based scopes + +- [`"char"`](./character.mdx) - Single character within a token. +- [`"sub"`](./word.mdx) - Word-like component within a token, such as part of camelCase or snake_case. +- [`"token"`](./token.mdx) - Token such as a word, number, or operator. +- [`"identifier"`](./identifier.mdx) - Identifier-style sequence, such as camelCase, snake_case, or kebab-case. +- [`"sentence"`](./sentence.mdx) - Text ending at sentence punctuation or a paragraph boundary. +- [`"line"`](./line.mdx) - Line, without indentation. +- [`"full line"`](./fullLine.mdx) - Full line, including indentation. +- [`"block"`](./paragraph.mdx) - Paragraph, contiguous non-empty lines around the target. +- [`"short block"`](./boundedParagraph.mdx) - Paragraph bounded by surrounding pair delimiters. +- [`"file"`](./document.mdx) - Entire document. - [`"paint"`](./nonWhitespaceSequence.mdx) - Non-whitespace sequence. - [`"short paint"`](./boundedNonWhitespaceSequence.mdx) - Non-whitespace sequence bounded by surrounding pair delimiters. -- [`"link"`](./url.mdx) - URL. -- [`"regex"`](./regularExpression.mdx) - Regular expression. +- [`"link"`](./url.mdx) - URL / Web address. +- [`""`](./surroundingPair.mdx) - Surrounding matching delimiter pair and its contents. +- [`"glyph "`](./glyph.mdx) - Instance of single character ``. -## Lines and documents +## Sections -- [`"line"`](./line.mdx) - Line. -- [`"full line"`](./fullLine.mdx) - Full line. -- [`"sentence"`](./sentence.mdx) - Sentence. -- [`"block"`](./paragraph.mdx) - Paragraph. -- [`"short block"`](./boundedParagraph.mdx) - Paragraph bounded by surrounding pair delimiters. -- [`"file"`](./document.mdx) - Document. -- [`"cell"`](./notebookCell.mdx) - Notebook cell. +- [`"section"`](./section.mdx) - Heading and its content through the next heading of the same or higher level. +- [`"one section"`](./sectionLevelOne.mdx) - Level-one heading and its content. +- [`"two section"`](./sectionLevelTwo.mdx) - Level-two heading and its content. +- [`"three section"`](./sectionLevelThree.mdx) - Level-three heading and its content. +- [`"four section"`](./sectionLevelFour.mdx) - Level-four heading and its content. +- [`"five section"`](./sectionLevelFive.mdx) - Level-five heading and its content. +- [`"six section"`](./sectionLevelSix.mdx) - Level-six heading and its content. + +## Document hierarchy + +- [`"part"`](./part.mdx) - Document part and its contents. +- [`"chapter"`](./chapter.mdx) - Document chapter and its contents. +- [`"subsection"`](./subSection.mdx) - Document subsection and its contents. +- [`"subsubsection"`](./subSubSection.mdx) - Document subsubsection and its contents. +- [`"paragraph"`](./namedParagraph.mdx) - Named document paragraph and its contents. +- [`"subparagraph"`](./subParagraph.mdx) - Document subparagraph and its contents. +- [`"environment"`](./environment.mdx) - Named document environment and its contents. + +## Collections + +- [`"list"`](./list.mdx) - List or array. +- [`"map"`](./map.mdx) - Map, object, or dictionary. +- [`"item"`](./collectionItem.mdx) - Entry in a list, map, object, or similar collection. +- [`"key"`](./collectionKey.mdx) - Key in a map, object, or dictionary. ## Functions and calls -- [`"arg"`](./argumentOrParameter.mdx) - Argument. -- [`"arg list"`](./argumentList.mdx) - Argument list. -- [`"lambda"`](./anonymousFunction.mdx) - Anonymous function. -- [`"funk"`](./namedFunction.mdx) - Named function. -- [`"funk name"`](./functionName.mdx) - Function name. -- [`"call"`](./functionCall.mdx) - Function call. -- [`"callee"`](./functionCallee.mdx) - Function callee. +- [`"arg"`](./argumentOrParameter.mdx) - Function parameter or function-call argument. +- [`"arg list"`](./argumentList.mdx) - Complete parameter or argument list. +- [`"lambda"`](./anonymousFunction.mdx) - Anonymous or lambda function. +- [`"funk"`](./namedFunction.mdx) - Named function declaration. +- [`"funk name"`](./functionName.mdx) - Name in a function declaration. +- [`"call"`](./functionCall.mdx) - Function, method, or constructor call. +- [`"callee"`](./functionCallee.mdx) - Expression invoked by a function call. ## Classes and objects -- [`"class"`](./class.mdx) - Class. -- [`"class name"`](./className.mdx) - Class name. -- [`"instance"`](./instance.mdx) - Instance. -- [`"name"`](./name.mdx) - Name. -- [`"attribute"`](./attribute.mdx) - Attribute. -- [`"type"`](./type.mdx) - Type. -- [`"value"`](./value.mdx) - Value. +- [`"class"`](./class.mdx) - Class or struct declaration or definition. +- [`"class name"`](./className.mdx) - Name in a class or struct declaration. +- [`"instance"`](./instance.mdx) - Occurrence matching the current instance. +- [`"name"`](./name.mdx) - Name in a declaration, such as a variable or function name. +- [`"attribute"`](./attribute.mdx) - Attribute, such as one on an HTML element. +- [`"type"`](./type.mdx) - Type annotation or declaration. +- [`"value"`](./value.mdx) - Value in an assignment, collection entry, return statement, or similar construct. -## Collections +## Statements and expressions -- [`"list"`](./list.mdx) - List. -- [`"map"`](./map.mdx) - Map. -- [`"item"`](./collectionItem.mdx) - Collection item. -- [`"key"`](./collectionKey.mdx) - Collection key. +- [`"state"`](./statement.mdx) - Complete statement, such as a variable declaration or expression statement. +- [`"branch"`](./branch.mdx) - Branch of a control-flow construct, such as if, try, switch, or ternary. +- [`"if state"`](./ifStatement.mdx) - Complete if statement. +- [`"condition"`](./condition.mdx) - Condition of a conditional, loop, or similar construct. +- [`"comment"`](./comment.mdx) - Line or block comment. +- [`"command"`](./command.mdx) - Command, such as a Talon spoken command or shell command. +- [`"regex"`](./regularExpression.mdx) - Regular-expression literal. -## Statements and expressions +## Markup and styles + +- [`"element"`](./xmlElement.mdx) - Complete XML, HTML, or JSX element, or a LaTeX environment. +- [`"start tag"`](./xmlStartTag.mdx) - Opening XML, HTML, or JSX tag, or LaTeX `begin` command. +- [`"end tag"`](./xmlEndTag.mdx) - Closing XML, HTML, or JSX tag, or LaTeX `end` command. +- [`"tags"`](./xmlBothTags.mdx) - Opening and closing XML, HTML, or JSX tags, or LaTeX `begin` and `end` commands. +- [`"selector"`](./selector.mdx) - CSS selector. +- [`"unit"`](./unit.mdx) - Unit suffix in a measurement, such as `px` in `100px`. + +## Notebook -- [`"state"`](./statement.mdx) - Statement. -- [`"branch"`](./branch.mdx) - Branch. -- [`"if state"`](./ifStatement.mdx) - If statement. -- [`"condition"`](./condition.mdx) - Condition. -- [`"comment"`](./comment.mdx) - Comment. -- [`"command"`](./command.mdx) - Command. - -## Markup - -- [`"element"`](./xmlElement.mdx) - XML element. -- [`"start tag"`](./xmlStartTag.mdx) - XML start tag. -- [`"end tag"`](./xmlEndTag.mdx) - XML end tag. -- [`"tags"`](./xmlBothTags.mdx) - XML start and end tags. -- [`"selector"`](./selector.mdx) - Selector. -- [`"unit"`](./unit.mdx) - Unit. - -## Document structure - -- [`"section"`](./section.mdx) - Section. -- [`"one section"`](./sectionLevelOne.mdx) - Section level one. -- [`"two section"`](./sectionLevelTwo.mdx) - Section level two. -- [`"three section"`](./sectionLevelThree.mdx) - Section level three. -- [`"four section"`](./sectionLevelFour.mdx) - Section level four. -- [`"five section"`](./sectionLevelFive.mdx) - Section level five. -- [`"six section"`](./sectionLevelSix.mdx) - Section level six. -- [`"part"`](./part.mdx) - Part. -- [`"chapter"`](./chapter.mdx) - Chapter. -- [`"subsection"`](./subSection.mdx) - Subsection. -- [`"subsubsection"`](./subSubSection.mdx) - Subsubsection. -- [`"paragraph"`](./namedParagraph.mdx) - Named paragraph. -- [`"subparagraph"`](./subParagraph.mdx) - Subparagraph. -- [`"environment"`](./environment.mdx) - Environment. - -## Paired delimiters - -- [`""`](./surroundingPair.mdx) - Surrounding pair. +- [`"cell"`](./notebookCell.mdx) - Notebook cell or Markdown fenced code block. diff --git a/packages/app-web-docs/src/docs/user/scopes/anonymousFunction.mdx b/packages/app-web-docs/src/docs/user/scopes/anonymousFunction.mdx index 2a28bbe1fc..4f079a186c 100644 --- a/packages/app-web-docs/src/docs/user/scopes/anonymousFunction.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/anonymousFunction.mdx @@ -14,7 +14,7 @@ Default: `lambda` ## Syntax -- lambda - Anonymous function. +- lambda - Anonymous or lambda function. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/argumentList.mdx b/packages/app-web-docs/src/docs/user/scopes/argumentList.mdx index 9c2dcba32b..b39436bbef 100644 --- a/packages/app-web-docs/src/docs/user/scopes/argumentList.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/argumentList.mdx @@ -14,7 +14,7 @@ Default: `arg list` ## Syntax -- arg list - Argument list. +- arg list - Complete parameter or argument list. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/argumentOrParameter.mdx b/packages/app-web-docs/src/docs/user/scopes/argumentOrParameter.mdx index 2f429dbcb4..9ec8b10369 100644 --- a/packages/app-web-docs/src/docs/user/scopes/argumentOrParameter.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/argumentOrParameter.mdx @@ -14,7 +14,7 @@ Default: `arg` ## Syntax -- arg - Argument. +- arg - Function parameter or function-call argument. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/attribute.mdx b/packages/app-web-docs/src/docs/user/scopes/attribute.mdx index f401d8ef1b..0883f693ae 100644 --- a/packages/app-web-docs/src/docs/user/scopes/attribute.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/attribute.mdx @@ -14,7 +14,7 @@ Default: `attribute` ## Syntax -- attribute - Attribute. +- attribute - Attribute, such as one on an HTML element. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/branch.mdx b/packages/app-web-docs/src/docs/user/scopes/branch.mdx index 3d11545bee..fb6554f294 100644 --- a/packages/app-web-docs/src/docs/user/scopes/branch.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/branch.mdx @@ -14,7 +14,7 @@ Default: `branch` ## Syntax -- branch - Branch. +- branch - Branch of a control-flow construct, such as if, try, switch, or ternary. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/chapter.mdx b/packages/app-web-docs/src/docs/user/scopes/chapter.mdx index 1de3c9ebd0..73665b30b3 100644 --- a/packages/app-web-docs/src/docs/user/scopes/chapter.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/chapter.mdx @@ -14,7 +14,7 @@ Default: `chapter` ## Syntax -- chapter - Chapter. +- chapter - Document chapter and its contents. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/character.mdx b/packages/app-web-docs/src/docs/user/scopes/character.mdx index f0b6ce8097..76077f663c 100644 --- a/packages/app-web-docs/src/docs/user/scopes/character.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/character.mdx @@ -14,7 +14,7 @@ Default: `char` ## Syntax -- char - Character. +- char - Single character within a token. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/class.mdx b/packages/app-web-docs/src/docs/user/scopes/class.mdx index ae7216cdac..4f6022be2f 100644 --- a/packages/app-web-docs/src/docs/user/scopes/class.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/class.mdx @@ -14,7 +14,7 @@ Default: `class` ## Syntax -- class - Class. +- class - Class or struct declaration or definition. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/className.mdx b/packages/app-web-docs/src/docs/user/scopes/className.mdx index 523f51c27e..528125bae0 100644 --- a/packages/app-web-docs/src/docs/user/scopes/className.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/className.mdx @@ -14,7 +14,7 @@ Default: `class name` ## Syntax -- class name - Class name. +- class name - Name in a class or struct declaration. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/collectionItem.mdx b/packages/app-web-docs/src/docs/user/scopes/collectionItem.mdx index 79640a0c1b..91965692d3 100644 --- a/packages/app-web-docs/src/docs/user/scopes/collectionItem.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/collectionItem.mdx @@ -14,7 +14,7 @@ Default: `item` ## Syntax -- item - Collection item. +- item - Entry in a list, map, object, or similar collection. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx b/packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx index b29d9f85d7..e9070e090b 100644 --- a/packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/collectionKey.mdx @@ -14,7 +14,7 @@ Default: `key` ## Syntax -- key - Collection key. +- key - Key in a map, object, or dictionary. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/command.mdx b/packages/app-web-docs/src/docs/user/scopes/command.mdx index fde1998585..62d0089222 100644 --- a/packages/app-web-docs/src/docs/user/scopes/command.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/command.mdx @@ -14,7 +14,7 @@ Default: `command` ## Syntax -- command - Command. +- command - Command, such as a Talon spoken command or shell command. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/comment.mdx b/packages/app-web-docs/src/docs/user/scopes/comment.mdx index cf80f9992e..be6c916498 100644 --- a/packages/app-web-docs/src/docs/user/scopes/comment.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/comment.mdx @@ -14,7 +14,7 @@ Default: `comment` ## Syntax -- comment - Comment. +- comment - Line or block comment. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/condition.mdx b/packages/app-web-docs/src/docs/user/scopes/condition.mdx index 94ea4e5975..936d399741 100644 --- a/packages/app-web-docs/src/docs/user/scopes/condition.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/condition.mdx @@ -14,7 +14,7 @@ Default: `condition` ## Syntax -- condition - Condition. +- condition - Condition of a conditional, loop, or similar construct. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/document.mdx b/packages/app-web-docs/src/docs/user/scopes/document.mdx index 7c7caea7b0..e9c7309bbd 100644 --- a/packages/app-web-docs/src/docs/user/scopes/document.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/document.mdx @@ -14,7 +14,7 @@ Default: `file` ## Syntax -- file - Document. +- file - Entire document. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/environment.mdx b/packages/app-web-docs/src/docs/user/scopes/environment.mdx index 862ed10cc6..8083352037 100644 --- a/packages/app-web-docs/src/docs/user/scopes/environment.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/environment.mdx @@ -14,7 +14,7 @@ Default: `environment` ## Syntax -- environment - Environment. +- environment - Named document environment and its contents. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/fullLine.mdx b/packages/app-web-docs/src/docs/user/scopes/fullLine.mdx index 42680c2a93..a3f665459e 100644 --- a/packages/app-web-docs/src/docs/user/scopes/fullLine.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/fullLine.mdx @@ -14,7 +14,7 @@ Default: `full line` ## Syntax -- full line - Full line. +- full line - Full line, including indentation. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/functionCall.mdx b/packages/app-web-docs/src/docs/user/scopes/functionCall.mdx index 6878505acb..cff994ddc2 100644 --- a/packages/app-web-docs/src/docs/user/scopes/functionCall.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/functionCall.mdx @@ -14,7 +14,7 @@ Default: `call` ## Syntax -- call - Function call. +- call - Function, method, or constructor call. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/functionCallee.mdx b/packages/app-web-docs/src/docs/user/scopes/functionCallee.mdx index d2cc69924d..568b09a60c 100644 --- a/packages/app-web-docs/src/docs/user/scopes/functionCallee.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/functionCallee.mdx @@ -14,7 +14,7 @@ Default: `callee` ## Syntax -- callee - Function callee. +- callee - Expression invoked by a function call. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/functionName.mdx b/packages/app-web-docs/src/docs/user/scopes/functionName.mdx index 1ee578949e..d884b52efc 100644 --- a/packages/app-web-docs/src/docs/user/scopes/functionName.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/functionName.mdx @@ -14,7 +14,7 @@ Default: `funk name` ## Syntax -- funk name - Function name. +- funk name - Name in a function declaration. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/identifier.mdx b/packages/app-web-docs/src/docs/user/scopes/identifier.mdx index cf2cabb1a0..830ee6958f 100644 --- a/packages/app-web-docs/src/docs/user/scopes/identifier.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/identifier.mdx @@ -14,7 +14,7 @@ Default: `identifier` ## Syntax -- identifier - Identifier. +- identifier - Identifier-style sequence, such as camelCase, snake_case, or kebab-case. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/ifStatement.mdx b/packages/app-web-docs/src/docs/user/scopes/ifStatement.mdx index 883ec027d2..d4f7bbe84c 100644 --- a/packages/app-web-docs/src/docs/user/scopes/ifStatement.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/ifStatement.mdx @@ -14,7 +14,7 @@ Default: `if state` ## Syntax -- if state - If statement. +- if state - Complete if statement. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/instance.mdx b/packages/app-web-docs/src/docs/user/scopes/instance.mdx index db251ec24b..86aad769c3 100644 --- a/packages/app-web-docs/src/docs/user/scopes/instance.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/instance.mdx @@ -14,7 +14,7 @@ Default: `instance` ## Syntax -- instance - Instance. +- instance - Occurrence matching the current instance. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/line.mdx b/packages/app-web-docs/src/docs/user/scopes/line.mdx index 2037ec188e..ea6c1a6faa 100644 --- a/packages/app-web-docs/src/docs/user/scopes/line.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/line.mdx @@ -14,7 +14,7 @@ Default: `line` ## Syntax -- line - Line. +- line - Line, without indentation. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/list.mdx b/packages/app-web-docs/src/docs/user/scopes/list.mdx index 384e5edc00..362e879c2f 100644 --- a/packages/app-web-docs/src/docs/user/scopes/list.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/list.mdx @@ -14,7 +14,7 @@ Default: `list` ## Syntax -- list - List. +- list - List or array. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/map.mdx b/packages/app-web-docs/src/docs/user/scopes/map.mdx index d0c5985bf6..b6da3855d8 100644 --- a/packages/app-web-docs/src/docs/user/scopes/map.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/map.mdx @@ -14,7 +14,7 @@ Default: `map` ## Syntax -- map - Map. +- map - Map, object, or dictionary. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/name.mdx b/packages/app-web-docs/src/docs/user/scopes/name.mdx index d2f5d9fc9c..39c36aa4ce 100644 --- a/packages/app-web-docs/src/docs/user/scopes/name.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/name.mdx @@ -14,7 +14,7 @@ Default: `name` ## Syntax -- name - Name. +- name - Name in a declaration, such as a variable or function name. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx b/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx index 5012903ab7..4ae0f275d3 100644 --- a/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/namedFunction.mdx @@ -14,7 +14,7 @@ Default: `funk` ## Syntax -- funk - Named function. +- funk - Named function declaration. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/namedParagraph.mdx b/packages/app-web-docs/src/docs/user/scopes/namedParagraph.mdx index 8396f232ae..55afe80ba5 100644 --- a/packages/app-web-docs/src/docs/user/scopes/namedParagraph.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/namedParagraph.mdx @@ -14,7 +14,7 @@ Default: `paragraph` ## Syntax -- paragraph - Named paragraph. +- paragraph - Named document paragraph and its contents. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/notebookCell.mdx b/packages/app-web-docs/src/docs/user/scopes/notebookCell.mdx index 497ceb816e..3be71e4309 100644 --- a/packages/app-web-docs/src/docs/user/scopes/notebookCell.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/notebookCell.mdx @@ -14,7 +14,7 @@ Default: `cell` ## Syntax -- cell - Notebook cell. +- cell - Notebook cell or Markdown fenced code block. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/paragraph.mdx b/packages/app-web-docs/src/docs/user/scopes/paragraph.mdx index 30abc74d01..9f77c3e393 100644 --- a/packages/app-web-docs/src/docs/user/scopes/paragraph.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/paragraph.mdx @@ -14,7 +14,7 @@ Default: `block` ## Syntax -- block - Paragraph. +- block - Paragraph, contiguous non-empty lines around the target. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/part.mdx b/packages/app-web-docs/src/docs/user/scopes/part.mdx index 5640eac56c..322db0d0fc 100644 --- a/packages/app-web-docs/src/docs/user/scopes/part.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/part.mdx @@ -14,7 +14,7 @@ Default: `part` ## Syntax -- part - Part. +- part - Document part and its contents. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/regularExpression.mdx b/packages/app-web-docs/src/docs/user/scopes/regularExpression.mdx index d10fd190fa..3c15712adf 100644 --- a/packages/app-web-docs/src/docs/user/scopes/regularExpression.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/regularExpression.mdx @@ -14,7 +14,7 @@ Default: `regex` ## Syntax -- regex - Regular expression. +- regex - Regular-expression literal. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/section.mdx b/packages/app-web-docs/src/docs/user/scopes/section.mdx index 9ff05e90da..c8d4e76295 100644 --- a/packages/app-web-docs/src/docs/user/scopes/section.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/section.mdx @@ -14,7 +14,7 @@ Default: `section` ## Syntax -- section - Section. +- section - Heading and its content through the next heading of the same or higher level. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/sectionLevelFive.mdx b/packages/app-web-docs/src/docs/user/scopes/sectionLevelFive.mdx index 96d159bb0d..f0bc7e49c3 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sectionLevelFive.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sectionLevelFive.mdx @@ -15,7 +15,7 @@ Default: `five section`\ ## Syntax -- five section - Section level five. +- five section - Level-five heading and its content. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/sectionLevelFour.mdx b/packages/app-web-docs/src/docs/user/scopes/sectionLevelFour.mdx index 0b0a25d0c1..24ebf15426 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sectionLevelFour.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sectionLevelFour.mdx @@ -15,7 +15,7 @@ Default: `four section`\ ## Syntax -- four section - Section level four. +- four section - Level-four heading and its content. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/sectionLevelOne.mdx b/packages/app-web-docs/src/docs/user/scopes/sectionLevelOne.mdx index b01ddff454..de34f5c132 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sectionLevelOne.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sectionLevelOne.mdx @@ -15,7 +15,7 @@ Default: `one section`\ ## Syntax -- one section - Section level one. +- one section - Level-one heading and its content. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/sectionLevelSix.mdx b/packages/app-web-docs/src/docs/user/scopes/sectionLevelSix.mdx index 74a361306d..4657c14d6c 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sectionLevelSix.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sectionLevelSix.mdx @@ -15,7 +15,7 @@ Default: `six section`\ ## Syntax -- six section - Section level six. +- six section - Level-six heading and its content. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/sectionLevelThree.mdx b/packages/app-web-docs/src/docs/user/scopes/sectionLevelThree.mdx index 3195801b36..8a6d26e185 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sectionLevelThree.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sectionLevelThree.mdx @@ -15,7 +15,7 @@ Default: `three section`\ ## Syntax -- three section - Section level three. +- three section - Level-three heading and its content. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/sectionLevelTwo.mdx b/packages/app-web-docs/src/docs/user/scopes/sectionLevelTwo.mdx index efdf17e0e7..8fe88e3c17 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sectionLevelTwo.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sectionLevelTwo.mdx @@ -15,7 +15,7 @@ Default: `two section`\ ## Syntax -- two section - Section level two. +- two section - Level-two heading and its content. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/selector.mdx b/packages/app-web-docs/src/docs/user/scopes/selector.mdx index de1707e7f3..6e1e7ec59e 100644 --- a/packages/app-web-docs/src/docs/user/scopes/selector.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/selector.mdx @@ -14,7 +14,7 @@ Default: `selector` ## Syntax -- selector - Selector. +- selector - CSS selector. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/sentence.mdx b/packages/app-web-docs/src/docs/user/scopes/sentence.mdx index eb2d297281..775011df5a 100644 --- a/packages/app-web-docs/src/docs/user/scopes/sentence.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/sentence.mdx @@ -14,7 +14,7 @@ Default: `sentence` ## Syntax -- sentence - Sentence. +- sentence - Text ending at sentence punctuation or a paragraph boundary. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/statement.mdx b/packages/app-web-docs/src/docs/user/scopes/statement.mdx index a36cbd9cf3..63eecf4799 100644 --- a/packages/app-web-docs/src/docs/user/scopes/statement.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/statement.mdx @@ -14,7 +14,7 @@ Default: `state` ## Syntax -- state - Statement. +- state - Complete statement, such as a variable declaration or expression statement. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/subParagraph.mdx b/packages/app-web-docs/src/docs/user/scopes/subParagraph.mdx index c9ac4a046f..1d6ff474ae 100644 --- a/packages/app-web-docs/src/docs/user/scopes/subParagraph.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/subParagraph.mdx @@ -14,7 +14,7 @@ Default: `subparagraph` ## Syntax -- subparagraph - Subparagraph. +- subparagraph - Document subparagraph and its contents. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/subSection.mdx b/packages/app-web-docs/src/docs/user/scopes/subSection.mdx index 5f4109fac9..6796f651c2 100644 --- a/packages/app-web-docs/src/docs/user/scopes/subSection.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/subSection.mdx @@ -14,7 +14,7 @@ Default: `subsection` ## Syntax -- subsection - Subsection. +- subsection - Document subsection and its contents. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/subSubSection.mdx b/packages/app-web-docs/src/docs/user/scopes/subSubSection.mdx index 9a3713e9e4..c6900f121c 100644 --- a/packages/app-web-docs/src/docs/user/scopes/subSubSection.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/subSubSection.mdx @@ -14,7 +14,7 @@ Default: `subsubsection` ## Syntax -- subsubsection - Subsubsection. +- subsubsection - Document subsubsection and its contents. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/surroundingPair.mdx b/packages/app-web-docs/src/docs/user/scopes/surroundingPair.mdx index e0c67316be..a7da0927b5 100644 --- a/packages/app-web-docs/src/docs/user/scopes/surroundingPair.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/surroundingPair.mdx @@ -6,7 +6,7 @@ Cursorless ID: `surroundingPair` ## Syntax -- `` - Surrounding pair. +- `` - Surrounding matching delimiter pair and its contents. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/token.mdx b/packages/app-web-docs/src/docs/user/scopes/token.mdx index 30b4c43950..4d90f074ef 100644 --- a/packages/app-web-docs/src/docs/user/scopes/token.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/token.mdx @@ -14,7 +14,7 @@ Default: `token` ## Syntax -- token - Token. +- token - Token such as a word, number, or operator. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/type.mdx b/packages/app-web-docs/src/docs/user/scopes/type.mdx index 34c1e71820..700e062499 100644 --- a/packages/app-web-docs/src/docs/user/scopes/type.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/type.mdx @@ -14,7 +14,7 @@ Default: `type` ## Syntax -- type - Type. +- type - Type annotation or declaration. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/unit.mdx b/packages/app-web-docs/src/docs/user/scopes/unit.mdx index 0591fc1394..ec021debbd 100644 --- a/packages/app-web-docs/src/docs/user/scopes/unit.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/unit.mdx @@ -14,7 +14,7 @@ Default: `unit` ## Syntax -- unit - Unit. +- unit - Unit suffix in a measurement, such as `px` in `100px`. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/url.mdx b/packages/app-web-docs/src/docs/user/scopes/url.mdx index 075752550d..77b2c7c01f 100644 --- a/packages/app-web-docs/src/docs/user/scopes/url.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/url.mdx @@ -14,7 +14,7 @@ Default: `link` ## Syntax -- link - URL. +- link - URL / Web address. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/value.mdx b/packages/app-web-docs/src/docs/user/scopes/value.mdx index f94b28fdd9..8d3f337088 100644 --- a/packages/app-web-docs/src/docs/user/scopes/value.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/value.mdx @@ -14,7 +14,7 @@ Default: `value` ## Syntax -- value - Value. +- value - Value in an assignment, collection entry, return statement, or similar construct. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/word.mdx b/packages/app-web-docs/src/docs/user/scopes/word.mdx index 827adab844..da48599e05 100644 --- a/packages/app-web-docs/src/docs/user/scopes/word.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/word.mdx @@ -15,7 +15,7 @@ Legacy: `word` ## Syntax -- sub - Sub token word. +- sub - Word-like component within a token, such as part of camelCase or snake_case. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/xmlBothTags.mdx b/packages/app-web-docs/src/docs/user/scopes/xmlBothTags.mdx index 224a3b4abb..61624b5d4c 100644 --- a/packages/app-web-docs/src/docs/user/scopes/xmlBothTags.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/xmlBothTags.mdx @@ -14,7 +14,7 @@ Default: `tags` ## Syntax -- tags - XML start and end tags. +- tags - Opening and closing XML, HTML, or JSX tags, or LaTeX `begin` and `end` commands. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/xmlElement.mdx b/packages/app-web-docs/src/docs/user/scopes/xmlElement.mdx index 1dcebbcaec..99cdcfcff3 100644 --- a/packages/app-web-docs/src/docs/user/scopes/xmlElement.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/xmlElement.mdx @@ -14,7 +14,7 @@ Default: `element` ## Syntax -- element - XML element. +- element - Complete XML, HTML, or JSX element, or a LaTeX environment. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/xmlEndTag.mdx b/packages/app-web-docs/src/docs/user/scopes/xmlEndTag.mdx index cf71693696..72248b7b17 100644 --- a/packages/app-web-docs/src/docs/user/scopes/xmlEndTag.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/xmlEndTag.mdx @@ -14,7 +14,7 @@ Default: `end tag` ## Syntax -- end tag - XML end tag. +- end tag - Closing XML, HTML, or JSX tag, or LaTeX `end` command. ## Examples diff --git a/packages/app-web-docs/src/docs/user/scopes/xmlStartTag.mdx b/packages/app-web-docs/src/docs/user/scopes/xmlStartTag.mdx index 789a03a6ca..56600039fe 100644 --- a/packages/app-web-docs/src/docs/user/scopes/xmlStartTag.mdx +++ b/packages/app-web-docs/src/docs/user/scopes/xmlStartTag.mdx @@ -14,7 +14,7 @@ Default: `start tag` ## Syntax -- start tag - XML start tag. +- start tag - Opening XML, HTML, or JSX tag, or LaTeX `begin` command. ## Examples diff --git a/packages/lib-common/src/references/actionReferenceGroups.ts b/packages/lib-common/src/references/actionReferenceGroups.ts index ce6f3549a3..ba324845f5 100644 --- a/packages/lib-common/src/references/actionReferenceGroups.ts +++ b/packages/lib-common/src/references/actionReferenceGroups.ts @@ -3,14 +3,12 @@ import type { ReferenceGroup } from "./ReferenceEntry"; export type ActionReferenceGroupId = | "cursor" | "change" - | "clone" | "clipboard" | "swap" | "indentation" | "numbers" | "emptyLines" | "homophones" - | "rename" | "scroll" | "insert" | "move" @@ -18,14 +16,15 @@ export type ActionReferenceGroupId = | "wrap" | "navigation" | "folding" - | "extract" - | "join" - | "break" + | "refactor" + | "joinBreak" | "visual" | "snippets" | "git" - | "editor" - | "targetContext" + | "format" + | "comment" + | "breakpoint" + | "instanceReference" | "private"; export const actionReferenceGroups: ReferenceGroup[] = [ @@ -38,95 +37,91 @@ export const actionReferenceGroups: ReferenceGroup[] = [ name: "Changing a target", }, { - id: "clone", - name: "Clone", + id: "clipboard", + name: "Cut / copy / paste", }, { - id: "clipboard", - name: "Cut, copy, and paste", + id: "insert", + name: "Insert / use / repeat", }, { id: "swap", name: "Swap", }, { - id: "indentation", - name: "Indent and outdent", + id: "move", + name: "Move / replace", }, { - id: "numbers", - name: "Increment and decrement", + id: "indentation", + name: "Indent / outdent", }, { id: "emptyLines", - name: "Insert empty lines or scopes", + name: "Insert empty lines / scopes", }, { - id: "homophones", - name: "Homophones", + id: "reorder", + name: "Reverse / shuffle / sort", }, { - id: "rename", - name: "Rename", + id: "wrap", + name: "Wrap / rewrap", }, { - id: "scroll", - name: "Scroll", + id: "numbers", + name: "Increment / decrement", }, { - id: "insert", - name: "Insert, use, and repeat", + id: "refactor", + name: "Refactor / fix", }, { - id: "move", - name: "Move and replace", + id: "joinBreak", + name: "Join / break", }, { - id: "reorder", - name: "Reverse, shuffle, and sort", + id: "snippets", + name: "Snippets", }, { - id: "wrap", - name: "Wrap and rewrap", + id: "scroll", + name: "Scroll", }, { - id: "navigation", - name: "Navigate and inspect", + id: "folding", + name: "Fold / unfold", }, { - id: "folding", - name: "Fold and unfold", + id: "homophones", + name: "Homophones", }, { - id: "extract", - name: "Extract", + id: "format", + name: "Format", }, { - id: "join", - name: "Join", + id: "instanceReference", + name: "Instance reference", }, { - id: "break", - name: "Break", + id: "comment", + name: "Comment", }, { - id: "visual", - name: "Visual feedback", + id: "breakpoint", + name: "Breakpoint", }, { - id: "snippets", - name: "Snippets", + id: "navigation", + name: "Navigate / inspect", }, { id: "git", name: "Git", }, { - id: "editor", - name: "Editor commands", - }, - { - id: "targetContext", - name: "Target context", + id: "visual", + name: "Visual feedback", }, ]; diff --git a/packages/lib-common/src/references/actionReferences.ts b/packages/lib-common/src/references/actionReferences.ts index c238dba6c0..7a62f7f044 100644 --- a/packages/lib-common/src/references/actionReferences.ts +++ b/packages/lib-common/src/references/actionReferences.ts @@ -216,11 +216,67 @@ export const actionReferences = { ], }, - // Group: clone + // Group: clipboard + cutToClipboard: { + name: "Cut to clipboard", + defaultSpokenForm: "carve", + group: { id: "clipboard", index: 0 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Cut ${VAR_TARGET} to clipboard.`, + cheatsheet: "Cut to clipboard", + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Cuts the ${TARGET_DESC} to the clipboard.`, + }, + ], + }, + copyToClipboard: { + name: "Copy to clipboard", + defaultSpokenForm: "copy", + group: { id: "clipboard", index: 1 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Copy ${VAR_TARGET} to clipboard.`, + cheatsheet: "Copy to clipboard", + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Copies the ${TARGET_DESC} to the clipboard.`, + }, + ], + }, + pasteFromClipboard: { + name: "Paste from clipboard", + defaultSpokenForm: "paste", + group: { id: "clipboard", index: 2 }, + syntaxes: [ + { + pattern: `${VAR_SPOKEN_FORM} ${VAR_DESTINATION}`, + description: `Paste from clipboard at ${VAR_DESTINATION}.`, + cheatsheet: `Paste from clipboard at ${VAR_DESTINATION}`, + }, + ], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${AFTER} ${TARGET}`, + description: `Pastes the clipboard contents after the ${TARGET_DESC}.`, + }, + ], + }, + + // Group: insert insertCopyAfter: { name: "Insert copy after", defaultSpokenForm: "clone", - group: { id: "clone", index: 0 }, + group: { id: "insert", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -238,7 +294,7 @@ export const actionReferences = { insertCopyBefore: { name: "Insert copy before", defaultSpokenForm: "clone up", - group: { id: "clone", index: 1 }, + group: { id: "insert", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -253,59 +309,57 @@ export const actionReferences = { }, ], }, - - // Group: clipboard - cutToClipboard: { - name: "Cut to clipboard", - defaultSpokenForm: "carve", - group: { id: "clipboard", index: 0 }, + replaceWithTarget: { + name: "Replace with target", + defaultSpokenForm: "bring", + group: { id: "insert", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Cut ${VAR_TARGET} to clipboard.`, - cheatsheet: "Cut to clipboard", + description: `Insert copy of ${VAR_TARGET} at selection.`, + cheatsheet: `Insert copy of ${VAR_TARGET} at selection`, + }, + { + pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET} ${VAR_DESTINATION}`, + description: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}.`, + cheatsheet: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}`, }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Cuts the ${TARGET_DESC} to the clipboard.`, + description: `Inserts a copy of the ${TARGET_DESC} at the current selection.`, + }, + { + command: `${VAR_SPOKEN_FORM} ${TARGET} ${TO} ${TARGET_2}`, + description: `Replaces the ${TARGET_2_DESC} with a copy of the ${TARGET_DESC}.`, }, ], }, - copyToClipboard: { - name: "Copy to clipboard", - defaultSpokenForm: "copy", - group: { id: "clipboard", index: 1 }, + callAsFunction: { + name: "Call as function", + defaultSpokenForm: "call", + group: { id: "insert", index: 3 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Copy ${VAR_TARGET} to clipboard.`, - cheatsheet: "Copy to clipboard", + description: `Insert call to ${VAR_TARGET} on selection.`, + cheatsheet: `Insert call to ${VAR_TARGET} on selection`, }, - ], - examples: [ { - command: DEFAULT_COMMAND, - description: `Copies the ${TARGET_DESC} to the clipboard.`, + pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET_1} ${ON} ${VAR_TARGET_2}`, + description: `Insert call to ${VAR_TARGET_1} on ${VAR_TARGET_2}.`, + cheatsheet: `Insert call to ${VAR_TARGET_1} on ${VAR_TARGET_2}`, }, ], - }, - pasteFromClipboard: { - name: "Paste from clipboard", - defaultSpokenForm: "paste", - group: { id: "clipboard", index: 2 }, - syntaxes: [ + examples: [ { - pattern: `${VAR_SPOKEN_FORM} ${VAR_DESTINATION}`, - description: `Paste from clipboard at ${VAR_DESTINATION}.`, - cheatsheet: `Paste from clipboard at ${VAR_DESTINATION}`, + command: DEFAULT_COMMAND, + description: `Inserts a call to the ${TARGET_DESC} at the current selection.`, }, - ], - examples: [ { - command: `${VAR_SPOKEN_FORM} ${AFTER} ${TARGET}`, - description: `Pastes the clipboard contents after the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${TARGET} ${ON} ${TARGET_2}`, + description: `Inserts a call to the ${TARGET_DESC} on the ${TARGET_2_DESC}.`, }, ], }, @@ -339,6 +393,35 @@ export const actionReferences = { ], }, + // Group: move + moveToTarget: { + name: "Move to target", + defaultSpokenForm: "move", + group: { id: "move", index: 0 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: `Move ${VAR_TARGET} to selection.`, + cheatsheet: `Move ${VAR_TARGET} to selection`, + }, + { + pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET} ${VAR_DESTINATION}`, + description: `Move ${VAR_TARGET} to ${VAR_DESTINATION}.`, + cheatsheet: `Move ${VAR_TARGET} to ${VAR_DESTINATION}`, + }, + ], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Moves the ${TARGET_DESC} to the current selection.`, + }, + { + command: `${VAR_SPOKEN_FORM} ${TARGET} ${AFTER} ${TARGET_2}`, + description: `Moves the ${TARGET_DESC} to after the ${TARGET_2_DESC}.`, + }, + ], + }, + // Group: indentation indentLine: { name: "Indent line", @@ -377,44 +460,6 @@ export const actionReferences = { ], }, - // Group: numbers - increment: { - name: "Increment", - defaultSpokenForm: "increment", - group: { id: "numbers", index: 0 }, - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: `Increment number at ${VAR_TARGET}.`, - cheatsheet: "Increment number", - }, - ], - examples: [ - { - command: `${VAR_SPOKEN_FORM} ${TARGET_NUMBER}`, - description: `Increments the ${TARGET_NUMBER_DESC}.`, - }, - ], - }, - decrement: { - name: "Decrement", - defaultSpokenForm: "decrement", - group: { id: "numbers", index: 1 }, - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: `Decrement number at ${VAR_TARGET}.`, - cheatsheet: "Decrement number", - }, - ], - examples: [ - { - command: `${VAR_SPOKEN_FORM} ${TARGET_NUMBER}`, - description: `Decrements the number at the ${TARGET_NUMBER_DESC}.`, - }, - ], - }, - // Group: emptyLines editNewLineBefore: { name: "Edit new line/scope before", @@ -539,643 +584,646 @@ export const actionReferences = { ], }, - // Group: homophones - nextHomophone: { - name: "Next homophone", - defaultSpokenForm: "phones", - group: { id: "homophones", index: 0 }, + // Group: reorder + reverseTargets: { + name: "Reverse targets", + defaultSpokenForm: "reverse", + group: { id: "reorder", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Cycle to next homophone for ${VAR_TARGET}.`, - cheatsheet: "Cycle to next homophone", + description: `Reverse ${VAR_TARGET}s.`, + cheatsheet: "Reverse targets", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Replaces the ${TARGET_DESC} with its next homophone.`, + command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, + description: `Reverses the collection items associated with the ${TARGET_DESC}.`, }, ], }, - - // Group: rename - rename: { - name: "Rename", - defaultSpokenForm: "rename", - group: { id: "rename", index: 0 }, + randomizeTargets: { + name: "Randomize targets", + defaultSpokenForm: "shuffle", + group: { id: "reorder", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Rename ${VAR_TARGET}.`, - cheatsheet: "Rename", + description: `Randomize ${VAR_TARGET}s.`, + cheatsheet: "Randomize targets", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Starts renaming the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, + description: `Randomizes the collection items associated with the ${TARGET_DESC}.`, }, ], }, - - // Group: scroll - scrollToTop: { - name: "Scroll to top", - defaultSpokenForm: "crown", - group: { id: "scroll", index: 0 }, + sortTargets: { + name: "Sort targets", + defaultSpokenForm: "sort", + group: { id: "reorder", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Scroll ${VAR_TARGET} to top of the viewport.`, - cheatsheet: "Scroll to top", + description: `Sort ${VAR_TARGET}s.`, + cheatsheet: "Sort targets", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Scrolls the ${TARGET_DESC} to the top of the viewport.`, + command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, + description: `Sorts the collection items associated with the ${TARGET_DESC}.`, }, ], }, - scrollToCenter: { - name: "Scroll to center", - defaultSpokenForm: "center", - group: { id: "scroll", index: 1 }, + + // Group: wrap + wrapWithPairedDelimiter: { + name: "Wrap with paired delimiter/snippet", + defaultSpokenForm: "wrap", + group: { id: "wrap", index: 0 }, syntaxes: [ { - pattern: DEFAULT_PATTERN, - description: `Scroll ${VAR_TARGET} to center of the viewport.`, - cheatsheet: "Scroll to center", + pattern: `${VAR_PAIR} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, + description: `Wrap ${VAR_TARGET} with ${VAR_PAIR}.`, + cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_PAIR}`, }, - ], - examples: [ { - command: DEFAULT_COMMAND, - description: `Scrolls the ${TARGET_DESC} to the center of the viewport.`, + pattern: `${VAR_SNIPPET} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, + description: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}.`, + cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}`, + }, + ], + examples: [ + { + command: `${SQUARE} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Wraps the ${TARGET_DESC} in square brackets.`, + }, + { + command: `${SNIPPET_IF} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Wraps the ${TARGET_DESC} in an if-statement snippet.`, }, ], }, - scrollToBottom: { - name: "Scroll to bottom", - defaultSpokenForm: "bottom", - group: { id: "scroll", index: 2 }, + rewrapWithPairedDelimiter: { + name: "Rewrap with paired delimiter", + defaultSpokenForm: "repack", + group: { id: "wrap", index: 1 }, syntaxes: [ { - pattern: DEFAULT_PATTERN, - description: `Scroll ${VAR_TARGET} to bottom of the viewport.`, - cheatsheet: "Scroll to bottom", + pattern: `${VAR_PAIR} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, + description: `Rewrap ${VAR_TARGET} with ${VAR_PAIR}.`, + cheatsheet: `Rewrap ${VAR_TARGET} with ${VAR_PAIR}`, }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Scrolls the ${TARGET_DESC} to the bottom of the viewport.`, + command: `${CURLY} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Replaces the paired delimiters around the ${TARGET_DESC} with curly brackets.`, }, ], }, - // Group: insert - replaceWithTarget: { - name: "Replace with target", - defaultSpokenForm: "bring", - group: { id: "insert", index: 0 }, + // Group: numbers + increment: { + name: "Increment", + defaultSpokenForm: "increment", + group: { id: "numbers", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Insert copy of ${VAR_TARGET} at selection.`, - cheatsheet: `Insert copy of ${VAR_TARGET} at selection`, - }, - { - pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET} ${VAR_DESTINATION}`, - description: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}.`, - cheatsheet: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}`, + description: `Increment number at ${VAR_TARGET}.`, + cheatsheet: "Increment number", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Inserts a copy of the ${TARGET_DESC} at the current selection.`, - }, - { - command: `${VAR_SPOKEN_FORM} ${TARGET} ${TO} ${TARGET_2}`, - description: `Replaces the ${TARGET_2_DESC} with a copy of the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${TARGET_NUMBER}`, + description: `Increments the ${TARGET_NUMBER_DESC}.`, }, ], }, - callAsFunction: { - name: "Call as function", - defaultSpokenForm: "call", - group: { id: "insert", index: 1 }, + decrement: { + name: "Decrement", + defaultSpokenForm: "decrement", + group: { id: "numbers", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Insert call to ${VAR_TARGET} on selection.`, - cheatsheet: `Insert call to ${VAR_TARGET} on selection`, - }, - { - pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET_1} ${ON} ${VAR_TARGET_2}`, - description: `Insert call to ${VAR_TARGET_1} on ${VAR_TARGET_2}.`, - cheatsheet: `Insert call to ${VAR_TARGET_1} on ${VAR_TARGET_2}`, + description: `Decrement number at ${VAR_TARGET}.`, + cheatsheet: "Decrement number", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Inserts a call to the ${TARGET_DESC} at the current selection.`, - }, - { - command: `${VAR_SPOKEN_FORM} ${TARGET} ${ON} ${TARGET_2}`, - description: `Inserts a call to the ${TARGET_DESC} on the ${TARGET_2_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${TARGET_NUMBER}`, + description: `Decrements the number at the ${TARGET_NUMBER_DESC}.`, }, ], }, - // Group: move - moveToTarget: { - name: "Move to target", - defaultSpokenForm: "move", - group: { id: "move", index: 0 }, + // Group: refactor + rename: { + name: "Rename", + defaultSpokenForm: "rename", + group: { id: "refactor", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Move ${VAR_TARGET} to selection.`, - cheatsheet: `Move ${VAR_TARGET} to selection`, - }, - { - pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET} ${VAR_DESTINATION}`, - description: `Move ${VAR_TARGET} to ${VAR_DESTINATION}.`, - cheatsheet: `Move ${VAR_TARGET} to ${VAR_DESTINATION}`, + description: `Rename ${VAR_TARGET}.`, + cheatsheet: "Rename", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Moves the ${TARGET_DESC} to the current selection.`, - }, - { - command: `${VAR_SPOKEN_FORM} ${TARGET} ${AFTER} ${TARGET_2}`, - description: `Moves the ${TARGET_DESC} to after the ${TARGET_2_DESC}.`, + description: `Starts renaming the ${TARGET_DESC}.`, }, ], }, - - // Group: reorder - reverseTargets: { - name: "Reverse targets", - defaultSpokenForm: "reverse", - group: { id: "reorder", index: 0 }, + extractVariable: { + name: "Extract variable", + defaultSpokenForm: "extract", + group: { id: "refactor", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Reverse ${VAR_TARGET}s.`, - cheatsheet: "Reverse targets", + description: `Extract variable from ${VAR_TARGET}.`, + cheatsheet: "Extract variable", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, - description: `Reverses the collection items associated with the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${VALUE} ${TARGET}`, + description: `Extracts the value containing the ${TARGET_DESC} into a variable.`, }, ], }, - randomizeTargets: { - name: "Randomize targets", - defaultSpokenForm: "shuffle", - group: { id: "reorder", index: 1 }, + showQuickFix: { + name: "Show quick fix", + defaultSpokenForm: "quick fix", + group: { id: "refactor", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Randomize ${VAR_TARGET}s.`, - cheatsheet: "Randomize targets", + description: `Show quick fix for ${VAR_TARGET}.`, + cheatsheet: "Show quick fix", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, - description: `Randomizes the collection items associated with the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Shows quick fixes for the ${TARGET_DESC}.`, }, ], }, - sortTargets: { - name: "Sort targets", - defaultSpokenForm: "sort", - group: { id: "reorder", index: 2 }, + + // Group: joinBreak + joinLines: { + name: "Join lines", + defaultSpokenForm: "join", + group: { id: "joinBreak", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Sort ${VAR_TARGET}s.`, - cheatsheet: "Sort targets", + description: `Join lines at ${VAR_TARGET}.`, + cheatsheet: "Join lines", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, - description: `Sorts the collection items associated with the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Joins the line containing the ${TARGET_DESC} with the following line.`, }, ], }, - - // Group: wrap - wrapWithPairedDelimiter: { - name: "Wrap with paired delimiter/snippet", - defaultSpokenForm: "wrap", - group: { id: "wrap", index: 0 }, + breakLine: { + name: "Break line", + defaultSpokenForm: "break", + group: { id: "joinBreak", index: 1 }, syntaxes: [ { - pattern: `${VAR_PAIR} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, - description: `Wrap ${VAR_TARGET} with ${VAR_PAIR}.`, - cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_PAIR}`, + pattern: DEFAULT_PATTERN, + description: `Breaks the line before ${VAR_TARGET}.`, + cheatsheet: "Breaks the line", }, + ], + examples: [ { - pattern: `${VAR_SNIPPET} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, - description: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}.`, - cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}`, + command: DEFAULT_COMMAND, + description: `Breaks the line before the ${TARGET_DESC}.`, }, ], - examples: [ + }, + + // Group: snippets + generateSnippet: { + name: "Generate snippet", + defaultSpokenForm: "snip make", + group: { id: "snippets", index: 0 }, + legacySpokenForms: ["snippet make"], + syntaxes: [ { - command: `${SQUARE} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Wraps the ${TARGET_DESC} in square brackets.`, + pattern: DEFAULT_PATTERN, + description: `Generate snippet from ${VAR_TARGET}.`, + cheatsheet: "Generate snippet", }, + ], + examples: [ { - command: `${SNIPPET_IF} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Wraps the ${TARGET_DESC} in an if-statement snippet.`, + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Generates a snippet from the function containing the ${TARGET_DESC}.`, }, ], }, - rewrapWithPairedDelimiter: { - name: "Rewrap with paired delimiter", - defaultSpokenForm: "repack", - group: { id: "wrap", index: 1 }, + insertSnippet: { + name: "Insert snippet", + defaultSpokenForm: "snip", + group: { id: "snippets", index: 1 }, syntaxes: [ { - pattern: `${VAR_PAIR} ${VAR_SPOKEN_FORM} ${VAR_TARGET}`, - description: `Rewrap ${VAR_TARGET} with ${VAR_PAIR}.`, - cheatsheet: `Rewrap ${VAR_TARGET} with ${VAR_PAIR}`, + pattern: `${VAR_SPOKEN_FORM} ${VAR_SNIPPET} ${VAR_DESTINATION}`, + description: `Insert snippet at ${VAR_DESTINATION}.`, + cheatsheet: `Insert snippet at ${VAR_DESTINATION}`, }, ], examples: [ { - command: `${CURLY} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Replaces the paired delimiters around the ${TARGET_DESC} with curly brackets.`, + command: `${VAR_SPOKEN_FORM} ${SNIPPET_IF} ${AFTER} ${TARGET}`, + description: `Inserts an if-statement snippet after the ${TARGET_DESC}.`, }, ], }, - // Group: navigation - revealDefinition: { - name: "Reveal definition", - defaultSpokenForm: "define", - group: { id: "navigation", index: 0 }, + // Group: scroll + scrollToTop: { + name: "Scroll to top", + defaultSpokenForm: "crown", + group: { id: "scroll", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Reveal definition of ${VAR_TARGET}.`, - cheatsheet: "Reveal definition", + description: `Scroll ${VAR_TARGET} to top of the viewport.`, + cheatsheet: "Scroll to top", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Opens the definition of the ${TARGET_DESC}.`, + description: `Scrolls the ${TARGET_DESC} to the top of the viewport.`, }, ], }, - revealTypeDefinition: { - name: "Reveal type definition", - defaultSpokenForm: "type deaf", - group: { id: "navigation", index: 1 }, + scrollToCenter: { + name: "Scroll to center", + defaultSpokenForm: "center", + group: { id: "scroll", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Reveal type definition of ${VAR_TARGET}.`, - cheatsheet: "Reveal type definition", + description: `Scroll ${VAR_TARGET} to center of the viewport.`, + cheatsheet: "Scroll to center", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Opens the type definition of the ${TARGET_DESC}.`, + description: `Scrolls the ${TARGET_DESC} to the center of the viewport.`, }, ], }, - showReferences: { - name: "Show references", - defaultSpokenForm: "reference", - group: { id: "navigation", index: 2 }, + scrollToBottom: { + name: "Scroll to bottom", + defaultSpokenForm: "bottom", + group: { id: "scroll", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Show references for ${VAR_TARGET}.`, - cheatsheet: "Show references", + description: `Scroll ${VAR_TARGET} to bottom of the viewport.`, + cheatsheet: "Scroll to bottom", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Shows references to the ${TARGET_DESC}.`, + description: `Scrolls the ${TARGET_DESC} to the bottom of the viewport.`, }, ], }, - showHover: { - name: "Show hover", - defaultSpokenForm: "hover", - group: { id: "navigation", index: 3 }, + + // Group: folding + foldRegion: { + name: "Fold region", + defaultSpokenForm: "fold", + group: { id: "folding", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Show hover for ${VAR_TARGET}.`, - cheatsheet: "Show hover", + description: `Fold region at ${VAR_TARGET}.`, + cheatsheet: "Fold region", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Shows hover information for the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Folds the function containing the ${TARGET_DESC}.`, }, ], }, - showQuickFix: { - name: "Show quick fix", - defaultSpokenForm: "quick fix", - group: { id: "navigation", index: 4 }, + unfoldRegion: { + name: "Unfold region", + defaultSpokenForm: "unfold", + group: { id: "folding", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Show quick fix for ${VAR_TARGET}.`, - cheatsheet: "Show quick fix", + description: `Unfold region at ${VAR_TARGET}.`, + cheatsheet: "Unfold region", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Shows quick fixes for the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Unfolds the function containing the ${TARGET_DESC}.`, }, ], }, - findInDocument: { - name: "Find in document", - defaultSpokenForm: "scout", - group: { id: "navigation", index: 5 }, + + // Group: homophones + nextHomophone: { + name: "Next homophone", + defaultSpokenForm: "phones", + group: { id: "homophones", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Find ${VAR_TARGET} in document.`, - cheatsheet: "Find in document", + description: `Cycle to next homophone for ${VAR_TARGET}.`, + cheatsheet: "Cycle to next homophone", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Searches the current document for the ${TARGET_DESC}.`, + description: `Replaces the ${TARGET_DESC} with its next homophone.`, }, ], }, - findInWorkspace: { - name: "Find in workspace", - defaultSpokenForm: "scout all", - group: { id: "navigation", index: 6 }, + + // Group: format + applyFormatter: { + name: "Apply formatter", + defaultSpokenForm: "format", + group: { id: "format", index: 0 }, syntaxes: [ { - pattern: DEFAULT_PATTERN, - description: `Find ${VAR_TARGET} in workspace.`, - cheatsheet: "Find in workspace", + pattern: `${VAR_SPOKEN_FORM} ${VAR_FORMATTER} ${AT} ${VAR_TARGET}`, + description: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}.`, + cheatsheet: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}`, }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Searches the workspace for the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${FORMATTER_CAMEL} ${AT} ${TARGET}`, + description: `Reformats the ${TARGET_DESC} as camel case.`, }, ], }, - followLink: { - name: "Follow link", - defaultSpokenForm: "follow", - group: { id: "navigation", index: 7 }, + + // Group: instanceReference + "experimental.setInstanceReference": { + name: "Set instance reference", + defaultSpokenForm: "from", + group: { id: "instanceReference", index: 0 }, + description: + "Sets the instance reference for the next 'instance of' action.", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Follow link at ${VAR_TARGET}.`, - cheatsheet: "Follow link", + description: `Set instance reference to ${VAR_TARGET}.`, + cheatsheet: "Set instance reference", }, ], examples: [ { - command: DEFAULT_COMMAND, - description: `Opens the link containing the ${TARGET_DESC}.`, + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET} ${SET_SELECTION} ${EVERY} ${INSTANCE} ${TARGET_2}`, + description: `Selects every instance of the ${TARGET_2_DESC} within the function containing the ${TARGET_DESC}.`, }, ], }, - followLinkAside: { - name: "Follow link aside", - defaultSpokenForm: "follow split", - group: { id: "navigation", index: 8 }, + + // Group: comment + toggleLineComment: { + name: "Toggle line comment", + defaultSpokenForm: "comment", + group: { id: "comment", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Follow link at ${VAR_TARGET} aside (e.g. in a split view).`, - cheatsheet: "Follow link aside", + description: `Toggle line comment at ${VAR_TARGET}.`, + cheatsheet: "Toggle line comment", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Opens the link containing the ${TARGET_DESC} in a split view.`, + description: `Toggles the comment on the line containing the ${TARGET_DESC}.`, }, ], }, - showDebugHover: { - name: "Show debug hover", - defaultSpokenForm: "inspect", - group: { id: "navigation", index: 9 }, + + // Group: breakpoint + toggleLineBreakpoint: { + name: "Toggle line/scope breakpoint", + defaultSpokenForm: "break point", + group: { id: "breakpoint", index: 0 }, + description: "Scope defaults to line.", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Show debug hover for ${VAR_TARGET}.`, - cheatsheet: "Show debug hover", + description: `Toggle breakpoint on line containing ${VAR_TARGET}.`, + cheatsheet: "Toggle line breakpoint", + }, + { + pattern: `${VAR_SPOKEN_FORM} ${TOKEN} ${VAR_TARGET}`, + description: `Toggle inline breakpoint at ${VAR_TARGET}.`, + cheatsheet: "Toggle inline breakpoint", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Shows debug information for the ${TARGET_DESC}.`, + description: `Toggles a breakpoint on the line containing the ${TARGET_DESC}.`, + }, + { + command: `${VAR_SPOKEN_FORM} ${TOKEN} ${TARGET}`, + description: `Toggles an inline breakpoint at the ${TARGET_DESC}.`, }, ], }, - // Group: folding - foldRegion: { - name: "Fold region", - defaultSpokenForm: "fold", - group: { id: "folding", index: 0 }, + // Group: navigation + revealDefinition: { + name: "Reveal definition", + defaultSpokenForm: "define", + group: { id: "navigation", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Fold region at ${VAR_TARGET}.`, - cheatsheet: "Fold region", + description: `Reveal definition of ${VAR_TARGET}.`, + cheatsheet: "Reveal definition", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, - description: `Folds the function containing the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Opens the definition of the ${TARGET_DESC}.`, }, ], }, - unfoldRegion: { - name: "Unfold region", - defaultSpokenForm: "unfold", - group: { id: "folding", index: 1 }, + revealTypeDefinition: { + name: "Reveal type definition", + defaultSpokenForm: "type deaf", + group: { id: "navigation", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Unfold region at ${VAR_TARGET}.`, - cheatsheet: "Unfold region", + description: `Reveal type definition of ${VAR_TARGET}.`, + cheatsheet: "Reveal type definition", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, - description: `Unfolds the function containing the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Opens the type definition of the ${TARGET_DESC}.`, }, ], }, - - // Group: extract - extractVariable: { - name: "Extract variable", - defaultSpokenForm: "extract", - group: { id: "extract", index: 0 }, + showReferences: { + name: "Show references", + defaultSpokenForm: "reference", + group: { id: "navigation", index: 2 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Extract variable from ${VAR_TARGET}.`, - cheatsheet: "Extract variable", + description: `Show references for ${VAR_TARGET}.`, + cheatsheet: "Show references", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${VALUE} ${TARGET}`, - description: `Extracts the value containing the ${TARGET_DESC} into a variable.`, + command: DEFAULT_COMMAND, + description: `Shows references to the ${TARGET_DESC}.`, }, ], }, - - // Group: join - joinLines: { - name: "Join lines", - defaultSpokenForm: "join", - group: { id: "join", index: 0 }, + showHover: { + name: "Show hover", + defaultSpokenForm: "hover", + group: { id: "navigation", index: 3 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Join lines at ${VAR_TARGET}.`, - cheatsheet: "Join lines", + description: `Show hover for ${VAR_TARGET}.`, + cheatsheet: "Show hover", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Joins the line containing the ${TARGET_DESC} with the following line.`, + description: `Shows hover information for the ${TARGET_DESC}.`, }, ], }, - - // Group: break - breakLine: { - name: "Break line", - defaultSpokenForm: "break", - group: { id: "break", index: 0 }, + findInDocument: { + name: "Find in document", + defaultSpokenForm: "scout", + group: { id: "navigation", index: 4 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Breaks the line before ${VAR_TARGET}.`, - cheatsheet: "Breaks the line", + description: `Find ${VAR_TARGET} in document.`, + cheatsheet: "Find in document", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Breaks the line before the ${TARGET_DESC}.`, + description: `Searches the current document for the ${TARGET_DESC}.`, }, ], }, - - // Group: visual - flashTargets: { - name: "Flash target", - defaultSpokenForm: "flash", - group: { id: "visual", index: 0 }, + findInWorkspace: { + name: "Find in workspace", + defaultSpokenForm: "scout all", + group: { id: "navigation", index: 5 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Flash ${VAR_TARGET}.`, - cheatsheet: "Flash target", + description: `Find ${VAR_TARGET} in workspace.`, + cheatsheet: "Find in workspace", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Briefly flashes the ${TARGET_DESC}.`, + description: `Searches the workspace for the ${TARGET_DESC}.`, }, ], }, - highlight: { - name: "Highlight", - defaultSpokenForm: "highlight", - group: { id: "visual", index: 1 }, + followLink: { + name: "Follow link", + defaultSpokenForm: "follow", + group: { id: "navigation", index: 6 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Highlight ${VAR_TARGET}.`, - cheatsheet: "Highlight", + description: `Follow link at ${VAR_TARGET}.`, + cheatsheet: "Follow link", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Highlights the ${TARGET_DESC}.`, + description: `Opens the link containing the ${TARGET_DESC}.`, }, ], }, - - // Group: snippets - generateSnippet: { - name: "Generate snippet", - defaultSpokenForm: "snip make", - group: { id: "snippets", index: 0 }, - legacySpokenForms: ["snippet make"], + followLinkAside: { + name: "Follow link aside", + defaultSpokenForm: "follow split", + group: { id: "navigation", index: 7 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Generate snippet from ${VAR_TARGET}.`, - cheatsheet: "Generate snippet", + description: `Follow link at ${VAR_TARGET} aside (e.g. in a split view).`, + cheatsheet: "Follow link aside", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, - description: `Generates a snippet from the function containing the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Opens the link containing the ${TARGET_DESC} in a split view.`, }, ], }, - insertSnippet: { - name: "Insert snippet", - defaultSpokenForm: "snip", - group: { id: "snippets", index: 1 }, + showDebugHover: { + name: "Show debug hover", + defaultSpokenForm: "inspect", + group: { id: "navigation", index: 8 }, syntaxes: [ { - pattern: `${VAR_SPOKEN_FORM} ${VAR_SNIPPET} ${VAR_DESTINATION}`, - description: `Insert snippet at ${VAR_DESTINATION}.`, - cheatsheet: `Insert snippet at ${VAR_DESTINATION}`, + pattern: DEFAULT_PATTERN, + description: `Show debug hover for ${VAR_TARGET}.`, + cheatsheet: "Show debug hover", }, ], examples: [ { - command: `${VAR_SPOKEN_FORM} ${SNIPPET_IF} ${AFTER} ${TARGET}`, - description: `Inserts an if-statement snippet after the ${TARGET_DESC}.`, + command: DEFAULT_COMMAND, + description: `Shows debug information for the ${TARGET_DESC}.`, }, ], }, @@ -1254,90 +1302,40 @@ export const actionReferences = { ], }, - // Group: editor - applyFormatter: { - name: "Apply formatter", - defaultSpokenForm: "format", - group: { id: "editor", index: 0 }, - syntaxes: [ - { - pattern: `${VAR_SPOKEN_FORM} ${VAR_FORMATTER} ${AT} ${VAR_TARGET}`, - description: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}.`, - cheatsheet: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}`, - }, - ], - examples: [ - { - command: `${VAR_SPOKEN_FORM} ${FORMATTER_CAMEL} ${AT} ${TARGET}`, - description: `Reformats the ${TARGET_DESC} as camel case.`, - }, - ], - }, - toggleLineComment: { - name: "Toggle line comment", - defaultSpokenForm: "comment", - group: { id: "editor", index: 1 }, + // Group: visual + flashTargets: { + name: "Flash target", + defaultSpokenForm: "flash", + group: { id: "visual", index: 0 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Toggle line comment at ${VAR_TARGET}.`, - cheatsheet: "Toggle line comment", + description: `Flash ${VAR_TARGET}.`, + cheatsheet: "Flash target", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Toggles the comment on the line containing the ${TARGET_DESC}.`, + description: `Briefly flashes the ${TARGET_DESC}.`, }, ], }, - toggleLineBreakpoint: { - name: "Toggle line/scope breakpoint", - defaultSpokenForm: "break point", - group: { id: "editor", index: 2 }, - description: "Scope defaults to line.", + highlight: { + name: "Highlight", + defaultSpokenForm: "highlight", + group: { id: "visual", index: 1 }, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: `Toggle breakpoint on line containing ${VAR_TARGET}.`, - cheatsheet: "Toggle line breakpoint", - }, - { - pattern: `${VAR_SPOKEN_FORM} ${TOKEN} ${VAR_TARGET}`, - description: `Toggle inline breakpoint at ${VAR_TARGET}.`, - cheatsheet: "Toggle inline breakpoint", + description: `Highlight ${VAR_TARGET}.`, + cheatsheet: "Highlight", }, ], examples: [ { command: DEFAULT_COMMAND, - description: `Toggles a breakpoint on the line containing the ${TARGET_DESC}.`, - }, - { - command: `${VAR_SPOKEN_FORM} ${TOKEN} ${TARGET}`, - description: `Toggles an inline breakpoint at the ${TARGET_DESC}.`, - }, - ], - }, - - // Group: targetContext - "experimental.setInstanceReference": { - name: "Set instance reference", - defaultSpokenForm: "from", - group: { id: "targetContext", index: 0 }, - description: - "Sets the instance reference for the next 'instance of' action.", - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: `Set instance reference to ${VAR_TARGET}.`, - cheatsheet: "Set instance reference", - }, - ], - examples: [ - { - command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET} ${SET_SELECTION} ${EVERY} ${INSTANCE} ${TARGET_2}`, - description: `Selects every instance of the ${TARGET_2_DESC} within the function containing the ${TARGET_DESC}.`, + description: `Highlights the ${TARGET_DESC}.`, }, ], }, diff --git a/packages/lib-common/src/references/modifierReferenceGroups.ts b/packages/lib-common/src/references/modifierReferenceGroups.ts index 345ba069b0..373d5eda89 100644 --- a/packages/lib-common/src/references/modifierReferenceGroups.ts +++ b/packages/lib-common/src/references/modifierReferenceGroups.ts @@ -3,7 +3,9 @@ import type { ReferenceGroup } from "./ReferenceEntry"; export type ModifierReferenceGroupId = | "position" | "delimiters" - | "scope" + | "containing" + | "ordinal" + | "relative" | "range" | "filters" | "inference" @@ -12,21 +14,29 @@ export type ModifierReferenceGroupId = export const modifierReferenceGroups: ReferenceGroup[] = [ { - id: "position", - name: "Positions", + id: "containing", + name: "Scope containment", }, { - id: "delimiters", - name: "Interiors and delimiters", + id: "ordinal", + name: "Ordinal scope", + }, + { + id: "relative", + name: "Relative scope", }, { - id: "scope", - name: "Scope navigation", + id: "delimiters", + name: "Interiors / delimiters", }, { id: "range", name: "Range extension", }, + { + id: "position", + name: "Positions", + }, { id: "filters", name: "Filters", diff --git a/packages/lib-common/src/references/modifierReferences.ts b/packages/lib-common/src/references/modifierReferences.ts index 4c080ffec7..df63d75d9a 100644 --- a/packages/lib-common/src/references/modifierReferences.ts +++ b/packages/lib-common/src/references/modifierReferences.ts @@ -36,122 +36,10 @@ const LAST = connectiveDefaultSpokenForms.last; type AdditionalModifierReferenceType = "ancestor"; export const modifierReferences = { - // Group: position - startOf: { - name: "Start of", - defaultSpokenForm: "start of", - group: { id: "position", index: 0 }, - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: "Empty position at start of target.", - cheatsheet: "Empty position at start of target", - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Places the cursor at the start of the ${TARGET_DESC}.`, - }, - ], - }, - endOf: { - name: "End of", - defaultSpokenForm: "end of", - group: { id: "position", index: 1 }, - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: "Empty position at end of target.", - cheatsheet: "Empty position at end of target", - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Places the cursor at the end of the ${TARGET_DESC}.`, - }, - ], - }, - - // Group: delimiters - interiorOnly: { - name: "Interior only", - defaultSpokenForm: "inside", - group: { id: "delimiters", index: 0 }, - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: "Interior only.", - cheatsheet: "Interior only", - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${PARENTHESES} ${TARGET}`, - description: `Selects the contents of the parentheses containing the ${TARGET_DESC}, excluding the parentheses.`, - }, - ], - }, - excludeInterior: { - name: "Exclude interior", - defaultSpokenForm: "bounds", - group: { id: "delimiters", index: 1 }, - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: "Bounding paired delimiters.", - cheatsheet: "Bounding paired delimiters", - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${PARENTHESES} ${TARGET}`, - description: `Selects only the parentheses containing the ${TARGET_DESC}.`, - }, - ], - }, - leading: { - name: "Leading", - defaultSpokenForm: "leading", - group: { id: "delimiters", index: 2 }, - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: "Leading delimiter range.", - cheatsheet: "Leading delimiter range", - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, - description: `Selects the leading delimiter of the item containing the ${TARGET_DESC}.`, - }, - ], - }, - trailing: { - name: "Trailing", - defaultSpokenForm: "trailing", - group: { id: "delimiters", index: 3 }, - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: "Trailing delimiter range.", - cheatsheet: "Trailing delimiter range", - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, - description: `Selects the trailing delimiter of the item containing the ${TARGET_DESC}.`, - }, - ], - }, - - // Group: scope + // Group: containing containingScope: { name: "Containing scope", - group: { id: "scope", index: 0 }, + group: { id: "containing", index: 0 }, syntaxes: [ { pattern: VAR_SCOPE, @@ -169,7 +57,7 @@ export const modifierReferences = { everyScope: { name: "Every scope", defaultSpokenForm: EVERY, - group: { id: "scope", index: 1 }, + group: { id: "containing", index: 1 }, syntaxes: [ { pattern: `${VAR_SPOKEN_FORM} ${VAR_SCOPE}`, @@ -187,7 +75,7 @@ export const modifierReferences = { ancestor: { name: "Ancestor", defaultSpokenForm: "grand", - group: { id: "scope", index: 2 }, + group: { id: "containing", index: 2 }, syntaxes: [ { pattern: `${VAR_SPOKEN_FORM} ${VAR_SCOPE}`, @@ -202,9 +90,11 @@ export const modifierReferences = { }, ], }, + + // Group: ordinal ordinalScope: { name: "Ordinal scope", - group: { id: "scope", index: 3 }, + group: { id: "ordinal", index: 0 }, syntaxes: [ { pattern: `${VAR_ORDINAL} ${VAR_SCOPE}`, @@ -269,9 +159,11 @@ export const modifierReferences = { }, ], }, + + // Group: relative relativeScope: { name: "Relative scope", - group: { id: "scope", index: 4 }, + group: { id: "relative", index: 0 }, syntaxes: [ { pattern: `${PREVIOUS} ${VAR_SCOPE}`, @@ -404,6 +296,80 @@ export const modifierReferences = { ], }, + // Group: delimiters + interiorOnly: { + name: "Interior only", + defaultSpokenForm: "inside", + group: { id: "delimiters", index: 0 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: "Interior only.", + cheatsheet: "Interior only", + }, + ], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${PARENTHESES} ${TARGET}`, + description: `Selects the contents of the parentheses containing the ${TARGET_DESC}, excluding the parentheses.`, + }, + ], + }, + excludeInterior: { + name: "Exclude interior", + defaultSpokenForm: "bounds", + group: { id: "delimiters", index: 1 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: "Bounding paired delimiters.", + cheatsheet: "Bounding paired delimiters", + }, + ], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${PARENTHESES} ${TARGET}`, + description: `Selects only the parentheses containing the ${TARGET_DESC}.`, + }, + ], + }, + leading: { + name: "Leading", + defaultSpokenForm: "leading", + group: { id: "delimiters", index: 2 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: "Leading delimiter range.", + cheatsheet: "Leading delimiter range", + }, + ], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, + description: `Selects the leading delimiter of the item containing the ${TARGET_DESC}.`, + }, + ], + }, + trailing: { + name: "Trailing", + defaultSpokenForm: "trailing", + group: { id: "delimiters", index: 3 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: "Trailing delimiter range.", + cheatsheet: "Trailing delimiter range", + }, + ], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, + description: `Selects the trailing delimiter of the item containing the ${TARGET_DESC}.`, + }, + ], + }, + // Group: range extendThroughStartOf: { name: "Extend through start of", @@ -460,6 +426,44 @@ export const modifierReferences = { ], }, + // Group: position + startOf: { + name: "Start of", + defaultSpokenForm: "start of", + group: { id: "position", index: 0 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: "Empty position at start of target.", + cheatsheet: "Empty position at start of target", + }, + ], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Places the cursor at the start of the ${TARGET_DESC}.`, + }, + ], + }, + endOf: { + name: "End of", + defaultSpokenForm: "end of", + group: { id: "position", index: 1 }, + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: "Empty position at end of target.", + cheatsheet: "Empty position at end of target", + }, + ], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Places the cursor at the end of the ${TARGET_DESC}.`, + }, + ], + }, + // Group: filters visible: { name: "Visible", diff --git a/packages/lib-common/src/references/scopeReferenceGroups.ts b/packages/lib-common/src/references/scopeReferenceGroups.ts index d7e65a624c..8092f37351 100644 --- a/packages/lib-common/src/references/scopeReferenceGroups.ts +++ b/packages/lib-common/src/references/scopeReferenceGroups.ts @@ -1,25 +1,33 @@ import type { ReferenceGroup } from "./ReferenceEntry"; export type ScopeReferenceGroupId = - | "tokens" | "text" + | "sections" + | "documentHierarchy" + | "notebook" + | "collections" | "functions" | "objects" - | "collections" | "statements" | "markup" - | "documentStructure" - | "delimiters" | "private"; export const scopeReferenceGroups: ReferenceGroup[] = [ { - id: "tokens", - name: "Characters and tokens", + id: "text", + name: "Text-based scopes", }, { - id: "text", - name: "Lines and documents", + id: "sections", + name: "Sections", + }, + { + id: "documentHierarchy", + name: "Document hierarchy", + }, + { + id: "collections", + name: "Collections", }, { id: "functions", @@ -29,24 +37,16 @@ export const scopeReferenceGroups: ReferenceGroup[] = [ id: "objects", name: "Classes and objects", }, - { - id: "collections", - name: "Collections", - }, { id: "statements", name: "Statements and expressions", }, { id: "markup", - name: "Markup", - }, - { - id: "documentStructure", - name: "Document structure", + name: "Markup and styles", }, { - id: "delimiters", - name: "Paired delimiters", + id: "notebook", + name: "Notebook", }, ]; diff --git a/packages/lib-common/src/references/scopeReferences.ts b/packages/lib-common/src/references/scopeReferences.ts index 9faca99800..05cfcba8ff 100644 --- a/packages/lib-common/src/references/scopeReferences.ts +++ b/packages/lib-common/src/references/scopeReferences.ts @@ -25,15 +25,15 @@ const NEXT = connectiveDefaultSpokenForms.next; const FIRST = connectiveDefaultSpokenForms.first; export const scopeReferences = { - // Group: tokens + // Group: text character: { name: "Character", - group: { id: "tokens", index: 0 }, + group: { id: "text", index: 0 }, defaultSpokenForm: "char", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Character.", + description: "Single character within a token.", cheatsheet: "Character", }, ], @@ -46,13 +46,14 @@ export const scopeReferences = { }, word: { name: "Sub token word", - group: { id: "tokens", index: 1 }, + group: { id: "text", index: 1 }, defaultSpokenForm: "sub", legacySpokenForms: ["word"], syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Sub token word.", + description: + "Word-like component within a token, such as part of camelCase or snake_case.", cheatsheet: "Sub token word", }, ], @@ -65,12 +66,12 @@ export const scopeReferences = { }, token: { name: "Token", - group: { id: "tokens", index: 2 }, + group: { id: "text", index: 2 }, defaultSpokenForm: "token", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Token.", + description: "Token such as a word, number, or operator.", cheatsheet: "Token", }, ], @@ -83,12 +84,13 @@ export const scopeReferences = { }, identifier: { name: "Identifier", - group: { id: "tokens", index: 3 }, + group: { id: "text", index: 3 }, defaultSpokenForm: "identifier", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Identifier.", + description: + "Identifier-style sequence, such as camelCase, snake_case, or kebab-case.", cheatsheet: "Identifier", }, ], @@ -99,108 +101,33 @@ export const scopeReferences = { }, ], }, - glyph: { - name: "Glyph", - group: { id: "tokens", index: 4 }, - defaultSpokenForm: "glyph", - syntaxes: [ - { - pattern: `${VAR_SPOKEN_FORM} ${VAR_CHARACTER}`, - description: `Instance of single character ${VAR_CHARACTER}.`, - cheatsheet: `Instance of single character ${VAR_CHARACTER}`, - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${NEXT} ${VAR_SPOKEN_FORM} ${AIR}`, - description: `Selects the next 'a'.`, - }, - ], - }, - nonWhitespaceSequence: { - name: "Non-whitespace sequence", - group: { id: "tokens", index: 5 }, - defaultSpokenForm: "paint", - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: "Non-whitespace sequence.", - cheatsheet: "Non-whitespace sequence", - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the non-whitespace sequence containing the ${TARGET_DESC}.`, - }, - ], - }, - boundedNonWhitespaceSequence: { - name: "Bounded non-whitespace sequence", - group: { id: "tokens", index: 6 }, - defaultSpokenForm: "short paint", + sentence: { + name: "Sentence", + group: { id: "text", index: 4 }, + defaultSpokenForm: "sentence", syntaxes: [ { pattern: DEFAULT_PATTERN, description: - "Non-whitespace sequence bounded by surrounding pair delimiters.", - cheatsheet: - "Non-whitespace sequence bounded by surrounding pair delimiters", - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the bounded non-whitespace sequence containing the ${TARGET_DESC}.`, - }, - ], - }, - url: { - name: "URL", - group: { id: "tokens", index: 7 }, - defaultSpokenForm: "link", - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: "URL.", - cheatsheet: "URL", - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the url containing the ${TARGET_DESC}.`, - }, - ], - }, - regularExpression: { - name: "Regular expression", - group: { id: "tokens", index: 8 }, - defaultSpokenForm: "regex", - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: "Regular expression.", - cheatsheet: "Regular expression", + "Text ending at sentence punctuation or a paragraph boundary.", + cheatsheet: "Sentence", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the regular expression containing the ${TARGET_DESC}.`, + description: `Selects the sentence containing the ${TARGET_DESC}.`, }, ], }, - - // Group: text line: { name: "Line", - group: { id: "text", index: 0 }, + group: { id: "text", index: 5 }, defaultSpokenForm: LINE, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Line.", + description: "Line, without indentation.", cheatsheet: "Line", }, ], @@ -213,12 +140,12 @@ export const scopeReferences = { }, fullLine: { name: "Full line", - group: { id: "text", index: 1 }, + group: { id: "text", index: 6 }, defaultSpokenForm: "full line", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Full line.", + description: "Full line, including indentation.", cheatsheet: "Full line", }, ], @@ -229,32 +156,14 @@ export const scopeReferences = { }, ], }, - sentence: { - name: "Sentence", - group: { id: "text", index: 2 }, - defaultSpokenForm: "sentence", - syntaxes: [ - { - pattern: DEFAULT_PATTERN, - description: "Sentence.", - cheatsheet: "Sentence", - }, - ], - examples: [ - { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the sentence containing the ${TARGET_DESC}.`, - }, - ], - }, paragraph: { name: "Paragraph", - group: { id: "text", index: 3 }, + group: { id: "text", index: 7 }, defaultSpokenForm: "block", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Paragraph.", + description: "Paragraph, contiguous non-empty lines around the target.", cheatsheet: "Paragraph", }, ], @@ -267,7 +176,7 @@ export const scopeReferences = { }, boundedParagraph: { name: "Bounded paragraph", - group: { id: "text", index: 4 }, + group: { id: "text", index: 8 }, defaultSpokenForm: "short block", syntaxes: [ { @@ -285,12 +194,12 @@ export const scopeReferences = { }, document: { name: "Document", - group: { id: "text", index: 5 }, + group: { id: "text", index: 9 }, defaultSpokenForm: "file", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Document.", + description: "Entire document.", cheatsheet: "Document", }, ], @@ -301,277 +210,357 @@ export const scopeReferences = { }, ], }, - notebookCell: { - name: "Notebook cell", - group: { id: "text", index: 6 }, - defaultSpokenForm: "cell", + nonWhitespaceSequence: { + name: "Non-whitespace sequence", + group: { id: "text", index: 10 }, + defaultSpokenForm: "paint", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Notebook cell.", - cheatsheet: "Notebook cell", + description: "Non-whitespace sequence.", + cheatsheet: "Non-whitespace sequence", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the notebook cell containing the ${TARGET_DESC}.`, + description: `Selects the non-whitespace sequence containing the ${TARGET_DESC}.`, }, ], }, - - // Group: functions - argumentOrParameter: { - name: "Argument or parameter", - group: { id: "functions", index: 0 }, - defaultSpokenForm: "arg", + boundedNonWhitespaceSequence: { + name: "Bounded non-whitespace sequence", + group: { id: "text", index: 11 }, + defaultSpokenForm: "short paint", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Argument.", - cheatsheet: "Argument", + description: + "Non-whitespace sequence bounded by surrounding pair delimiters.", + cheatsheet: + "Non-whitespace sequence bounded by surrounding pair delimiters", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the argument or parameter containing the ${TARGET_DESC}.`, + description: `Selects the bounded non-whitespace sequence containing the ${TARGET_DESC}.`, }, ], }, - argumentList: { - name: "Argument list", - group: { id: "functions", index: 1 }, - defaultSpokenForm: "arg list", + url: { + name: "URL", + group: { id: "text", index: 12 }, + defaultSpokenForm: "link", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Argument list.", - cheatsheet: "Argument list", + description: "URL / Web address.", + cheatsheet: "URL", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the argument list containing the ${TARGET_DESC}.`, + description: `Selects the url containing the ${TARGET_DESC}.`, }, ], }, - anonymousFunction: { - name: "Anonymous function", - group: { id: "functions", index: 2 }, - defaultSpokenForm: "lambda", + surroundingPair: { + name: "Surrounding pair", + group: { id: "text", index: 13 }, syntaxes: [ { - pattern: DEFAULT_PATTERN, - description: "Anonymous function.", - cheatsheet: "Anonymous function", + pattern: VAR_PAIR, + description: "Surrounding matching delimiter pair and its contents.", + cheatsheet: "Surrounding pair", }, ], examples: [ { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the anonymous function containing the ${TARGET_DESC}.`, + command: `${SET_SELECTION} ${PARENTHESIS} ${TARGET}`, + description: `Selects the parentheses containing the ${TARGET_DESC}.`, }, ], }, - namedFunction: { - name: "Named function", - group: { id: "functions", index: 3 }, - defaultSpokenForm: "funk", + glyph: { + name: "Glyph", + group: { id: "text", index: 14 }, + defaultSpokenForm: "glyph", syntaxes: [ { - pattern: DEFAULT_PATTERN, - description: "Named function.", - cheatsheet: "Named function", + pattern: `${VAR_SPOKEN_FORM} ${VAR_CHARACTER}`, + description: `Instance of single character ${VAR_CHARACTER}.`, + cheatsheet: `Instance of single character ${VAR_CHARACTER}`, }, ], examples: [ { - command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the named function containing the ${TARGET_DESC}.`, + command: `${SET_SELECTION} ${NEXT} ${VAR_SPOKEN_FORM} ${AIR}`, + description: `Selects the next 'a'.`, }, ], }, - functionName: { - name: "Function name", - group: { id: "functions", index: 4 }, - defaultSpokenForm: "funk name", + + // Group: sections + section: { + name: "Section", + group: { id: "sections", index: 0 }, + defaultSpokenForm: "section", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Function name.", - cheatsheet: "Function name", + description: + "Heading and its content through the next heading of the same or higher level.", + cheatsheet: "Section", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the function name containing the ${TARGET_DESC}.`, + description: `Selects the section containing the ${TARGET_DESC}.`, }, ], }, - functionCall: { - name: "Function call", - group: { id: "functions", index: 5 }, - defaultSpokenForm: "call", + sectionLevelOne: { + name: "Section level one", + group: { id: "sections", index: 1 }, + defaultSpokenForm: "one section", + disabledByDefault: true, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Function call.", - cheatsheet: "Function call", + description: "Level-one heading and its content.", + cheatsheet: "Section level one", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the function call containing the ${TARGET_DESC}.`, + description: `Selects the section level one containing the ${TARGET_DESC}.`, }, ], }, - functionCallee: { - name: "Function callee", - group: { id: "functions", index: 6 }, - defaultSpokenForm: "callee", + sectionLevelTwo: { + name: "Section level two", + group: { id: "sections", index: 2 }, + defaultSpokenForm: "two section", + disabledByDefault: true, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Function callee.", - cheatsheet: "Function callee", + description: "Level-two heading and its content.", + cheatsheet: "Section level two", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the function callee containing the ${TARGET_DESC}.`, + description: `Selects the section level two containing the ${TARGET_DESC}.`, }, ], }, - - // Group: objects - class: { - name: "Class", - group: { id: "objects", index: 0 }, - defaultSpokenForm: "class", + sectionLevelThree: { + name: "Section level three", + group: { id: "sections", index: 3 }, + defaultSpokenForm: "three section", + disabledByDefault: true, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Class.", - cheatsheet: "Class", + description: "Level-three heading and its content.", + cheatsheet: "Section level three", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the class containing the ${TARGET_DESC}.`, + description: `Selects the section level three containing the ${TARGET_DESC}.`, }, ], }, - className: { - name: "Class name", - group: { id: "objects", index: 1 }, - defaultSpokenForm: "class name", + sectionLevelFour: { + name: "Section level four", + group: { id: "sections", index: 4 }, + defaultSpokenForm: "four section", + disabledByDefault: true, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Class name.", - cheatsheet: "Class name", + description: "Level-four heading and its content.", + cheatsheet: "Section level four", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the class name containing the ${TARGET_DESC}.`, + description: `Selects the section level four containing the ${TARGET_DESC}.`, }, ], }, - instance: { - name: "Instance", - group: { id: "objects", index: 2 }, - defaultSpokenForm: "instance", + sectionLevelFive: { + name: "Section level five", + group: { id: "sections", index: 5 }, + defaultSpokenForm: "five section", + disabledByDefault: true, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Instance.", - cheatsheet: "Instance", + description: "Level-five heading and its content.", + cheatsheet: "Section level five", }, ], examples: [ { - command: `${SET_SELECTION} ${EVERY} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects every instance of the ${TARGET_DESC}.`, + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the section level five containing the ${TARGET_DESC}.`, }, ], }, - name: { - name: "Name", - group: { id: "objects", index: 3 }, - defaultSpokenForm: "name", + sectionLevelSix: { + name: "Section level six", + group: { id: "sections", index: 6 }, + defaultSpokenForm: "six section", + disabledByDefault: true, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Name.", - cheatsheet: "Name", + description: "Level-six heading and its content.", + cheatsheet: "Section level six", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the name containing the ${TARGET_DESC}.`, + description: `Selects the section level six containing the ${TARGET_DESC}.`, }, ], }, - attribute: { - name: "Attribute", - group: { id: "objects", index: 4 }, - defaultSpokenForm: "attribute", + + // Group: documentHierarchy + part: { + name: "Part", + group: { id: "documentHierarchy", index: 0 }, + defaultSpokenForm: "part", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Attribute.", - cheatsheet: "Attribute", + description: "Document part and its contents.", + cheatsheet: "Part", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the attribute containing the ${TARGET_DESC}.`, + description: `Selects the part containing the ${TARGET_DESC}.`, }, ], }, - type: { - name: "Type", - group: { id: "objects", index: 5 }, - defaultSpokenForm: "type", + chapter: { + name: "Chapter", + group: { id: "documentHierarchy", index: 1 }, + defaultSpokenForm: "chapter", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Type.", - cheatsheet: "Type", + description: "Document chapter and its contents.", + cheatsheet: "Chapter", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the type containing the ${TARGET_DESC}.`, + description: `Selects the chapter containing the ${TARGET_DESC}.`, }, ], }, - value: { - name: "Value", - group: { id: "objects", index: 6 }, - defaultSpokenForm: "value", + subSection: { + name: "Subsection", + group: { id: "documentHierarchy", index: 2 }, + defaultSpokenForm: "subsection", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Value.", - cheatsheet: "Value", + description: "Document subsection and its contents.", + cheatsheet: "Subsection", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the value containing the ${TARGET_DESC}.`, + description: `Selects the subsection containing the ${TARGET_DESC}.`, + }, + ], + }, + subSubSection: { + name: "Subsubsection", + group: { id: "documentHierarchy", index: 3 }, + defaultSpokenForm: "subsubsection", + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: "Document subsubsection and its contents.", + cheatsheet: "Subsubsection", + }, + ], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the subsubsection containing the ${TARGET_DESC}.`, + }, + ], + }, + namedParagraph: { + name: "Named paragraph", + group: { id: "documentHierarchy", index: 4 }, + defaultSpokenForm: "paragraph", + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: "Named document paragraph and its contents.", + cheatsheet: "Named paragraph", + }, + ], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the named paragraph containing the ${TARGET_DESC}.`, + }, + ], + }, + subParagraph: { + name: "Subparagraph", + group: { id: "documentHierarchy", index: 5 }, + defaultSpokenForm: "subparagraph", + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: "Document subparagraph and its contents.", + cheatsheet: "Subparagraph", + }, + ], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the subparagraph containing the ${TARGET_DESC}.`, + }, + ], + }, + environment: { + name: "Environment", + group: { id: "documentHierarchy", index: 6 }, + defaultSpokenForm: "environment", + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: "Named document environment and its contents.", + cheatsheet: "Environment", + }, + ], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the environment containing the ${TARGET_DESC}.`, }, ], }, @@ -584,7 +573,7 @@ export const scopeReferences = { syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "List.", + description: "List or array.", cheatsheet: "List", }, ], @@ -602,7 +591,7 @@ export const scopeReferences = { syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Map.", + description: "Map, object, or dictionary.", cheatsheet: "Map", }, ], @@ -620,7 +609,7 @@ export const scopeReferences = { syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Collection item.", + description: "Entry in a list, map, object, or similar collection.", cheatsheet: "Collection item", }, ], @@ -638,7 +627,7 @@ export const scopeReferences = { syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Collection key.", + description: "Key in a map, object, or dictionary.", cheatsheet: "Collection key", }, ], @@ -650,501 +639,523 @@ export const scopeReferences = { ], }, - // Group: statements - statement: { - name: "Statement", - group: { id: "statements", index: 0 }, - defaultSpokenForm: STATEMENT, + // Group: functions + argumentOrParameter: { + name: "Argument or parameter", + group: { id: "functions", index: 0 }, + defaultSpokenForm: "arg", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Statement.", - cheatsheet: "Statement", + description: "Function parameter or function-call argument.", + cheatsheet: "Argument", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the statement containing the ${TARGET_DESC}.`, + description: `Selects the argument or parameter containing the ${TARGET_DESC}.`, }, ], }, - branch: { - name: "Branch", - group: { id: "statements", index: 1 }, - defaultSpokenForm: "branch", + argumentList: { + name: "Argument list", + group: { id: "functions", index: 1 }, + defaultSpokenForm: "arg list", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Branch.", - cheatsheet: "Branch", + description: "Complete parameter or argument list.", + cheatsheet: "Argument list", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the branch containing the ${TARGET_DESC}.`, + description: `Selects the argument list containing the ${TARGET_DESC}.`, }, ], }, - ifStatement: { - name: "If statement", - group: { id: "statements", index: 2 }, - defaultSpokenForm: "if state", + anonymousFunction: { + name: "Anonymous function", + group: { id: "functions", index: 2 }, + defaultSpokenForm: "lambda", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "If statement.", - cheatsheet: "If statement", + description: "Anonymous or lambda function.", + cheatsheet: "Anonymous function", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the if statement containing the ${TARGET_DESC}.`, + description: `Selects the anonymous function containing the ${TARGET_DESC}.`, }, ], }, - condition: { - name: "Condition", - group: { id: "statements", index: 3 }, - defaultSpokenForm: "condition", + namedFunction: { + name: "Named function", + group: { id: "functions", index: 3 }, + defaultSpokenForm: "funk", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Condition.", - cheatsheet: "Condition", + description: "Named function declaration.", + cheatsheet: "Named function", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the condition containing the ${TARGET_DESC}.`, + description: `Selects the named function containing the ${TARGET_DESC}.`, }, ], }, - comment: { - name: "Comment", - group: { id: "statements", index: 4 }, - defaultSpokenForm: "comment", + functionName: { + name: "Function name", + group: { id: "functions", index: 4 }, + defaultSpokenForm: "funk name", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Comment.", - cheatsheet: "Comment", + description: "Name in a function declaration.", + cheatsheet: "Function name", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the comment containing the ${TARGET_DESC}.`, + description: `Selects the function name containing the ${TARGET_DESC}.`, }, ], }, - command: { - name: "Command", - group: { id: "statements", index: 5 }, - defaultSpokenForm: "command", + functionCall: { + name: "Function call", + group: { id: "functions", index: 5 }, + defaultSpokenForm: "call", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Command.", - cheatsheet: "Command", + description: "Function, method, or constructor call.", + cheatsheet: "Function call", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the command containing the ${TARGET_DESC}.`, + description: `Selects the function call containing the ${TARGET_DESC}.`, }, ], }, - - // Group: markup - xmlElement: { - name: "XML element", - group: { id: "markup", index: 0 }, - defaultSpokenForm: "element", + functionCallee: { + name: "Function callee", + group: { id: "functions", index: 6 }, + defaultSpokenForm: "callee", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "XML element.", - cheatsheet: "XML element", + description: "Expression invoked by a function call.", + cheatsheet: "Function callee", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the XML element containing the ${TARGET_DESC}.`, + description: `Selects the function callee containing the ${TARGET_DESC}.`, }, ], }, - xmlStartTag: { - name: "XML start tag", - group: { id: "markup", index: 1 }, - defaultSpokenForm: "start tag", + + // Group: objects + class: { + name: "Class", + group: { id: "objects", index: 0 }, + defaultSpokenForm: "class", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "XML start tag.", - cheatsheet: "XML start tag", + description: "Class or struct declaration or definition.", + cheatsheet: "Class", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the XML start tag containing the ${TARGET_DESC}.`, + description: `Selects the class containing the ${TARGET_DESC}.`, }, ], }, - xmlEndTag: { - name: "XML end tag", - group: { id: "markup", index: 2 }, - defaultSpokenForm: "end tag", + className: { + name: "Class name", + group: { id: "objects", index: 1 }, + defaultSpokenForm: "class name", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "XML end tag.", - cheatsheet: "XML end tag", + description: "Name in a class or struct declaration.", + cheatsheet: "Class name", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the XML end tag containing the ${TARGET_DESC}.`, + description: `Selects the class name containing the ${TARGET_DESC}.`, }, ], }, - xmlBothTags: { - name: "XML both tags", - group: { id: "markup", index: 3 }, - defaultSpokenForm: "tags", + instance: { + name: "Instance", + group: { id: "objects", index: 2 }, + defaultSpokenForm: "instance", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "XML start and end tags.", - cheatsheet: "XML start and end tags", + description: "Occurrence matching the current instance.", + cheatsheet: "Instance", + }, + ], + examples: [ + { + command: `${SET_SELECTION} ${EVERY} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects every instance of the ${TARGET_DESC}.`, + }, + ], + }, + name: { + name: "Name", + group: { id: "objects", index: 3 }, + defaultSpokenForm: "name", + syntaxes: [ + { + pattern: DEFAULT_PATTERN, + description: + "Name in a declaration, such as a variable or function name.", + cheatsheet: "Name", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects both tags of the XML element containing the ${TARGET_DESC}.`, + description: `Selects the name containing the ${TARGET_DESC}.`, }, ], }, - selector: { - name: "Selector", - group: { id: "markup", index: 4 }, - defaultSpokenForm: "selector", + attribute: { + name: "Attribute", + group: { id: "objects", index: 4 }, + defaultSpokenForm: "attribute", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Selector.", - cheatsheet: "Selector", + description: "Attribute, such as one on an HTML element.", + cheatsheet: "Attribute", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the selector containing the ${TARGET_DESC}.`, + description: `Selects the attribute containing the ${TARGET_DESC}.`, }, ], }, - unit: { - name: "Unit", - group: { id: "markup", index: 5 }, - defaultSpokenForm: "unit", + type: { + name: "Type", + group: { id: "objects", index: 5 }, + defaultSpokenForm: "type", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Unit.", - cheatsheet: "Unit", + description: "Type annotation or declaration.", + cheatsheet: "Type", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the unit containing the ${TARGET_DESC}.`, + description: `Selects the type containing the ${TARGET_DESC}.`, }, ], }, - - // Group: documentStructure - section: { - name: "Section", - group: { id: "documentStructure", index: 0 }, - defaultSpokenForm: "section", + value: { + name: "Value", + group: { id: "objects", index: 6 }, + defaultSpokenForm: "value", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section.", - cheatsheet: "Section", + description: + "Value in an assignment, collection entry, return statement, or similar construct.", + cheatsheet: "Value", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section containing the ${TARGET_DESC}.`, + description: `Selects the value containing the ${TARGET_DESC}.`, }, ], }, - sectionLevelOne: { - name: "Section level one", - group: { id: "documentStructure", index: 1 }, - defaultSpokenForm: "one section", - disabledByDefault: true, + + // Group: statements + statement: { + name: "Statement", + group: { id: "statements", index: 0 }, + defaultSpokenForm: STATEMENT, syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section level one.", - cheatsheet: "Section level one", + description: + "Complete statement, such as a variable declaration or expression statement.", + cheatsheet: "Statement", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section level one containing the ${TARGET_DESC}.`, + description: `Selects the statement containing the ${TARGET_DESC}.`, }, ], }, - sectionLevelTwo: { - name: "Section level two", - group: { id: "documentStructure", index: 2 }, - defaultSpokenForm: "two section", - disabledByDefault: true, + branch: { + name: "Branch", + group: { id: "statements", index: 1 }, + defaultSpokenForm: "branch", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section level two.", - cheatsheet: "Section level two", + description: + "Branch of a control-flow construct, such as if, try, switch, or ternary.", + cheatsheet: "Branch", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section level two containing the ${TARGET_DESC}.`, + description: `Selects the branch containing the ${TARGET_DESC}.`, }, ], }, - sectionLevelThree: { - name: "Section level three", - group: { id: "documentStructure", index: 3 }, - defaultSpokenForm: "three section", - disabledByDefault: true, + ifStatement: { + name: "If statement", + group: { id: "statements", index: 2 }, + defaultSpokenForm: "if state", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section level three.", - cheatsheet: "Section level three", + description: "Complete if statement.", + cheatsheet: "If statement", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section level three containing the ${TARGET_DESC}.`, + description: `Selects the if statement containing the ${TARGET_DESC}.`, }, ], }, - sectionLevelFour: { - name: "Section level four", - group: { id: "documentStructure", index: 4 }, - defaultSpokenForm: "four section", - disabledByDefault: true, + condition: { + name: "Condition", + group: { id: "statements", index: 3 }, + defaultSpokenForm: "condition", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section level four.", - cheatsheet: "Section level four", + description: "Condition of a conditional, loop, or similar construct.", + cheatsheet: "Condition", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section level four containing the ${TARGET_DESC}.`, + description: `Selects the condition containing the ${TARGET_DESC}.`, }, ], }, - sectionLevelFive: { - name: "Section level five", - group: { id: "documentStructure", index: 5 }, - defaultSpokenForm: "five section", - disabledByDefault: true, + comment: { + name: "Comment", + group: { id: "statements", index: 4 }, + defaultSpokenForm: "comment", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section level five.", - cheatsheet: "Section level five", + description: "Line or block comment.", + cheatsheet: "Comment", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section level five containing the ${TARGET_DESC}.`, + description: `Selects the comment containing the ${TARGET_DESC}.`, }, ], }, - sectionLevelSix: { - name: "Section level six", - group: { id: "documentStructure", index: 6 }, - defaultSpokenForm: "six section", - disabledByDefault: true, + command: { + name: "Command", + group: { id: "statements", index: 5 }, + defaultSpokenForm: "command", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Section level six.", - cheatsheet: "Section level six", + description: + "Command, such as a Talon spoken command or shell command.", + cheatsheet: "Command", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the section level six containing the ${TARGET_DESC}.`, + description: `Selects the command containing the ${TARGET_DESC}.`, }, ], }, - part: { - name: "Part", - group: { id: "documentStructure", index: 7 }, - defaultSpokenForm: "part", + regularExpression: { + name: "Regular expression", + group: { id: "statements", index: 6 }, + defaultSpokenForm: "regex", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Part.", - cheatsheet: "Part", + description: "Regular-expression literal.", + cheatsheet: "Regular expression", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the part containing the ${TARGET_DESC}.`, + description: `Selects the regular expression containing the ${TARGET_DESC}.`, }, ], }, - chapter: { - name: "Chapter", - group: { id: "documentStructure", index: 8 }, - defaultSpokenForm: "chapter", + + // Group: markup + xmlElement: { + name: "XML element", + group: { id: "markup", index: 0 }, + defaultSpokenForm: "element", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Chapter.", - cheatsheet: "Chapter", + description: + "Complete XML, HTML, or JSX element, or a LaTeX environment.", + cheatsheet: "XML element", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the chapter containing the ${TARGET_DESC}.`, + description: `Selects the XML element containing the ${TARGET_DESC}.`, }, ], }, - subSection: { - name: "Subsection", - group: { id: "documentStructure", index: 9 }, - defaultSpokenForm: "subsection", + xmlStartTag: { + name: "XML start tag", + group: { id: "markup", index: 1 }, + defaultSpokenForm: "start tag", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Subsection.", - cheatsheet: "Subsection", + description: "Opening XML, HTML, or JSX tag, or LaTeX `begin` command.", + cheatsheet: "XML start tag", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the subsection containing the ${TARGET_DESC}.`, + description: `Selects the XML start tag containing the ${TARGET_DESC}.`, }, ], }, - subSubSection: { - name: "Subsubsection", - group: { id: "documentStructure", index: 10 }, - defaultSpokenForm: "subsubsection", + xmlEndTag: { + name: "XML end tag", + group: { id: "markup", index: 2 }, + defaultSpokenForm: "end tag", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Subsubsection.", - cheatsheet: "Subsubsection", + description: "Closing XML, HTML, or JSX tag, or LaTeX `end` command.", + cheatsheet: "XML end tag", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the subsubsection containing the ${TARGET_DESC}.`, + description: `Selects the XML end tag containing the ${TARGET_DESC}.`, }, ], }, - namedParagraph: { - name: "Named paragraph", - group: { id: "documentStructure", index: 11 }, - defaultSpokenForm: "paragraph", + xmlBothTags: { + name: "XML both tags", + group: { id: "markup", index: 3 }, + defaultSpokenForm: "tags", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Named paragraph.", - cheatsheet: "Named paragraph", + description: + "Opening and closing XML, HTML, or JSX tags, or LaTeX `begin` and `end` commands.", + cheatsheet: "XML start and end tags", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the named paragraph containing the ${TARGET_DESC}.`, + description: `Selects both tags of the XML element containing the ${TARGET_DESC}.`, }, ], }, - subParagraph: { - name: "Subparagraph", - group: { id: "documentStructure", index: 12 }, - defaultSpokenForm: "subparagraph", + selector: { + name: "Selector", + group: { id: "markup", index: 4 }, + defaultSpokenForm: "selector", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Subparagraph.", - cheatsheet: "Subparagraph", + description: "CSS selector.", + cheatsheet: "Selector", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the subparagraph containing the ${TARGET_DESC}.`, + description: `Selects the selector containing the ${TARGET_DESC}.`, }, ], }, - environment: { - name: "Environment", - group: { id: "documentStructure", index: 13 }, - defaultSpokenForm: "environment", + unit: { + name: "Unit", + group: { id: "markup", index: 5 }, + defaultSpokenForm: "unit", syntaxes: [ { pattern: DEFAULT_PATTERN, - description: "Environment.", - cheatsheet: "Environment", + description: "Unit suffix in a measurement, such as `px` in `100px`.", + cheatsheet: "Unit", }, ], examples: [ { command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, - description: `Selects the environment containing the ${TARGET_DESC}.`, + description: `Selects the unit containing the ${TARGET_DESC}.`, }, ], }, - // Group: delimiters - surroundingPair: { - name: "Surrounding pair", - group: { id: "delimiters", index: 0 }, + // Group: notebook + notebookCell: { + name: "Notebook cell", + group: { id: "notebook", index: 0 }, + defaultSpokenForm: "cell", syntaxes: [ { - pattern: VAR_PAIR, - description: "Surrounding pair.", - cheatsheet: "Surrounding pair", + pattern: DEFAULT_PATTERN, + description: "Notebook cell or Markdown fenced code block.", + cheatsheet: "Notebook cell", }, ], examples: [ { - command: `${SET_SELECTION} ${PARENTHESIS} ${TARGET}`, - description: `Selects the parentheses containing the ${TARGET_DESC}.`, + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the notebook cell containing the ${TARGET_DESC}.`, }, ], },