diff --git a/packages/app-web-docs/src/css/custom.scss b/packages/app-web-docs/src/css/custom.scss index 45876a2b0db..b7168287c5e 100644 --- a/packages/app-web-docs/src/css/custom.scss +++ b/packages/app-web-docs/src/css/custom.scss @@ -25,8 +25,3 @@ .pointer { cursor: pointer; } - -.list-unstyled { - padding-left: 1rem; - list-style: none; -} diff --git a/packages/app-web-docs/src/docs/user/actions/remove.mdx b/packages/app-web-docs/src/docs/user/actions/remove.mdx index 7eb95915ec8..4834da3e064 100644 --- a/packages/app-web-docs/src/docs/user/actions/remove.mdx +++ b/packages/app-web-docs/src/docs/user/actions/remove.mdx @@ -11,7 +11,3 @@ Default: `chuck` ## Syntax - chuck ``: Remove ``. - -## Examples - -- `"chuck blue air"`: Removes the token containing letter 'a' with a blue hat. diff --git a/packages/lib-common/src/references/actionReferences.ts b/packages/lib-common/src/references/actionReferences.ts index 09249afde37..57079efd578 100644 --- a/packages/lib-common/src/references/actionReferences.ts +++ b/packages/lib-common/src/references/actionReferences.ts @@ -1,9 +1,15 @@ import type { ActionType } from "../types/command/ActionDescriptor"; -import { connectiveSpokenForms } from "./connectiveSpokenForms"; -import { getSpokenForm } from "./getSpokenForm"; -import type { ReferenceEntry } from "./ReferenceEntry"; -import { scopeReferences } from "./scopeReferences"; import { + FORMATTER_CAMEL, + REMOVE, + SET_SELECTION, + SNIPPET_IF, + TARGET, + TARGET_2, + TARGET_2_DESC, + TARGET_DESC, + TARGET_NUMBER, + TARGET_NUMBER_DESC, VAR_DESTINATION, VAR_FORMATTER, VAR_PAIR, @@ -13,26 +19,31 @@ import { VAR_TARGET, VAR_TARGET_1, VAR_TARGET_2, -} from "./variables"; - -const TARGET = "blue air"; -const TARGET_DESC = "token containing letter 'a' with a blue hat"; -// const TARGET_2 = "green bat"; -// const TARGET_2_DESC = "token containing letter 'b' with a green hat"; +} from "./constants"; +import { getSpokenForm } from "./getSpokenForm"; +import { modifierReferences } from "./modifierReferences"; +import { pairedDelimiterReferences } from "./pairedDelimiterReferences"; +import type { ReferenceEntry } from "./ReferenceEntry"; +import { scopeReferences } from "./scopeReferences"; +import { connectiveDefaultSpokenForms } from "./spokenForms/connectiveDefaultSpokenForms"; const DEFAULT_PATTERN = `${VAR_SPOKEN_FORM} ${VAR_TARGET}`; const DEFAULT_PATTERN_SCOPE = `${VAR_SPOKEN_FORM} ${VAR_SCOPE} ${VAR_TARGET}`; const DEFAULT_COMMAND = `${VAR_SPOKEN_FORM} ${TARGET}`; -// const COLLECTION_ITEM_SCOPE = getSpokenForm(scopeReferences.collectionItem); -// const FUNCTION_CALL_SCOPE = getSpokenForm(scopeReferences.functionCall); -// const INSTANCE_SCOPE = getSpokenForm(scopeReferences.instance); -// const NAMED_FUNCTION_SCOPE = getSpokenForm(scopeReferences.namedFunction); -const TOKEN_SCOPE = getSpokenForm(scopeReferences.token); -// const EVERY_MODIFIER = getSpokenForm(modifierReferences.everyScope); -const SET_SELECTION_SPOKEN_FORM = "take"; - -const SWAP_CONNECTIVE = connectiveSpokenForms.swapConnective; +const ITEM = getSpokenForm(scopeReferences.collectionItem); +const CALL = getSpokenForm(scopeReferences.functionCall); +const INSTANCE = getSpokenForm(scopeReferences.instance); +const FUNCTION = getSpokenForm(scopeReferences.namedFunction); +const TOKEN = getSpokenForm(scopeReferences.token); +const EVERY = getSpokenForm(modifierReferences.everyScope); +const WITH = connectiveDefaultSpokenForms.swapConnective; +const AFTER = connectiveDefaultSpokenForms.after; +const TO = connectiveDefaultSpokenForms.sourceDestinationConnective; +const CURLY = pairedDelimiterReferences.curlyBrackets.defaultSpokenForm; +const SQUARE = pairedDelimiterReferences.squareBrackets.defaultSpokenForm; +const AT = connectiveDefaultSpokenForms.at; +const ON = connectiveDefaultSpokenForms.on; type TalonSideActionType = "applyFormatter" | "nextHomophone"; @@ -50,7 +61,12 @@ export const actionReferences: Record< cheatsheet: "Add selection", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Adds the ${TARGET_DESC} to the current selections.`, + }, + ], }, addSelectionAfter: { name: "Add selection after", @@ -62,7 +78,12 @@ export const actionReferences: Record< cheatsheet: "Add selection after", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Adds an empty selection after the ${TARGET_DESC}.`, + }, + ], }, addSelectionBefore: { name: "Add selection before", @@ -74,7 +95,12 @@ export const actionReferences: Record< cheatsheet: "Add selection before", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Adds an empty selection before the ${TARGET_DESC}.`, + }, + ], }, breakLine: { name: "Break line", @@ -86,7 +112,12 @@ export const actionReferences: Record< cheatsheet: "Breaks the line", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Breaks the line before the ${TARGET_DESC}.`, + }, + ], }, clearAndSetSelection: { name: "Change", @@ -99,7 +130,12 @@ export const actionReferences: Record< cheatsheet: "Change", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Deletes the ${TARGET_DESC} and leaves the cursor in its place.`, + }, + ], }, copyToClipboard: { name: "Copy to clipboard", @@ -111,7 +147,12 @@ export const actionReferences: Record< cheatsheet: "Copy to clipboard", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Copies the ${TARGET_DESC} to the clipboard.`, + }, + ], }, cutToClipboard: { name: "Cut to clipboard", @@ -123,7 +164,12 @@ export const actionReferences: Record< cheatsheet: "Cut to clipboard", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Cuts the ${TARGET_DESC} to the clipboard.`, + }, + ], }, decrement: { name: "Decrement", @@ -135,7 +181,12 @@ export const actionReferences: Record< cheatsheet: "Decrement number", }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${TARGET_NUMBER}`, + description: `Decrements the number at the ${TARGET_NUMBER_DESC}.`, + }, + ], }, deselect: { name: "Deselect", @@ -147,7 +198,12 @@ export const actionReferences: Record< cheatsheet: "Deselect", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Removes the ${TARGET_DESC} from the current selections.`, + }, + ], }, editNewLineAfter: { name: "Edit new line/scope after", @@ -165,7 +221,16 @@ export const actionReferences: Record< cheatsheet: `Edit new ${VAR_SCOPE} after`, }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Inserts a new line below the ${TARGET_DESC} and moves the cursor to it.`, + }, + { + command: `${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, + description: `Inserts the delimiters for a new collection item after the item containing the ${TARGET_DESC} and moves the cursor there.`, + }, + ], }, editNewLineBefore: { name: "Edit new line/scope before", @@ -183,7 +248,16 @@ export const actionReferences: Record< cheatsheet: `Edit new ${VAR_SCOPE} before`, }, ], - examples: [], + 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.`, + }, + ], }, "experimental.setInstanceReference": { name: "Set instance reference", @@ -197,7 +271,12 @@ export const actionReferences: Record< cheatsheet: "Set instance reference", }, ], - examples: [], + 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}.`, + }, + ], }, extractVariable: { name: "Extract variable", @@ -209,7 +288,12 @@ export const actionReferences: Record< cheatsheet: "Extract variable", }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${CALL} ${TARGET}`, + description: `Extracts the function call containing the ${TARGET_DESC} into a variable.`, + }, + ], }, findInDocument: { name: "Find in document", @@ -221,7 +305,12 @@ export const actionReferences: Record< cheatsheet: "Find in document", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Searches the current document for the ${TARGET_DESC}.`, + }, + ], }, findInWorkspace: { name: "Find in workspace", @@ -233,7 +322,12 @@ export const actionReferences: Record< cheatsheet: "Find in workspace", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Searches the workspace for the ${TARGET_DESC}.`, + }, + ], }, flashTargets: { name: "Flash target", @@ -245,7 +339,12 @@ export const actionReferences: Record< cheatsheet: "Flash target", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Briefly flashes the ${TARGET_DESC}.`, + }, + ], }, foldRegion: { name: "Fold region", @@ -257,7 +356,12 @@ export const actionReferences: Record< cheatsheet: "Fold region", }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Folds the function containing the ${TARGET_DESC}.`, + }, + ], }, followLink: { name: "Follow link", @@ -269,7 +373,12 @@ export const actionReferences: Record< cheatsheet: "Follow link", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Opens the link containing the ${TARGET_DESC}.`, + }, + ], }, followLinkAside: { name: "Follow link aside", @@ -281,7 +390,12 @@ export const actionReferences: Record< cheatsheet: "Follow link aside", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Opens the link containing the ${TARGET_DESC} in a split view.`, + }, + ], }, gitAccept: { name: "Git accept", @@ -293,7 +407,12 @@ export const actionReferences: Record< cheatsheet: "Git accept", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Accepts the Git change on the line containing the ${TARGET_DESC}.`, + }, + ], }, gitRevert: { name: "Git revert", @@ -305,7 +424,12 @@ export const actionReferences: Record< cheatsheet: "Git revert", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Reverts the Git change on the line containing the ${TARGET_DESC}.`, + }, + ], }, gitStage: { name: "Git stage", @@ -317,7 +441,12 @@ export const actionReferences: Record< cheatsheet: "Git stage", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Stages the Git change on the line containing the ${TARGET_DESC}.`, + }, + ], }, gitUnstage: { name: "Git unstage", @@ -329,7 +458,12 @@ export const actionReferences: Record< cheatsheet: "Git unstage", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Unstages the Git change on the line containing the ${TARGET_DESC}.`, + }, + ], }, increment: { name: "Increment", @@ -341,7 +475,12 @@ export const actionReferences: Record< cheatsheet: "Increment number", }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${TARGET_NUMBER}`, + description: `Increments the ${TARGET_NUMBER_DESC}.`, + }, + ], }, indentLine: { name: "Indent line", @@ -353,7 +492,12 @@ export const actionReferences: Record< cheatsheet: "Indent line", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Indents the line containing the ${TARGET_DESC}.`, + }, + ], }, insertCopyAfter: { name: "Insert copy after", @@ -365,7 +509,12 @@ export const actionReferences: Record< cheatsheet: "Insert copy after", }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Inserts a copy of the function containing the ${TARGET_DESC} after itself.`, + }, + ], }, insertCopyBefore: { name: "Insert copy before", @@ -377,7 +526,12 @@ export const actionReferences: Record< cheatsheet: "Insert copy before", }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Inserts a copy of the function containing the ${TARGET_DESC} before itself.`, + }, + ], }, insertEmptyLineAfter: { name: "Insert empty line after", @@ -389,7 +543,16 @@ export const actionReferences: Record< cheatsheet: "Insert empty line after", }, ], - examples: [], + 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}.`, + }, + ], }, insertEmptyLineBefore: { name: "Insert empty line before", @@ -401,7 +564,16 @@ export const actionReferences: Record< cheatsheet: "Insert empty line before", }, ], - examples: [], + 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}.`, + }, + ], }, insertEmptyLinesAround: { name: "Insert empty lines around", @@ -413,7 +585,16 @@ export const actionReferences: Record< cheatsheet: "Insert empty lines around", }, ], - examples: [], + 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}.`, + }, + ], }, joinLines: { name: "Join lines", @@ -425,7 +606,12 @@ export const actionReferences: Record< cheatsheet: "Join lines", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Joins the line containing the ${TARGET_DESC} with the following line.`, + }, + ], }, outdentLine: { name: "Outdent line", @@ -437,7 +623,12 @@ export const actionReferences: Record< cheatsheet: "Outdent line", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Decreases the indentation of the line containing the ${TARGET_DESC}.`, + }, + ], }, randomizeTargets: { name: "Randomize targets", @@ -449,11 +640,16 @@ export const actionReferences: Record< cheatsheet: "Randomize targets", }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, + description: `Randomizes the collection items associated with the ${TARGET_DESC}.`, + }, + ], }, remove: { name: "Remove", - defaultSpokenForm: "chuck", + defaultSpokenForm: REMOVE, description: "This action can be used to remove a target without moving the cursor.", syntaxes: [ @@ -480,7 +676,12 @@ export const actionReferences: Record< cheatsheet: "Rename", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Starts renaming the ${TARGET_DESC}.`, + }, + ], }, revealDefinition: { name: "Reveal definition", @@ -492,7 +693,12 @@ export const actionReferences: Record< cheatsheet: "Reveal definition", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Opens the definition of the ${TARGET_DESC}.`, + }, + ], }, revealTypeDefinition: { name: "Reveal type definition", @@ -504,7 +710,12 @@ export const actionReferences: Record< cheatsheet: "Reveal type definition", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Opens the type definition of the ${TARGET_DESC}.`, + }, + ], }, reverseTargets: { name: "Reverse targets", @@ -516,7 +727,12 @@ export const actionReferences: Record< cheatsheet: "Reverse targets", }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, + description: `Reverses the collection items associated with the ${TARGET_DESC}.`, + }, + ], }, scrollToBottom: { name: "Scroll to bottom", @@ -528,7 +744,12 @@ export const actionReferences: Record< cheatsheet: "Scroll to bottom", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Scrolls the ${TARGET_DESC} to the bottom of the viewport.`, + }, + ], }, scrollToCenter: { name: "Scroll to center", @@ -540,7 +761,12 @@ export const actionReferences: Record< cheatsheet: "Scroll to center", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Scrolls the ${TARGET_DESC} to the center of the viewport.`, + }, + ], }, scrollToTop: { name: "Scroll to top", @@ -552,11 +778,16 @@ export const actionReferences: Record< cheatsheet: "Scroll to top", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Scrolls the ${TARGET_DESC} to the top of the viewport.`, + }, + ], }, setSelection: { name: "Set selection", - defaultSpokenForm: SET_SELECTION_SPOKEN_FORM, + defaultSpokenForm: SET_SELECTION, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -564,7 +795,12 @@ export const actionReferences: Record< cheatsheet: "Set selection", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Selects the ${TARGET_DESC}.`, + }, + ], }, setSelectionAfter: { name: "Set selection after", @@ -576,7 +812,12 @@ export const actionReferences: Record< cheatsheet: "Set selection after", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Places the cursor after the ${TARGET_DESC}.`, + }, + ], }, setSelectionBefore: { name: "Set selection before", @@ -588,7 +829,12 @@ export const actionReferences: Record< cheatsheet: "Set selection before", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Places the cursor before the ${TARGET_DESC}.`, + }, + ], }, showDebugHover: { name: "Show debug hover", @@ -600,7 +846,12 @@ export const actionReferences: Record< cheatsheet: "Show debug hover", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Shows debug information for the ${TARGET_DESC}.`, + }, + ], }, showHover: { name: "Show hover", @@ -612,7 +863,12 @@ export const actionReferences: Record< cheatsheet: "Show hover", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Shows hover information for the ${TARGET_DESC}.`, + }, + ], }, showQuickFix: { name: "Show quick fix", @@ -624,7 +880,12 @@ export const actionReferences: Record< cheatsheet: "Show quick fix", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Shows quick fixes for the ${TARGET_DESC}.`, + }, + ], }, showReferences: { name: "Show references", @@ -636,7 +897,12 @@ export const actionReferences: Record< cheatsheet: "Show references", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Shows references to the ${TARGET_DESC}.`, + }, + ], }, sortTargets: { name: "Sort targets", @@ -648,7 +914,12 @@ export const actionReferences: Record< cheatsheet: "Sort targets", }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${EVERY} ${ITEM} ${TARGET}`, + description: `Sorts the collection items associated with the ${TARGET_DESC}.`, + }, + ], }, toggleLineBreakpoint: { name: "Toggle line/scope breakpoint", @@ -661,12 +932,17 @@ export const actionReferences: Record< cheatsheet: "Toggle line breakpoint", }, { - pattern: `${VAR_SPOKEN_FORM} ${TOKEN_SCOPE} ${VAR_TARGET}`, + pattern: `${VAR_SPOKEN_FORM} ${TOKEN} ${VAR_TARGET}`, description: `Toggle inline breakpoint at ${VAR_TARGET}.`, cheatsheet: "Toggle inline breakpoint", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Toggles a breakpoint on the line containing the ${TARGET_DESC}.`, + }, + ], }, toggleLineComment: { name: "Toggle line comment", @@ -678,7 +954,12 @@ export const actionReferences: Record< cheatsheet: "Toggle line comment", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Toggles the comment on the line containing the ${TARGET_DESC}.`, + }, + ], }, unfoldRegion: { name: "Unfold region", @@ -690,7 +971,12 @@ export const actionReferences: Record< cheatsheet: "Unfold region", }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Unfolds the function containing the ${TARGET_DESC}.`, + }, + ], }, callAsFunction: { name: "Call as function", @@ -702,12 +988,17 @@ export const actionReferences: Record< cheatsheet: `Insert call to ${VAR_TARGET} on selection`, }, { - pattern: `${VAR_SPOKEN_FORM} ${VAR_TARGET_1} on ${VAR_TARGET_2}`, + 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: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Inserts a call to the ${TARGET_DESC} at the current selection.`, + }, + ], }, generateSnippet: { name: "Generate snippet", @@ -720,7 +1011,12 @@ export const actionReferences: Record< cheatsheet: "Generate snippet", }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${FUNCTION} ${TARGET}`, + description: `Generates a snippet from the function containing the ${TARGET_DESC}.`, + }, + ], }, highlight: { name: "Highlight", @@ -732,7 +1028,12 @@ export const actionReferences: Record< cheatsheet: "Highlight", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Highlights the ${TARGET_DESC}.`, + }, + ], }, insertSnippet: { name: "Insert snippet", @@ -744,7 +1045,12 @@ export const actionReferences: Record< cheatsheet: `Insert snippet at ${VAR_DESTINATION}`, }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${SNIPPET_IF} ${AFTER} ${TARGET}`, + description: `Inserts an if-statement snippet after the ${TARGET_DESC}.`, + }, + ], }, moveToTarget: { name: "Move to target", @@ -761,7 +1067,12 @@ export const actionReferences: Record< cheatsheet: `Move ${VAR_TARGET} to ${VAR_DESTINATION}`, }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${TARGET} ${AFTER} ${TARGET_2}`, + description: `Moves the ${TARGET_DESC} to after the ${TARGET_2_DESC}.`, + }, + ], }, pasteFromClipboard: { name: "Paste from clipboard", @@ -773,7 +1084,12 @@ export const actionReferences: Record< cheatsheet: `Paste from clipboard at ${VAR_DESTINATION}`, }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${AFTER} ${TARGET}`, + description: `Pastes the clipboard contents after the ${TARGET_DESC}.`, + }, + ], }, replaceWithTarget: { name: "Replace with target", @@ -790,7 +1106,12 @@ export const actionReferences: Record< cheatsheet: `Copy ${VAR_TARGET} to ${VAR_DESTINATION}`, }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${TARGET} ${TO} ${TARGET_2}`, + description: `Replaces the ${TARGET_2_DESC} with a copy of the ${TARGET_DESC}.`, + }, + ], }, rewrapWithPairedDelimiter: { name: "Rewrap with paired delimiter", @@ -802,24 +1123,34 @@ export const actionReferences: Record< cheatsheet: `Rewrap ${VAR_TARGET} with ${VAR_PAIR}`, }, ], - examples: [], + examples: [ + { + command: `${CURLY} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Replaces the paired delimiters around the ${TARGET_DESC} with curly brackets.`, + }, + ], }, swapTargets: { name: "Swap targets", defaultSpokenForm: "swap", syntaxes: [ { - pattern: `${VAR_SPOKEN_FORM} ${SWAP_CONNECTIVE} ${VAR_TARGET}`, + 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} ${SWAP_CONNECTIVE} ${VAR_TARGET_2}`, + 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: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${TARGET} ${WITH} ${TARGET_2}`, + description: `Swaps the ${TARGET_DESC} and the ${TARGET_2_DESC}.`, + }, + ], }, wrapWithPairedDelimiter: { name: "Wrap with paired delimiter", @@ -831,7 +1162,12 @@ export const actionReferences: Record< cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_PAIR}`, }, ], - examples: [], + examples: [ + { + command: `${SQUARE} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Wraps the ${TARGET_DESC} in square brackets.`, + }, + ], }, wrapWithSnippet: { name: "Wrap with snippet", @@ -843,19 +1179,29 @@ export const actionReferences: Record< cheatsheet: `Wrap ${VAR_TARGET} with ${VAR_SNIPPET}`, }, ], - examples: [], + examples: [ + { + command: `${SNIPPET_IF} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Wraps the ${TARGET_DESC} in an if-statement snippet.`, + }, + ], }, applyFormatter: { name: "Apply formatter", defaultSpokenForm: "format", syntaxes: [ { - pattern: `${VAR_SPOKEN_FORM} ${VAR_FORMATTER} at ${VAR_TARGET}`, + pattern: `${VAR_SPOKEN_FORM} ${VAR_FORMATTER} ${AT} ${VAR_TARGET}`, description: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}.`, cheatsheet: `Reformat ${VAR_TARGET} as ${VAR_FORMATTER}`, }, ], - examples: [], + examples: [ + { + command: `${VAR_SPOKEN_FORM} ${FORMATTER_CAMEL} ${AT} ${TARGET}`, + description: `Reformats the ${TARGET_DESC} as camel case.`, + }, + ], }, nextHomophone: { name: "Next homophone", @@ -867,7 +1213,12 @@ export const actionReferences: Record< cheatsheet: "Cycle to next homophone", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Replaces the ${TARGET_DESC} with its next homophone.`, + }, + ], }, // Private actions -------------------- @@ -883,7 +1234,12 @@ export const actionReferences: Record< cheatsheet: "Show parse tree", }, ], - examples: [], + examples: [ + { + command: DEFAULT_COMMAND, + description: `Shows the parse tree for the ${TARGET_DESC}.`, + }, + ], }, parsed: { name: "Parsed", diff --git a/packages/lib-common/src/references/constants.ts b/packages/lib-common/src/references/constants.ts new file mode 100644 index 00000000000..75c0c2fa077 --- /dev/null +++ b/packages/lib-common/src/references/constants.ts @@ -0,0 +1,41 @@ +import { graphemeDefaultSpokenForms } from "./spokenForms/graphemeDefaultSpokenForms"; +import { hatColorDefaultSpokenForms } from "./spokenForms/markDefaultSpokenForms"; + +// Template variables +export const VAR_SPOKEN_FORM = ""; +export const VAR_TARGET = ""; +export const VAR_TARGET_1 = ""; +export const VAR_TARGET_2 = ""; +export const VAR_DESTINATION = ""; +export const VAR_SCOPE = ""; +export const VAR_SNIPPET = ""; +export const VAR_PAIR = ""; +export const VAR_FORMATTER = ""; +export const VAR_NUMBER = ""; +export const VAR_ORDINAL = ""; +export const VAR_MODIFIER = ""; +export const VAR_CHARACTER = ""; + +// Targets +export const TARGET = `${hatColorDefaultSpokenForms.blue} ${graphemeDefaultSpokenForms.a}`; +export const TARGET_DESC = "token containing letter 'a' with a blue hat"; +export const TARGET_2 = `${hatColorDefaultSpokenForms.green} ${graphemeDefaultSpokenForms.b}`; +export const TARGET_2_DESC = "token containing letter 'b' with a green hat"; +export const TARGET_NUMBER = `${hatColorDefaultSpokenForms.red} ${graphemeDefaultSpokenForms["5"]}`; +export const TARGET_NUMBER_DESC = "token containing number '5' with a red hat"; + +// Actions +export const SET_SELECTION = "take"; +export const REMOVE = "chuck"; + +// Modifiers +export const EVERY = "every"; + +// Scopes +export const LINE = "line"; +export const ITEM = "item"; +export const STATEMENT = "state"; + +// Misc +export const FORMATTER_CAMEL = "camel"; +export const SNIPPET_IF = "if"; diff --git a/packages/lib-common/src/references/index.ts b/packages/lib-common/src/references/index.ts index de62073f7da..d97391e702b 100644 --- a/packages/lib-common/src/references/index.ts +++ b/packages/lib-common/src/references/index.ts @@ -1,5 +1,9 @@ export * from "./actionReferences"; -export * from "./connectiveSpokenForms"; +export * from "./spokenForms/connectiveDefaultSpokenForms"; +export * from "./spokenForms/graphemeDefaultSpokenForms"; +export * from "./spokenForms/markDefaultSpokenForms"; +export * from "./spokenForms/numberDefaultSpokenForms"; export * from "./modifierReferences"; +export * from "./pairedDelimiterReferences"; export * from "./ReferenceEntry"; export * from "./scopeReferences"; diff --git a/packages/lib-common/src/references/modifierReferences.ts b/packages/lib-common/src/references/modifierReferences.ts index 2348da04ba5..04042e86326 100644 --- a/packages/lib-common/src/references/modifierReferences.ts +++ b/packages/lib-common/src/references/modifierReferences.ts @@ -1,26 +1,39 @@ import type { ModifierType } from "../types/command/PartialTargetDescriptor.types"; -import type { SpokenFormMapKeyTypes } from "../types/SpokenFormType"; -import type { ReferenceEntry, SpokenFormReference } from "./ReferenceEntry"; import { + EVERY, + ITEM, + LINE, + REMOVE, + SET_SELECTION, + STATEMENT, + TARGET, + TARGET_DESC, VAR_MODIFIER, VAR_NUMBER, VAR_ORDINAL, VAR_SCOPE, VAR_SPOKEN_FORM, -} from "./variables"; +} from "./constants"; +import { pairedDelimiterReferences } from "./pairedDelimiterReferences"; +import type { ReferenceEntry } from "./ReferenceEntry"; +import { connectiveDefaultSpokenForms } from "./spokenForms/connectiveDefaultSpokenForms"; +import { graphemeDefaultSpokenForms } from "./spokenForms/graphemeDefaultSpokenForms"; +import { ordinalDefaultSpokenForms } from "./spokenForms/numberDefaultSpokenForms"; const DEFAULT_PATTERN = VAR_SPOKEN_FORM; +const PARENTHESES = pairedDelimiterReferences.parentheses.defaultSpokenForm; +const THREE = graphemeDefaultSpokenForms["3"]; +const EXTEND_THROUGH_END_OF = "past end of"; +const THIRD = ordinalDefaultSpokenForms[3]; +const PREVIOUS = connectiveDefaultSpokenForms.previous; +const NEXT = connectiveDefaultSpokenForms.next; +const BACKWARD = connectiveDefaultSpokenForms.backward; +const FORWARD = connectiveDefaultSpokenForms.forward; +const FIRST = connectiveDefaultSpokenForms.first; +const LAST = connectiveDefaultSpokenForms.last; type AdditionalModifierReferenceType = "ancestor"; -const NEXT = "next"; -const FIRST = "first"; -const LAST = "last"; -const PREVIOUS = "previous"; -const BACKWARD = "backward"; -const FORWARD = "forward"; -const EVERY = "every"; - export const modifierReferences: Record< ModifierType | AdditionalModifierReferenceType, ReferenceEntry @@ -35,7 +48,12 @@ export const modifierReferences: Record< cheatsheet: "Empty position at start of target", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Places the cursor at the start of the ${TARGET_DESC}.`, + }, + ], }, endOf: { name: "End of", @@ -47,7 +65,12 @@ export const modifierReferences: Record< cheatsheet: "Empty position at end of target", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Places the cursor at the end of the ${TARGET_DESC}.`, + }, + ], }, interiorOnly: { name: "Interior only", @@ -59,7 +82,12 @@ export const modifierReferences: Record< cheatsheet: "Interior only", }, ], - examples: [], + 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", @@ -71,7 +99,12 @@ export const modifierReferences: Record< cheatsheet: "Bounding paired delimiters", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${PARENTHESES} ${TARGET}`, + description: `Selects only the parentheses containing the ${TARGET_DESC}.`, + }, + ], }, visible: { name: "Visible", @@ -83,7 +116,13 @@ export const modifierReferences: Record< cheatsheet: "Visible in viewport", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM}`, + description: + "Selects the content currently visible in the editor viewport.", + }, + ], }, containingScope: { name: "Containing scope", @@ -94,7 +133,12 @@ export const modifierReferences: Record< cheatsheet: `Containing instance of ${VAR_SCOPE}`, }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${STATEMENT} ${TARGET}`, + description: `Selects the statement containing the ${TARGET_DESC}.`, + }, + ], }, everyScope: { name: "Every scope", @@ -106,7 +150,12 @@ export const modifierReferences: Record< cheatsheet: `Every instance of ${VAR_SCOPE}`, }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, + description: `Selects every item in the map containing the ${TARGET_DESC}.`, + }, + ], }, ancestor: { name: "Ancestor", @@ -118,7 +167,12 @@ export const modifierReferences: Record< cheatsheet: `Grandparent containing instance of ${VAR_SCOPE}`, }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${STATEMENT} ${TARGET}`, + description: `Selects the parent statement of the statement containing the ${TARGET_DESC}.`, + }, + ], }, ordinalScope: { name: "Ordinal scope", @@ -154,7 +208,17 @@ export const modifierReferences: Record< cheatsheet: `Last ${VAR_NUMBER} instances of ${VAR_SCOPE} in iteration scope, as individual targets`, }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${THIRD} ${STATEMENT}`, + description: "Selects the third statement in the iteration scope.", + }, + { + command: `${SET_SELECTION} ${FIRST} ${THREE} ${STATEMENT}s`, + description: + "Selects a contiguous range containing the first three statements in the iteration scope.", + }, + ], }, relativeScope: { name: "Relative scope", @@ -230,7 +294,16 @@ export const modifierReferences: Record< cheatsheet: `Next ${VAR_NUMBER} instances of ${VAR_SCOPE}, as individual targets`, }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${NEXT} ${STATEMENT} ${TARGET}`, + description: `Selects the next statement after the statement containing the ${TARGET_DESC}.`, + }, + { + command: `${SET_SELECTION} ${THREE} ${STATEMENT}s ${BACKWARD} ${TARGET}`, + description: `Selects three statements as a contiguous range, starting at the ${TARGET_DESC} and going backward.`, + }, + ], }, extendThroughStartOf: { name: "Extend through start of", @@ -247,7 +320,12 @@ export const modifierReferences: Record< cheatsheet: `Extend through start of ${VAR_MODIFIER}`, }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects from the ${TARGET_DESC} through the start of its line or surrounding pair.`, + }, + ], }, extendThroughEndOf: { name: "Extend through end of", @@ -264,7 +342,12 @@ export const modifierReferences: Record< cheatsheet: `Extend through end of ${VAR_MODIFIER}`, }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects from the ${TARGET_DESC} through the end of its line or surrounding pair.`, + }, + ], }, leading: { name: "Leading", @@ -276,7 +359,12 @@ export const modifierReferences: Record< cheatsheet: "Leading delimiter range", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, + description: `Selects the leading delimiter of the item containing the ${TARGET_DESC}.`, + }, + ], }, trailing: { name: "Trailing", @@ -288,7 +376,12 @@ export const modifierReferences: Record< cheatsheet: "Trailing delimiter range", }, ], - examples: [], + 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", @@ -300,7 +393,12 @@ export const modifierReferences: Record< cheatsheet: "No inference", }, ], - examples: [], + examples: [ + { + command: `${REMOVE} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Deletes only the ${TARGET_DESC}, leaving adjacent whitespace unchanged.`, + }, + ], }, keepContentFilter: { name: "Keep content filter", @@ -312,7 +410,13 @@ export const modifierReferences: Record< cheatsheet: "Keep content filter", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM}`, + description: + "Selects only to the nonempty selections when there are multiple selections.", + }, + ], }, keepEmptyFilter: { name: "Keep empty filter", @@ -324,7 +428,13 @@ export const modifierReferences: Record< cheatsheet: "Keep empty filter", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM}`, + description: + "Selects only the empty selections when there are multiple selections.", + }, + ], }, inferPreviousMark: { name: "Infer previous mark", @@ -336,21 +446,18 @@ export const modifierReferences: Record< cheatsheet: "Infer previous mark", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${TARGET} ${EXTEND_THROUGH_END_OF} ${VAR_SPOKEN_FORM} ${LINE}`, + description: `Selects from the ${TARGET_DESC} through the end of the line containing that token.`, + }, + ], }, // Private modifiers, but that has spoken forms preferredScope: { name: "Preferred scope", private: true, - syntaxes: [], - examples: [], - }, - - // Modifiers without spoken forms - modifyIfUntyped: { - name: "Modify if untyped", - private: true, syntaxes: [ { pattern: VAR_SCOPE, @@ -358,6 +465,19 @@ export const modifierReferences: Record< cheatsheet: `Preferred instance of ${VAR_SCOPE}`, }, ], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${ITEM} ${TARGET}`, + description: `Selects the closest item to the ${TARGET_DESC}.`, + }, + ], + }, + + // Modifiers without spoken forms + modifyIfUntyped: { + name: "Modify if untyped", + private: true, + syntaxes: [], examples: [], }, fallback: { @@ -373,52 +493,3 @@ export const modifierReferences: Record< examples: [], }, }; - -export const simpleModifierReferenceIds = [ - "excludeInterior", - "toRawSelection", - "leading", - "trailing", - "keepContentFilter", - "keepEmptyFilter", - "inferPreviousMark", - "startOf", - "endOf", - "interiorOnly", - "visible", - "extendThroughStartOf", - "extendThroughEndOf", - "everyScope", -] as const satisfies readonly SpokenFormMapKeyTypes["simpleModifier"][]; - -export const modifierExtraReferenceIds = [ - "first", - "last", - "previous", - "next", - "forward", - "backward", - "ancestor", -] as const satisfies readonly SpokenFormMapKeyTypes["modifierExtra"][]; - -export const modifierExtraReferences = { - first: { - defaultSpokenForm: FIRST, - }, - last: { - defaultSpokenForm: LAST, - }, - previous: { - defaultSpokenForm: PREVIOUS, - }, - next: { - defaultSpokenForm: NEXT, - }, - forward: { - defaultSpokenForm: FORWARD, - }, - backward: { - defaultSpokenForm: BACKWARD, - }, - ancestor: modifierReferences.ancestor, -} satisfies Record; diff --git a/packages/lib-common/src/references/pairedDelimiterReferences.ts b/packages/lib-common/src/references/pairedDelimiterReferences.ts new file mode 100644 index 00000000000..048709f5525 --- /dev/null +++ b/packages/lib-common/src/references/pairedDelimiterReferences.ts @@ -0,0 +1,67 @@ +import type { SpeakableSurroundingPairName } from "../types/SpokenFormType"; +import type { SpokenFormReference } from "./ReferenceEntry"; + +export const pairedDelimiterReferences = { + curlyBrackets: { + defaultSpokenForm: "curly", + }, + angleBrackets: { + defaultSpokenForm: "diamond", + }, + escapedDoubleQuotes: { + defaultSpokenForm: "escaped quad", + }, + escapedSingleQuotes: { + defaultSpokenForm: "escaped twin", + }, + escapedParentheses: { + defaultSpokenForm: "escaped round", + }, + escapedSquareBrackets: { + defaultSpokenForm: "escaped box", + }, + doubleQuotes: { + defaultSpokenForm: "quad", + }, + parentheses: { + defaultSpokenForm: "round", + }, + backtickQuotes: { + defaultSpokenForm: "skis", + }, + squareBrackets: { + defaultSpokenForm: "box", + }, + singleQuotes: { + defaultSpokenForm: "twin", + }, + tripleDoubleQuotes: { + defaultSpokenForm: "triple quad", + disabledByDefault: true, + private: true, + }, + tripleSingleQuotes: { + defaultSpokenForm: "triple twin", + disabledByDefault: true, + private: true, + }, + tripleBacktickQuotes: { + defaultSpokenForm: "triple skis", + disabledByDefault: true, + private: true, + }, + any: { + defaultSpokenForm: "pair", + }, + string: { + defaultSpokenForm: "string", + }, + whitespace: { + defaultSpokenForm: "void", + }, + collectionBoundary: { + defaultSpokenForm: "collection boundary", + disabledByDefault: true, + private: true, + }, +} satisfies Record; diff --git a/packages/lib-common/src/references/scopeReferences.ts b/packages/lib-common/src/references/scopeReferences.ts index 2001f826246..b25429c084f 100644 --- a/packages/lib-common/src/references/scopeReferences.ts +++ b/packages/lib-common/src/references/scopeReferences.ts @@ -1,9 +1,27 @@ import type { ScopeTypeType } from "../types/command/PartialTargetDescriptor.types"; +import { + EVERY, + ITEM, + LINE, + SET_SELECTION, + STATEMENT, + VAR_CHARACTER, + VAR_PAIR, + VAR_SPOKEN_FORM, +} from "./constants"; +import { pairedDelimiterReferences } from "./pairedDelimiterReferences"; import type { ReferenceEntry } from "./ReferenceEntry"; -import { VAR_CHARACTER, VAR_PAIR, VAR_SPOKEN_FORM } from "./variables"; +import { connectiveDefaultSpokenForms } from "./spokenForms/connectiveDefaultSpokenForms"; +import { graphemeDefaultSpokenForms } from "./spokenForms/graphemeDefaultSpokenForms"; const DEFAULT_PATTERN = VAR_SPOKEN_FORM; +const AIR = graphemeDefaultSpokenForms.a; +const TARGET = `blue ${AIR}`; +const TARGET_DESC = "token containing letter 'a' with a blue hat"; +const PARENTHESIS = pairedDelimiterReferences.parentheses.defaultSpokenForm; +const NEXT = connectiveDefaultSpokenForms.next; + export const scopeReferences: Record = { argumentOrParameter: { name: "Argument or parameter", @@ -15,7 +33,12 @@ export const scopeReferences: Record = { cheatsheet: "Argument", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the argument or parameter containing the ${TARGET_DESC}.`, + }, + ], }, argumentList: { name: "Argument list", @@ -27,7 +50,12 @@ export const scopeReferences: Record = { cheatsheet: "Argument list", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the argument list containing the ${TARGET_DESC}.`, + }, + ], }, anonymousFunction: { name: "Anonymous function", @@ -39,7 +67,12 @@ export const scopeReferences: Record = { cheatsheet: "Anonymous function", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the anonymous function containing the ${TARGET_DESC}.`, + }, + ], }, attribute: { name: "Attribute", @@ -51,7 +84,12 @@ export const scopeReferences: Record = { cheatsheet: "Attribute", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the attribute containing the ${TARGET_DESC}.`, + }, + ], }, branch: { name: "Branch", @@ -63,7 +101,12 @@ export const scopeReferences: Record = { cheatsheet: "Branch", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the branch containing the ${TARGET_DESC}.`, + }, + ], }, class: { name: "Class", @@ -75,7 +118,12 @@ export const scopeReferences: Record = { cheatsheet: "Class", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the class containing the ${TARGET_DESC}.`, + }, + ], }, className: { name: "Class name", @@ -87,11 +135,16 @@ export const scopeReferences: Record = { cheatsheet: "Class name", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the class name containing the ${TARGET_DESC}.`, + }, + ], }, collectionItem: { name: "Collection item", - defaultSpokenForm: "item", + defaultSpokenForm: ITEM, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -99,7 +152,12 @@ export const scopeReferences: Record = { cheatsheet: "Collection item", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the collection item containing the ${TARGET_DESC}.`, + }, + ], }, collectionKey: { name: "Collection key", @@ -111,7 +169,12 @@ export const scopeReferences: Record = { cheatsheet: "Collection key", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the collection key containing the ${TARGET_DESC}.`, + }, + ], }, comment: { name: "Comment", @@ -123,7 +186,12 @@ export const scopeReferences: Record = { cheatsheet: "Comment", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the comment containing the ${TARGET_DESC}.`, + }, + ], }, functionCall: { name: "Function call", @@ -135,7 +203,12 @@ export const scopeReferences: Record = { cheatsheet: "Function call", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the function call containing the ${TARGET_DESC}.`, + }, + ], }, functionCallee: { name: "Function callee", @@ -147,7 +220,12 @@ export const scopeReferences: Record = { cheatsheet: "Function callee", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the function callee containing the ${TARGET_DESC}.`, + }, + ], }, functionName: { name: "Function name", @@ -159,7 +237,12 @@ export const scopeReferences: Record = { cheatsheet: "Function name", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the function name containing the ${TARGET_DESC}.`, + }, + ], }, ifStatement: { name: "If statement", @@ -171,7 +254,12 @@ export const scopeReferences: Record = { cheatsheet: "If statement", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the if statement containing the ${TARGET_DESC}.`, + }, + ], }, instance: { name: "Instance", @@ -183,7 +271,12 @@ export const scopeReferences: Record = { cheatsheet: "Instance", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${EVERY} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects every instance of the ${TARGET_DESC}.`, + }, + ], }, list: { name: "List", @@ -195,7 +288,12 @@ export const scopeReferences: Record = { cheatsheet: "List", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the list containing the ${TARGET_DESC}.`, + }, + ], }, map: { name: "Map", @@ -207,7 +305,12 @@ export const scopeReferences: Record = { cheatsheet: "Map", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the map containing the ${TARGET_DESC}.`, + }, + ], }, name: { name: "Name", @@ -219,7 +322,12 @@ export const scopeReferences: Record = { cheatsheet: "Name", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the name containing the ${TARGET_DESC}.`, + }, + ], }, namedFunction: { name: "Named function", @@ -231,7 +339,12 @@ export const scopeReferences: Record = { cheatsheet: "Named function", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the named function containing the ${TARGET_DESC}.`, + }, + ], }, regularExpression: { name: "Regular expression", @@ -243,11 +356,16 @@ export const scopeReferences: Record = { cheatsheet: "Regular expression", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the regular expression containing the ${TARGET_DESC}.`, + }, + ], }, statement: { name: "Statement", - defaultSpokenForm: "state", + defaultSpokenForm: STATEMENT, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -255,7 +373,12 @@ export const scopeReferences: Record = { cheatsheet: "Statement", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the statement containing the ${TARGET_DESC}.`, + }, + ], }, type: { name: "Type", @@ -267,7 +390,12 @@ export const scopeReferences: Record = { cheatsheet: "Type", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the type containing the ${TARGET_DESC}.`, + }, + ], }, value: { name: "Value", @@ -279,7 +407,12 @@ export const scopeReferences: Record = { cheatsheet: "Value", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the value containing the ${TARGET_DESC}.`, + }, + ], }, condition: { name: "Condition", @@ -291,7 +424,12 @@ export const scopeReferences: Record = { cheatsheet: "Condition", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the condition containing the ${TARGET_DESC}.`, + }, + ], }, section: { name: "Section", @@ -303,7 +441,12 @@ export const scopeReferences: Record = { cheatsheet: "Section", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the section containing the ${TARGET_DESC}.`, + }, + ], }, sectionLevelOne: { name: "Section level one", @@ -316,7 +459,12 @@ export const scopeReferences: Record = { cheatsheet: "Section level one", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the section level one containing the ${TARGET_DESC}.`, + }, + ], }, sectionLevelTwo: { name: "Section level two", @@ -329,7 +477,12 @@ export const scopeReferences: Record = { cheatsheet: "Section level two", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the section level two containing the ${TARGET_DESC}.`, + }, + ], }, sectionLevelThree: { name: "Section level three", @@ -342,7 +495,12 @@ export const scopeReferences: Record = { cheatsheet: "Section level three", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the section level three containing the ${TARGET_DESC}.`, + }, + ], }, sectionLevelFour: { name: "Section level four", @@ -355,7 +513,12 @@ export const scopeReferences: Record = { cheatsheet: "Section level four", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the section level four containing the ${TARGET_DESC}.`, + }, + ], }, sectionLevelFive: { name: "Section level five", @@ -368,7 +531,12 @@ export const scopeReferences: Record = { cheatsheet: "Section level five", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the section level five containing the ${TARGET_DESC}.`, + }, + ], }, sectionLevelSix: { name: "Section level six", @@ -381,7 +549,12 @@ export const scopeReferences: Record = { cheatsheet: "Section level six", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the section level six containing the ${TARGET_DESC}.`, + }, + ], }, selector: { name: "Selector", @@ -393,7 +566,12 @@ export const scopeReferences: Record = { cheatsheet: "Selector", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the selector containing the ${TARGET_DESC}.`, + }, + ], }, unit: { name: "Unit", @@ -405,7 +583,12 @@ export const scopeReferences: Record = { cheatsheet: "Unit", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the unit containing the ${TARGET_DESC}.`, + }, + ], }, xmlBothTags: { name: "XML both tags", @@ -417,7 +600,12 @@ export const scopeReferences: Record = { cheatsheet: "XML both tags", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the xml both tags containing the ${TARGET_DESC}.`, + }, + ], }, xmlElement: { name: "XML element", @@ -429,7 +617,12 @@ export const scopeReferences: Record = { cheatsheet: "XML element", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the xml element containing the ${TARGET_DESC}.`, + }, + ], }, xmlEndTag: { name: "XML end tag", @@ -441,7 +634,12 @@ export const scopeReferences: Record = { cheatsheet: "XML end tag", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the xml end tag containing the ${TARGET_DESC}.`, + }, + ], }, xmlStartTag: { name: "XML start tag", @@ -453,7 +651,12 @@ export const scopeReferences: Record = { cheatsheet: "XML start tag", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the xml start tag containing the ${TARGET_DESC}.`, + }, + ], }, part: { name: "Part", @@ -465,7 +668,12 @@ export const scopeReferences: Record = { cheatsheet: "Part", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the part containing the ${TARGET_DESC}.`, + }, + ], }, chapter: { name: "Chapter", @@ -477,7 +685,12 @@ export const scopeReferences: Record = { cheatsheet: "Chapter", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the chapter containing the ${TARGET_DESC}.`, + }, + ], }, subSection: { name: "Subsection", @@ -489,7 +702,12 @@ export const scopeReferences: Record = { cheatsheet: "Subsection", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the subsection containing the ${TARGET_DESC}.`, + }, + ], }, subSubSection: { name: "Subsubsection", @@ -501,7 +719,12 @@ export const scopeReferences: Record = { cheatsheet: "Subsubsection", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the subsubsection containing the ${TARGET_DESC}.`, + }, + ], }, namedParagraph: { name: "Named paragraph", @@ -513,7 +736,12 @@ export const scopeReferences: Record = { cheatsheet: "Named paragraph", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the named paragraph containing the ${TARGET_DESC}.`, + }, + ], }, subParagraph: { name: "Subparagraph", @@ -525,7 +753,12 @@ export const scopeReferences: Record = { cheatsheet: "Subparagraph", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the subparagraph containing the ${TARGET_DESC}.`, + }, + ], }, environment: { name: "Environment", @@ -537,7 +770,12 @@ export const scopeReferences: Record = { cheatsheet: "Environment", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the environment containing the ${TARGET_DESC}.`, + }, + ], }, character: { name: "Character", @@ -549,7 +787,12 @@ export const scopeReferences: Record = { cheatsheet: "Character", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the character containing the ${TARGET_DESC}.`, + }, + ], }, word: { name: "Sub token word", @@ -562,7 +805,12 @@ export const scopeReferences: Record = { cheatsheet: "Sub token word", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the sub token word containing the ${TARGET_DESC}.`, + }, + ], }, token: { name: "Token", @@ -574,7 +822,12 @@ export const scopeReferences: Record = { cheatsheet: "Token", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the token containing the ${TARGET_DESC}.`, + }, + ], }, identifier: { name: "Identifier", @@ -586,11 +839,16 @@ export const scopeReferences: Record = { cheatsheet: "Identifier", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the identifier containing the ${TARGET_DESC}.`, + }, + ], }, line: { name: "Line", - defaultSpokenForm: "line", + defaultSpokenForm: LINE, syntaxes: [ { pattern: DEFAULT_PATTERN, @@ -598,7 +856,12 @@ export const scopeReferences: Record = { cheatsheet: "Line", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the line containing the ${TARGET_DESC}.`, + }, + ], }, fullLine: { name: "Full line", @@ -610,7 +873,12 @@ export const scopeReferences: Record = { cheatsheet: "Full line", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the full line containing the ${TARGET_DESC}.`, + }, + ], }, sentence: { name: "Sentence", @@ -622,7 +890,12 @@ export const scopeReferences: Record = { cheatsheet: "Sentence", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the sentence containing the ${TARGET_DESC}.`, + }, + ], }, paragraph: { name: "Paragraph", @@ -634,7 +907,12 @@ export const scopeReferences: Record = { cheatsheet: "Paragraph", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the paragraph containing the ${TARGET_DESC}.`, + }, + ], }, boundedParagraph: { name: "Bounded paragraph", @@ -646,7 +924,12 @@ export const scopeReferences: Record = { cheatsheet: "Paragraph bounded by surrounding pair delimiters", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the bounded paragraph containing the ${TARGET_DESC}.`, + }, + ], }, document: { name: "Document", @@ -658,7 +941,12 @@ export const scopeReferences: Record = { cheatsheet: "Document", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the document containing the ${TARGET_DESC}.`, + }, + ], }, nonWhitespaceSequence: { name: "Non-whitespace sequence", @@ -670,7 +958,12 @@ export const scopeReferences: Record = { cheatsheet: "Non-whitespace sequence", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the non-whitespace sequence containing the ${TARGET_DESC}.`, + }, + ], }, boundedNonWhitespaceSequence: { name: "Bounded non-whitespace sequence", @@ -685,7 +978,12 @@ export const scopeReferences: Record = { "Non-whitespace sequence bounded by surrounding pair delimiters", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the bounded non-whitespace sequence containing the ${TARGET_DESC}.`, + }, + ], }, url: { name: "URL", @@ -697,7 +995,12 @@ export const scopeReferences: Record = { cheatsheet: "URL", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the url containing the ${TARGET_DESC}.`, + }, + ], }, notebookCell: { name: "Notebook cell", @@ -709,7 +1012,12 @@ export const scopeReferences: Record = { cheatsheet: "Notebook cell", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the notebook cell containing the ${TARGET_DESC}.`, + }, + ], }, command: { name: "Command", @@ -721,7 +1029,12 @@ export const scopeReferences: Record = { cheatsheet: "Command", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the command containing the ${TARGET_DESC}.`, + }, + ], }, glyph: { name: "Glyph", @@ -733,7 +1046,12 @@ export const scopeReferences: Record = { cheatsheet: `Instance of single character ${VAR_CHARACTER}`, }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${NEXT} ${VAR_SPOKEN_FORM} ${AIR}`, + description: `Selects the next 'a'.`, + }, + ], }, surroundingPair: { name: "Surrounding pair", @@ -744,7 +1062,12 @@ export const scopeReferences: Record = { cheatsheet: "Surrounding pair", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${PARENTHESIS} ${TARGET}`, + description: `Selects the parentheses containing the ${TARGET_DESC}.`, + }, + ], }, // Private scopes -------------------- @@ -760,7 +1083,12 @@ export const scopeReferences: Record = { cheatsheet: "Field access", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the field access containing the ${TARGET_DESC}.`, + }, + ], }, string: { name: "String", @@ -773,7 +1101,12 @@ export const scopeReferences: Record = { cheatsheet: "String", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the string containing the ${TARGET_DESC}.`, + }, + ], }, textFragment: { name: "Text fragment", @@ -786,7 +1119,12 @@ export const scopeReferences: Record = { cheatsheet: "Text fragment", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the text fragment containing the ${TARGET_DESC}.`, + }, + ], }, disqualifyDelimiter: { name: "Disqualify delimiter", @@ -799,7 +1137,12 @@ export const scopeReferences: Record = { cheatsheet: "Disqualify delimiter", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the disqualify delimiter containing the ${TARGET_DESC}.`, + }, + ], }, pairDelimiter: { name: "Pair delimiter", @@ -812,7 +1155,12 @@ export const scopeReferences: Record = { cheatsheet: "Pair delimiter", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the pair delimiter containing the ${TARGET_DESC}.`, + }, + ], }, interior: { name: "Interior", @@ -825,7 +1173,12 @@ export const scopeReferences: Record = { cheatsheet: "Interior", }, ], - examples: [], + examples: [ + { + command: `${SET_SELECTION} ${VAR_SPOKEN_FORM} ${TARGET}`, + description: `Selects the interior containing the ${TARGET_DESC}.`, + }, + ], }, surroundingPairInterior: { name: "Surrounding pair interior", diff --git a/packages/lib-common/src/references/connectiveSpokenForms.ts b/packages/lib-common/src/references/spokenForms/connectiveDefaultSpokenForms.ts similarity index 80% rename from packages/lib-common/src/references/connectiveSpokenForms.ts rename to packages/lib-common/src/references/spokenForms/connectiveDefaultSpokenForms.ts index ad83f4d2dc3..773a61eb7fc 100644 --- a/packages/lib-common/src/references/connectiveSpokenForms.ts +++ b/packages/lib-common/src/references/spokenForms/connectiveDefaultSpokenForms.ts @@ -1,4 +1,4 @@ -export const connectiveSpokenForms = { +export const connectiveDefaultSpokenForms = { rangeExclusive: "between", rangeInclusive: "past", // Note: rangeExcludingStart has no default spoken form @@ -11,8 +11,13 @@ export const connectiveSpokenForms = { after: "after", verticalRange: "slice", + first: "first", + last: "last", previous: "previous", next: "next", forward: "forward", backward: "backward", + + at: "at", + on: "on", } as const; diff --git a/packages/lib-engine/src/spokenForms/graphemes.ts b/packages/lib-common/src/references/spokenForms/graphemeDefaultSpokenForms.ts similarity index 60% rename from packages/lib-engine/src/spokenForms/graphemes.ts rename to packages/lib-common/src/references/spokenForms/graphemeDefaultSpokenForms.ts index ee568f87bc7..af68dbbf24d 100644 --- a/packages/lib-engine/src/spokenForms/graphemes.ts +++ b/packages/lib-common/src/references/spokenForms/graphemeDefaultSpokenForms.ts @@ -1,18 +1,51 @@ // https://github.com/talonhub/community/blob/9acb6c9659bb0c9b794a7b7126d025603b4ed726/core/keys/keys.py +const offset = "a".codePointAt(0)!; + const alphabet = Object.fromEntries( - "air bat cap drum each fine gust harp sit jury crunch look made near odd pit quench red sun trap urge vest whale plex yank zip" - .split(" ") - .map((word, index) => [ - String.fromCodePoint("a".codePointAt(0)! + index), - word, - ]), + [ + "air", + "bat", + "cap", + "drum", + "each", + "fine", + "gust", + "harp", + "sit", + "jury", + "crunch", + "look", + "made", + "near", + "odd", + "pit", + "quench", + "red", + "sun", + "trap", + "urge", + "vest", + "whale", + "plex", + "yank", + "zip", + ].map((word, index) => [String.fromCodePoint(offset + index), word]), ); const digits = Object.fromEntries( - "zero one two three four five six seven eight nine" - .split(" ") - .map((word, index) => [index.toString(), word]), + [ + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + ].map((word, index) => [index.toString(), word]), ); const symbols = { diff --git a/packages/lib-common/src/references/spokenForms/markDefaultSpokenForms.ts b/packages/lib-common/src/references/spokenForms/markDefaultSpokenForms.ts new file mode 100644 index 00000000000..9a9fb9b1d3a --- /dev/null +++ b/packages/lib-common/src/references/spokenForms/markDefaultSpokenForms.ts @@ -0,0 +1,52 @@ +import type { PartialMark } from "../../types/command/PartialTargetDescriptor.types"; + +type MarkType = PartialMark["type"]; + +export const hatColorDefaultSpokenForms: Record = { + blue: "blue", + green: "green", + red: "red", + pink: "pink", + yellow: "yellow", + userColor1: "navy", + userColor2: "apricot", + userColor3: "user color three", + userColor4: "user color four", + + default: null, +}; + +export const hatShapeDefaultSpokenForms: Record = { + ex: "ex", + fox: "fox", + wing: "wing", + hole: "hole", + frame: "frame", + curve: "curve", + eye: "eye", + play: "play", + crosshairs: "cross", + bolt: "bolt", + + default: null, +}; + +export const markDefaultSpokenForms = { + cursor: "this", + that: "that", + source: "source", + nothing: "nothing", + + keyboard: null, + explicit: null, + decoratedSymbol: null, + lineNumber: null, + range: null, + target: null, +} as const satisfies Record; + +export const lineDirectionDefaultSpokenForms = { + modulo100: "row", + relativeUp: "up", + relativeDown: "down", +} as const; diff --git a/packages/lib-common/src/references/spokenForms/numberDefaultSpokenForms.ts b/packages/lib-common/src/references/spokenForms/numberDefaultSpokenForms.ts new file mode 100644 index 00000000000..5c6226c00b0 --- /dev/null +++ b/packages/lib-common/src/references/spokenForms/numberDefaultSpokenForms.ts @@ -0,0 +1,126 @@ +export const numberDefaultSpokenForms = [ + "zero", + "one", + "two", + "three", + "four", + "five", + "six", + "seven", + "eight", + "nine", + "ten", + "eleven", + "twelve", + "thirteen", + "fourteen", + "fifteen", + "sixteen", + "seventeen", + "eighteen", + "nineteen", + "twenty", + "twenty one", + "twenty two", + "twenty three", + "twenty four", + "twenty five", + "twenty six", + "twenty seven", + "twenty eight", + "twenty nine", + "thirty", + "thirty one", + "thirty two", + "thirty three", + "thirty four", + "thirty five", + "thirty six", + "thirty seven", + "thirty eight", + "thirty nine", + "forty", + "forty one", + "forty two", + "forty three", + "forty four", + "forty five", + "forty six", + "forty seven", + "forty eight", + "forty nine", + "fifty", + "fifty one", + "fifty two", + "fifty three", + "fifty four", + "fifty five", + "fifty six", + "fifty seven", + "fifty eight", + "fifty nine", + "sixty", + "sixty one", + "sixty two", + "sixty three", + "sixty four", + "sixty five", + "sixty six", + "sixty seven", + "sixty eight", + "sixty nine", + "seventy", + "seventy one", + "seventy two", + "seventy three", + "seventy four", + "seventy five", + "seventy six", + "seventy seven", + "seventy eight", + "seventy nine", + "eighty", + "eighty one", + "eighty two", + "eighty three", + "eighty four", + "eighty five", + "eighty six", + "eighty seven", + "eighty eight", + "eighty nine", + "ninety", + "ninety one", + "ninety two", + "ninety three", + "ninety four", + "ninety five", + "ninety six", + "ninety seven", + "ninety eight", + "ninety nine", +]; + +export const ordinalDefaultSpokenForms = [ + "zeroth", + "first", + "second", + "third", + "fourth", + "fifth", + "sixth", + "seventh", + "eighth", + "ninth", + "tenth", + "eleventh", + "twelfth", + "thirteenth", + "fourteenth", + "fifteenth", + "sixteenth", + "seventeenth", + "eighteenth", + "nineteenth", + "twentieth", +]; diff --git a/packages/lib-common/src/references/variables.ts b/packages/lib-common/src/references/variables.ts deleted file mode 100644 index 305491cedd0..00000000000 --- a/packages/lib-common/src/references/variables.ts +++ /dev/null @@ -1,13 +0,0 @@ -export const VAR_SPOKEN_FORM = ""; -export const VAR_TARGET = ""; -export const VAR_TARGET_1 = ""; -export const VAR_TARGET_2 = ""; -export const VAR_DESTINATION = ""; -export const VAR_SCOPE = ""; -export const VAR_SNIPPET = ""; -export const VAR_PAIR = ""; -export const VAR_FORMATTER = ""; -export const VAR_NUMBER = ""; -export const VAR_ORDINAL = ""; -export const VAR_MODIFIER = ""; -export const VAR_CHARACTER = ""; diff --git a/packages/lib-engine/src/customCommandGrammar/lexer.ts b/packages/lib-engine/src/customCommandGrammar/lexer.ts index 29834ead999..a8fdab30100 100644 --- a/packages/lib-engine/src/customCommandGrammar/lexer.ts +++ b/packages/lib-engine/src/customCommandGrammar/lexer.ts @@ -3,12 +3,12 @@ import type { InsertionMode, } from "@cursorless/lib-common"; import { - connectiveSpokenForms, + connectiveDefaultSpokenForms, + markDefaultSpokenForms, simpleActionNames, simpleScopeTypeTypes, surroundingPairNames, } from "@cursorless/lib-common"; -import { marks } from "../generateSpokenForm/defaultSpokenForms/marks"; import { defaultSpokenFormMap } from "../spokenForms/defaultSpokenFormMap"; import { CommandLexer } from "./CommandLexer"; @@ -50,7 +50,7 @@ const insertionModes: InsertionMode[] = ["before", "after", "to"]; for (const insertionMode of insertionModes) { const spokenForm = - connectiveSpokenForms[ + connectiveDefaultSpokenForms[ insertionMode === "to" ? "sourceDestinationConnective" : insertionMode ]; tokens[spokenForm] = { @@ -80,7 +80,7 @@ for (const pairedDelimiter of surroundingPairNames) { } } -for (const [mark, spokenForm] of Object.entries(marks)) { +for (const [mark, spokenForm] of Object.entries(markDefaultSpokenForms)) { if (spokenForm != null) { tokens[spokenForm] = { type: "simpleMarkType", diff --git a/packages/lib-engine/src/generateSpokenForm/defaultSpokenForms/marks.ts b/packages/lib-engine/src/generateSpokenForm/defaultSpokenForms/marks.ts index 3741fd6b879..30ddc9a1360 100644 --- a/packages/lib-engine/src/generateSpokenForm/defaultSpokenForms/marks.ts +++ b/packages/lib-engine/src/generateSpokenForm/defaultSpokenForms/marks.ts @@ -1,58 +1,10 @@ -import type { PartialMark } from "@cursorless/lib-common"; - -const hatColors: Record = { - blue: "blue", - green: "green", - red: "red", - pink: "pink", - yellow: "yellow", - userColor1: "navy", - userColor2: "apricot", - userColor3: "user color three", - userColor4: "user color four", - - default: null, -}; - -const hatShapes: Record = { - ex: "ex", - fox: "fox", - wing: "wing", - hole: "hole", - frame: "frame", - curve: "curve", - eye: "eye", - play: "play", - crosshairs: "cross", - bolt: "bolt", - - default: null, -}; - -type MarkType = PartialMark["type"]; - -export const marks = { - cursor: "this", - that: "that", - source: "source", - nothing: "nothing", - - keyboard: null, - explicit: null, - decoratedSymbol: null, - lineNumber: null, - range: null, - target: null, -} as const satisfies Record; - -export const lineDirections = { - modulo100: "row", - relativeUp: "up", - relativeDown: "down", -}; +import { + hatColorDefaultSpokenForms, + hatShapeDefaultSpokenForms, +} from "@cursorless/lib-common"; export function hatColorToSpokenForm(color: string): string { - const result = hatColors[color]; + const result = hatColorDefaultSpokenForms[color]; if (result == null) { throw new Error(`Unknown hat color '${color}'`); } @@ -60,7 +12,7 @@ export function hatColorToSpokenForm(color: string): string { } export function hatShapeToSpokenForm(shape: string): string { - const result = hatShapes[shape]; + const result = hatShapeDefaultSpokenForms[shape]; if (result == null) { throw new Error(`Unknown hat shape '${shape}'`); } diff --git a/packages/lib-engine/src/generateSpokenForm/defaultSpokenForms/numbers.ts b/packages/lib-engine/src/generateSpokenForm/defaultSpokenForms/numbers.ts index 2330dd06911..6683c2aa26d 100644 --- a/packages/lib-engine/src/generateSpokenForm/defaultSpokenForms/numbers.ts +++ b/packages/lib-engine/src/generateSpokenForm/defaultSpokenForms/numbers.ts @@ -1,132 +1,10 @@ -const numbers = [ - "zero", - "one", - "two", - "three", - "four", - "five", - "six", - "seven", - "eight", - "nine", - "ten", - "eleven", - "twelve", - "thirteen", - "fourteen", - "fifteen", - "sixteen", - "seventeen", - "eighteen", - "nineteen", - "twenty", - "twenty one", - "twenty two", - "twenty three", - "twenty four", - "twenty five", - "twenty six", - "twenty seven", - "twenty eight", - "twenty nine", - "thirty", - "thirty one", - "thirty two", - "thirty three", - "thirty four", - "thirty five", - "thirty six", - "thirty seven", - "thirty eight", - "thirty nine", - "forty", - "forty one", - "forty two", - "forty three", - "forty four", - "forty five", - "forty six", - "forty seven", - "forty eight", - "forty nine", - "fifty", - "fifty one", - "fifty two", - "fifty three", - "fifty four", - "fifty five", - "fifty six", - "fifty seven", - "fifty eight", - "fifty nine", - "sixty", - "sixty one", - "sixty two", - "sixty three", - "sixty four", - "sixty five", - "sixty six", - "sixty seven", - "sixty eight", - "sixty nine", - "seventy", - "seventy one", - "seventy two", - "seventy three", - "seventy four", - "seventy five", - "seventy six", - "seventy seven", - "seventy eight", - "seventy nine", - "eighty", - "eighty one", - "eighty two", - "eighty three", - "eighty four", - "eighty five", - "eighty six", - "eighty seven", - "eighty eight", - "eighty nine", - "ninety", - "ninety one", - "ninety two", - "ninety three", - "ninety four", - "ninety five", - "ninety six", - "ninety seven", - "ninety eight", - "ninety nine", -]; - -const ordinals = [ - "zeroth", - "first", - "second", - "third", - "fourth", - "fifth", - "sixth", - "seventh", - "eighth", - "ninth", - "tenth", - "eleventh", - "twelfth", - "thirteenth", - "fourteenth", - "fifteenth", - "sixteenth", - "seventeenth", - "eighteenth", - "nineteenth", - "twentieth", -]; +import { + numberDefaultSpokenForms, + ordinalDefaultSpokenForms, +} from "@cursorless/lib-common"; export function numberToSpokenForm(number: number): string { - const result = numbers[number]; + const result = numberDefaultSpokenForms[number]; if (result == null) { throw new Error(`Unknown number '${number}'`); } @@ -134,7 +12,7 @@ export function numberToSpokenForm(number: number): string { } export function ordinalToSpokenForm(ordinal: number): string { - const result = ordinals[ordinal]; + const result = ordinalDefaultSpokenForms[ordinal]; if (result == null) { throw new Error(`Unknown ordinal '${ordinal}'`); } diff --git a/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.ts b/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.ts index ccc75ef8a2c..b71300aad43 100644 --- a/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.ts +++ b/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.ts @@ -11,7 +11,7 @@ import type { } from "@cursorless/lib-common"; import { camelCaseToAllDown, - connectiveSpokenForms, + connectiveDefaultSpokenForms, DOCS_URL, } from "@cursorless/lib-common"; import type { SpokenFormMap } from "../spokenForms/SpokenFormMap"; @@ -139,7 +139,7 @@ export class SpokenFormGenerator { return [ this.spokenFormMap.action[action.name], this.handleTarget(action.target1), - connectiveSpokenForms.swapConnective, + connectiveDefaultSpokenForms.swapConnective, this.handleTarget(action.target2), ]; @@ -153,7 +153,7 @@ export class SpokenFormGenerator { return [ this.spokenFormMap.action[action.name], this.handleTarget(action.callee), - "on", + connectiveDefaultSpokenForms.on, this.handleTarget(action.argument), ]; @@ -228,7 +228,7 @@ export class SpokenFormGenerator { i === 0 ? this.handleTarget(element) : [ - connectiveSpokenForms.listConnective, + connectiveDefaultSpokenForms.listConnective, this.handleTarget(element), ], ); @@ -267,7 +267,7 @@ export class SpokenFormGenerator { i === 0 ? this.handleDestination(destination) : [ - connectiveSpokenForms.listConnective, + connectiveDefaultSpokenForms.listConnective, this.handleDestination(destination), ], ); @@ -288,11 +288,11 @@ export class SpokenFormGenerator { private handleInsertionMode(insertionMode: InsertionMode): string { switch (insertionMode) { case "to": - return connectiveSpokenForms.sourceDestinationConnective; + return connectiveDefaultSpokenForms.sourceDestinationConnective; case "before": - return connectiveSpokenForms.before; + return connectiveDefaultSpokenForms.before; case "after": - return connectiveSpokenForms.after; + return connectiveDefaultSpokenForms.after; // No default } } diff --git a/packages/lib-engine/src/generateSpokenForm/getRangeConnective.ts b/packages/lib-engine/src/generateSpokenForm/getRangeConnective.ts index 96bad4d267b..00df734b145 100644 --- a/packages/lib-engine/src/generateSpokenForm/getRangeConnective.ts +++ b/packages/lib-engine/src/generateSpokenForm/getRangeConnective.ts @@ -1,5 +1,5 @@ import type { PartialRangeType } from "@cursorless/lib-common"; -import { connectiveSpokenForms } from "@cursorless/lib-common"; +import { connectiveDefaultSpokenForms } from "@cursorless/lib-common"; import { NoSpokenFormError } from "./NoSpokenFormError"; export function getRangeConnective( @@ -8,19 +8,19 @@ export function getRangeConnective( type?: PartialRangeType, ): string { const prefix = - type === "vertical" ? `${connectiveSpokenForms.verticalRange} ` : ""; + type === "vertical" ? `${connectiveDefaultSpokenForms.verticalRange} ` : ""; if (excludeAnchor && excludeActive) { - return prefix + connectiveSpokenForms.rangeExclusive; + return prefix + connectiveDefaultSpokenForms.rangeExclusive; } if (excludeAnchor) { throw new NoSpokenFormError("Range exclude anchor"); } if (excludeActive) { - return prefix + connectiveSpokenForms.rangeExcludingEnd; + return prefix + connectiveDefaultSpokenForms.rangeExcludingEnd; } if (type === "vertical") { // "slice", but could have been "slice past" - return connectiveSpokenForms.verticalRange; + return connectiveDefaultSpokenForms.verticalRange; } - return connectiveSpokenForms.rangeInclusive; + return connectiveDefaultSpokenForms.rangeInclusive; } diff --git a/packages/lib-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts b/packages/lib-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts index 6d9cabe09bc..4b39be7d965 100644 --- a/packages/lib-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts +++ b/packages/lib-engine/src/generateSpokenForm/primitiveTargetToSpokenForm.ts @@ -6,12 +6,14 @@ import type { RelativeScopeModifier, ScopeType, } from "@cursorless/lib-common"; -import { connectiveSpokenForms } from "@cursorless/lib-common"; +import { + connectiveDefaultSpokenForms, + lineDirectionDefaultSpokenForms, + markDefaultSpokenForms, +} from "@cursorless/lib-common"; import { hatColorToSpokenForm, hatShapeToSpokenForm, - lineDirections, - marks, } from "./defaultSpokenForms/marks"; import { numberToSpokenForm, @@ -167,8 +169,8 @@ export class PrimitiveTargetSpokenFormGenerator { if (modifier.length === 1) { const direction = modifier.direction === "forward" - ? connectiveSpokenForms.forward - : connectiveSpokenForms.backward; + ? connectiveDefaultSpokenForms.forward + : connectiveDefaultSpokenForms.backward; // token forward/backward return [isEvery, scope, direction]; @@ -184,7 +186,12 @@ export class PrimitiveTargetSpokenFormGenerator { } // two tokens backward - return [isEvery, length, scopePlural, connectiveSpokenForms.backward]; + return [ + isEvery, + length, + scopePlural, + connectiveDefaultSpokenForms.backward, + ]; } private handleRelativeScopeExclusive( @@ -193,8 +200,8 @@ export class PrimitiveTargetSpokenFormGenerator { const scope = this.handleScopeType(modifier.scopeType); const direction = modifier.direction === "forward" - ? connectiveSpokenForms.next - : connectiveSpokenForms.previous; + ? connectiveDefaultSpokenForms.next + : connectiveDefaultSpokenForms.previous; const isEvery = modifier.isEvery ? this.spokenFormMap.simpleModifier.everyScope : []; @@ -320,7 +327,7 @@ export class PrimitiveTargetSpokenFormGenerator { throw new NoSpokenFormError(`Mark '${mark.type}'`); default: - return [marks[mark.type]]; + return [markDefaultSpokenForms[mark.type]]; } } @@ -331,7 +338,7 @@ export class PrimitiveTargetSpokenFormGenerator { case "modulo100": { // row/ five return [ - lineDirections.modulo100, + lineDirectionDefaultSpokenForms.modulo100, numberToSpokenForm(mark.lineNumber + 1), ]; } @@ -339,8 +346,8 @@ export class PrimitiveTargetSpokenFormGenerator { // up/down five return [ mark.lineNumber < 0 - ? lineDirections.relativeUp - : lineDirections.relativeDown, + ? lineDirectionDefaultSpokenForms.relativeUp + : lineDirectionDefaultSpokenForms.relativeDown, numberToSpokenForm(Math.abs(mark.lineNumber)), ]; } diff --git a/packages/lib-engine/src/spokenForms/defaultSpokenFormMapCore.ts b/packages/lib-engine/src/spokenForms/defaultSpokenFormMapCore.ts index a0a213b28c3..ed2045ece2a 100644 --- a/packages/lib-engine/src/spokenForms/defaultSpokenFormMapCore.ts +++ b/packages/lib-engine/src/spokenForms/defaultSpokenFormMapCore.ts @@ -1,23 +1,73 @@ import { actionNames, actionReferences, - modifierExtraReferenceIds, - modifierExtraReferences, + graphemeDefaultSpokenForms, modifierReferences, - simpleModifierReferenceIds, + pairedDelimiterReferences, simpleScopeTypeTypes, scopeReferences, + connectiveDefaultSpokenForms, +} from "@cursorless/lib-common"; +import type { + SpokenFormMapKeyTypes, + SpokenFormReference, } from "@cursorless/lib-common"; -import type { SpokenFormReference } from "@cursorless/lib-common"; import type { DefaultSpokenFormMapDefinition, DefaultSpokenFormMapEntry, } from "./defaultSpokenFormMap.types"; -import { graphemeDefaultSpokenForms } from "./graphemes"; -import { isPrivate } from "./spokenFormMapUtil"; type DefaultSpokenForm = string | DefaultSpokenFormMapEntry; +const simpleModifierReferenceIds = [ + "excludeInterior", + "toRawSelection", + "leading", + "trailing", + "keepContentFilter", + "keepEmptyFilter", + "inferPreviousMark", + "startOf", + "endOf", + "interiorOnly", + "visible", + "extendThroughStartOf", + "extendThroughEndOf", + "everyScope", +] as const satisfies readonly SpokenFormMapKeyTypes["simpleModifier"][]; + +const modifierExtraReferenceIds = [ + "first", + "last", + "previous", + "next", + "forward", + "backward", + "ancestor", +] as const satisfies readonly SpokenFormMapKeyTypes["modifierExtra"][]; + +const modifierExtraReferences = { + first: { + defaultSpokenForm: connectiveDefaultSpokenForms.first, + }, + last: { + defaultSpokenForm: connectiveDefaultSpokenForms.last, + }, + previous: { + defaultSpokenForm: connectiveDefaultSpokenForms.previous, + }, + next: { + defaultSpokenForm: connectiveDefaultSpokenForms.next, + }, + forward: { + defaultSpokenForm: connectiveDefaultSpokenForms.forward, + }, + backward: { + defaultSpokenForm: connectiveDefaultSpokenForms.backward, + }, + ancestor: modifierReferences.ancestor, +} satisfies Record; + function getDefaultSpokenForm( reference: SpokenFormReference, ): DefaultSpokenForm { @@ -50,34 +100,26 @@ function getDefaultSpokenFormMap( ) as Record; } +function getCompleteDefaultSpokenFormMap< + References extends Readonly>, +>( + references: References, +): Readonly> { + return Object.fromEntries( + Object.entries(references).map(([key, reference]) => [ + key, + getDefaultSpokenForm(reference), + ]), + ) as Record; +} + /** * This map contains the default spoken forms for all our speakable entities. - * Actions, scopes, and modifiers are constructed from their reference - * definitions. Paired delimiters and graphemes remain defined here until they - * have corresponding reference definitions. + * Actions, scopes, modifiers, and paired delimiters are constructed from their + * reference definitions. Graphemes remain defined directly. */ export const defaultSpokenFormMapCore: DefaultSpokenFormMapDefinition = { - pairedDelimiter: { - curlyBrackets: "curly", - angleBrackets: "diamond", - escapedDoubleQuotes: "escaped quad", - escapedSingleQuotes: "escaped twin", - escapedParentheses: "escaped round", - escapedSquareBrackets: "escaped box", - doubleQuotes: "quad", - parentheses: "round", - backtickQuotes: "skis", - squareBrackets: "box", - singleQuotes: "twin", - tripleDoubleQuotes: isPrivate("triple quad"), - tripleSingleQuotes: isPrivate("triple twin"), - tripleBacktickQuotes: isPrivate("triple skis"), - any: "pair", - string: "string", - whitespace: "void", - - collectionBoundary: isPrivate("collection boundary"), - }, + pairedDelimiter: getCompleteDefaultSpokenFormMap(pairedDelimiterReferences), simpleScopeTypeType: getDefaultSpokenFormMap( simpleScopeTypeTypes, diff --git a/packages/tool-meta-updater/src/updateReferenceMdx.ts b/packages/tool-meta-updater/src/updateReferenceMdx.ts index f0ca6e1aad6..d8d08a992ba 100644 --- a/packages/tool-meta-updater/src/updateReferenceMdx.ts +++ b/packages/tool-meta-updater/src/updateReferenceMdx.ts @@ -71,17 +71,17 @@ export function updateReferenceMdx( expected.push(""); } - if (entry.examples.length > 0) { - expected.push(`## Examples`, ""); - for (const example of entry.examples) { - const command = injectSpokenForm( - example.command, - entry.defaultSpokenForm, - ); - expected.push(`- \`"${command}"\`: ${example.description}`); - } - expected.push(""); - } + // if (entry.examples.length > 0) { + // expected.push(`## Examples`, ""); + // for (const example of entry.examples) { + // const command = injectSpokenForm( + // example.command, + // entry.defaultSpokenForm, + // ); + // expected.push(`- \`"${command}"\`: ${example.description}`); + // } + // expected.push(""); + // } if (isScope) { expected.push(``, "");