-
-
Notifications
You must be signed in to change notification settings - Fork 93
Support inline snippets; add Talon snippet api #1329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...mmon/src/types/command/CommandV4.types.ts → ...mmon/src/types/command/CommandV5.types.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,23 @@ | ||
| import type { ActionCommand } from "./ActionCommand"; | ||
| import type { CommandV5 } from "./CommandV5.types"; | ||
| import type { CommandV0, CommandV1 } from "./legacy/CommandV0V1.types"; | ||
| import type { CommandV2 } from "./legacy/CommandV2.types"; | ||
| import type { CommandV3 } from "./legacy/CommandV3.types"; | ||
| import type { CommandV4 } from "./CommandV4.types"; | ||
| import type { CommandV4 } from "./legacy/CommandV4.types"; | ||
|
|
||
| export type CommandComplete = Required<Omit<CommandLatest, "spokenForm">> & | ||
| Pick<CommandLatest, "spokenForm"> & { action: Required<ActionCommand> }; | ||
|
|
||
| export const LATEST_VERSION = 4 as const; | ||
| export const LATEST_VERSION = 5 as const; | ||
|
|
||
| export type CommandLatest = Command & { | ||
| version: typeof LATEST_VERSION; | ||
| }; | ||
|
|
||
| export type Command = CommandV0 | CommandV1 | CommandV2 | CommandV3 | CommandV4; | ||
| export type Command = | ||
| | CommandV0 | ||
| | CommandV1 | ||
| | CommandV2 | ||
| | CommandV3 | ||
| | CommandV4 | ||
| | CommandV5; |
95 changes: 95 additions & 0 deletions
95
packages/common/src/types/command/legacy/CommandV4.types.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| import { PartialTargetDescriptorV4 } from "./PartialTargetDescriptorV4.types"; | ||
|
|
||
| type ActionType = | ||
| | "callAsFunction" | ||
| | "clearAndSetSelection" | ||
| | "copyToClipboard" | ||
| | "cutToClipboard" | ||
| | "deselect" | ||
| | "editNew" | ||
| | "editNewLineAfter" | ||
| | "editNewLineBefore" | ||
| | "executeCommand" | ||
| | "extractVariable" | ||
| | "findInWorkspace" | ||
| | "foldRegion" | ||
| | "followLink" | ||
| | "generateSnippet" | ||
| | "getText" | ||
| | "highlight" | ||
| | "indentLine" | ||
| | "insertCopyAfter" | ||
| | "insertCopyBefore" | ||
| | "insertEmptyLineAfter" | ||
| | "insertEmptyLineBefore" | ||
| | "insertEmptyLinesAround" | ||
| | "insertSnippet" | ||
| | "moveToTarget" | ||
| | "outdentLine" | ||
| | "pasteFromClipboard" | ||
| | "randomizeTargets" | ||
| | "remove" | ||
| | "rename" | ||
| | "replace" | ||
| | "replaceWithTarget" | ||
| | "revealDefinition" | ||
| | "revealTypeDefinition" | ||
| | "reverseTargets" | ||
| | "rewrapWithPairedDelimiter" | ||
| | "scrollToBottom" | ||
| | "scrollToCenter" | ||
| | "scrollToTop" | ||
| | "setSelection" | ||
| | "setSelectionAfter" | ||
| | "setSelectionBefore" | ||
| | "showDebugHover" | ||
| | "showHover" | ||
| | "showQuickFix" | ||
| | "showReferences" | ||
| | "sortTargets" | ||
| | "swapTargets" | ||
| | "toggleLineBreakpoint" | ||
| | "toggleLineComment" | ||
| | "unfoldRegion" | ||
| | "wrapWithPairedDelimiter" | ||
| | "wrapWithSnippet"; | ||
|
|
||
| export interface ActionCommandV4 { | ||
| /** | ||
| * The action to run | ||
| */ | ||
| name: ActionType; | ||
|
|
||
| /** | ||
| * A list of arguments expected by the given action. | ||
| */ | ||
| args?: unknown[]; | ||
| } | ||
|
|
||
| export interface CommandV4 { | ||
| /** | ||
| * The version number of the command API | ||
| */ | ||
| version: 4; | ||
|
|
||
| /** | ||
| * The spoken form of the command if issued from a voice command system | ||
| */ | ||
| spokenForm?: string; | ||
|
|
||
| /** | ||
| * If the command is issued from a voice command system, this boolean indicates | ||
| * whether we should use the pre phrase snapshot. Only set this to true if the | ||
| * voice command system issues a pre phrase signal at the start of every | ||
| * phrase. | ||
| */ | ||
| usePrePhraseSnapshot: boolean; | ||
|
|
||
| action: ActionCommandV4; | ||
|
|
||
| /** | ||
| * A list of targets expected by the action. Inference will be run on the | ||
| * targets | ||
| */ | ||
| targets: PartialTargetDescriptorV4[]; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.