|
| 1 | +import { ActionType } from ".."; |
| 2 | + |
| 3 | +const actions: Record<ActionType, string | null> = { |
| 4 | + scrollToBottom: "bottom", |
| 5 | + toggleLineBreakpoint: "break point", |
| 6 | + cutToClipboard: "carve", |
| 7 | + scrollToCenter: "center", |
| 8 | + clearAndSetSelection: "change", |
| 9 | + remove: "chuck", |
| 10 | + insertCopyBefore: "clone up", |
| 11 | + insertCopyAfter: "clone", |
| 12 | + toggleLineComment: "comment", |
| 13 | + copyToClipboard: "copy", |
| 14 | + scrollToTop: "crown", |
| 15 | + outdentLine: "dedent", |
| 16 | + revealDefinition: "define", |
| 17 | + editNewLineBefore: "drink", |
| 18 | + insertEmptyLineBefore: "drop", |
| 19 | + extractVariable: "extract", |
| 20 | + insertEmptyLineAfter: "float", |
| 21 | + foldRegion: "fold", |
| 22 | + followLink: "follow", |
| 23 | + deselect: "give", |
| 24 | + highlight: "highlight", |
| 25 | + showHover: "hover", |
| 26 | + indentLine: "indent", |
| 27 | + showDebugHover: "inspect", |
| 28 | + setSelectionAfter: "post", |
| 29 | + editNewLineAfter: "pour", |
| 30 | + setSelectionBefore: "pre", |
| 31 | + insertEmptyLinesAround: "puff", |
| 32 | + showQuickFix: "quick fix", |
| 33 | + showReferences: "reference", |
| 34 | + rename: "rename", |
| 35 | + reverseTargets: "reverse", |
| 36 | + findInWorkspace: "scout all", |
| 37 | + randomizeTargets: "shuffle", |
| 38 | + generateSnippet: "snippet make", |
| 39 | + sortTargets: "sort", |
| 40 | + setSelection: "take", |
| 41 | + revealTypeDefinition: "type deaf", |
| 42 | + unfoldRegion: "unfold", |
| 43 | + callAsFunction: "call", |
| 44 | + swapTargets: "swap", |
| 45 | + replaceWithTarget: "bring", |
| 46 | + moveToTarget: "move", |
| 47 | + wrapWithPairedDelimiter: "wrap", |
| 48 | + wrapWithSnippet: "wrap", |
| 49 | + rewrapWithPairedDelimiter: "repack", |
| 50 | + insertSnippet: "snippet", |
| 51 | + pasteFromClipboard: "paste", |
| 52 | + |
| 53 | + ["experimental.setInstanceReference"]: "from", |
| 54 | + |
| 55 | + editNew: null, |
| 56 | + executeCommand: null, |
| 57 | + getText: null, |
| 58 | + replace: null, |
| 59 | + |
| 60 | + // applyFormatter: "format", |
| 61 | + // findInDocument: "scout", |
| 62 | + // nextHomophone: "phones", |
| 63 | +}; |
| 64 | + |
| 65 | +export function actionToSpokenForm(name: ActionType): string { |
| 66 | + if (name === "wrapWithSnippet") { |
| 67 | + name = "wrapWithPairedDelimiter"; |
| 68 | + } |
| 69 | + const result = actions[name]; |
| 70 | + if (result == null) { |
| 71 | + throw Error(`Unknown action '${name}'`); |
| 72 | + } |
| 73 | + return result; |
| 74 | +} |
0 commit comments