-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added insertions scope for insert snippet action (#1879)
`snip funk after air` ## Checklist - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [x] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [x] I have not broken the cheatsheet - [x] Add changelog file --------- Co-authored-by: Pokey Rule <[email protected]> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4538aba
commit 6b45a52
Showing
9 changed files
with
107 additions
and
21 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
changelog/2023-09-addedDestinationAndScopeTypeToInsertSnippetAction.md
This file contains 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,6 @@ | ||
--- | ||
tags: [enhancement, talon] | ||
pullRequest: 1879 | ||
--- | ||
|
||
- Added `destination: CursorlessDestination` and `scope_type: Optional[Union[str, list[str]]]` arguments to the public Talon api action `user.cursorless_insert_snippet`. See the [talon-side api docs](https://www.cursorless.org/docs/user/customization/#public-talon-actions) for more. |
This file contains 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 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 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 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 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 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 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
47 changes: 47 additions & 0 deletions
47
.../cursorless-vscode-e2e/src/suite/fixtures/recorded/actions/snippets/snipPrintAfterPit.yml
This file contains 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,47 @@ | ||
languageId: python | ||
command: | ||
version: 6 | ||
spokenForm: snip print after pit | ||
action: | ||
name: insertSnippet | ||
snippetDescription: | ||
type: custom | ||
body: print($0) | ||
scopeTypes: | ||
- {type: namedFunction} | ||
- {type: statement} | ||
destination: | ||
type: primitive | ||
insertionMode: after | ||
target: | ||
type: primitive | ||
mark: {type: decoratedSymbol, symbolColor: default, character: p} | ||
usePrePhraseSnapshot: true | ||
spokenFormError: Custom insertion snippet | ||
initialState: | ||
documentContents: | | ||
def my_funk(): | ||
print("allow") | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: | ||
default.p: | ||
start: {line: 1, character: 4} | ||
end: {line: 1, character: 9} | ||
finalState: | ||
documentContents: | | ||
def my_funk(): | ||
print("allow") | ||
print() | ||
selections: | ||
- anchor: {line: 3, character: 6} | ||
active: {line: 3, character: 6} | ||
thatMark: | ||
- type: UntypedTarget | ||
contentRange: | ||
start: {line: 3, character: 0} | ||
end: {line: 3, character: 7} | ||
isReversed: false | ||
hasExplicitRange: true |