Skip to content

Commit 64da045

Browse files
authored
Merge branch 'main' into migrateNotebookCell
2 parents f8a8ed9 + 09eb32b commit 64da045

File tree

126 files changed

+2627
-1262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+2627
-1262
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<img alt="Tests" src="https://img.shields.io/github/actions/workflow/status/cursorless-dev/cursorless-vscode/test.yml?branch=main&logo=github&label=tests" />
1111
</a>
1212
<a href="https://github.com/cursorless-dev/cursorless/graphs/contributors" target="_blank">
13-
<img alt="Maintenance" src="https://img.shields.io/maintenance/yes/2024.svg?logo=data:image/svg%2bxml;base64,PHN2ZyBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgZGF0YS1wcmVmaXg9ImZhcyIgZGF0YS1pY29uPSJ3cmVuY2giIGNsYXNzPSJzdmctaW5saW5lLS1mYSBmYS13cmVuY2ggZmEtdy0xNiIgcm9sZT0iaW1nIgogICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiI+CiAgICA8cGF0aCBmaWxsPSJ3aGl0ZSIgZD0iTTUwNy43MyAxMDkuMWMtMi4yNC05LjAzLTEzLjU0LTEyLjA5LTIwLjEyLTUuNTFsLTc0LjM2IDc0LjM2LTY3Ljg4LTExLjMxLTExLjMxLTY3Ljg4IDc0LjM2LTc0LjM2YzYuNjItNi42MiAzLjQzLTE3LjktNS42Ni0yMC4xNi00Ny4zOC0xMS43NC05OS41NS45MS0xMzYuNTggMzcuOTMtMzkuNjQgMzkuNjQtNTAuNTUgOTcuMS0zNC4wNSAxNDcuMkwxOC43NCA0MDIuNzZjLTI0Ljk5IDI0Ljk5LTI0Ljk5IDY1LjUxIDAgOTAuNSAyNC45OSAyNC45OSA2NS41MSAyNC45OSA5MC41IDBs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cuMDctMzcuMDcgNDkuNy04OS4zMiAzNy45MS0xMzYuNzN6TTY0IDQ3MmMtMTMuMjUgMC0yNC0xMC43NS0yNC0yNCAwLTEzLjI2IDEwLjc1LTI0IDI0LTI0czI0IDEwLjc0IDI0IDI0YzAgMTMuMjUtMTAuNzUgMjQtMjQgMjR6Ij48L3BhdGg+Cjwvc3ZnPg==" />
1414
</a>
1515
<a href="https://github.com/cursorless-dev/cursorless/blob/main/LICENSE" target="_blank">
1616
<img alt="License: MIT" src="https://img.shields.io/github/license/cursorless-dev/cursorless-vscode?color=success&logo=data:image/svg%2bxml;base64,PHN2ZyBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgZGF0YS1wcmVmaXg9ImZhcyIgZGF0YS1pY29uPSJiYWxhbmNlLXNjYWxlIiBjbGFzcz0ic3ZnLWlubGluZS0tZmEgZmEtYmFsYW5jZS1zY2FsZSBmYS13LTIwIiByb2xlPSJpbWciCiAgICB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NDAgNTEyIj4KICAgIDxwYXRoIGZpbGw9IndoaXRlIiBkPSJNMjU2IDMzNmgtLjAyYzAtMTYuMTggMS4zNC04LjczLTg1LjA1LTE4MS41MS0xNy42NS0zNS4yOS02OC4xOS0zNS4zNi04NS44NyAwQy0yLjA2IDMyOC43NS4wMiAzMjAuMzMuMDIgMzM2SDBjMCA0NC4xOCA1Ny4zMSA4MCAxMjggODBzMTI4LTM1LjgyIDEyOC04MHpNMTI4IDE3Nmw3MiAxNDRINTZsNzItMTQ0em01MTEuOTggMTYwYzAtMTYuMTggMS4zNC04LjczLTg1LjA1LTE4MS41MS0xNy42NS0zNS4yOS02OC4xOS0zNS4zNi04NS44NyAwLTg3LjEyIDE3NC4yNi04NS4wNCAxNjUuODQtODUuMDQgMTgxLjUxSDM4NGMwIDQ0LjE4IDU3LjMxIDgwIDEyOCA4MHMxMjgtMzUuODIgMTI4LTgwaC0uMDJ6TTQ0MCAzMjBsNzItMTQ0IDcyIDE0NEg0NDB6bTg4IDEyOEgzNTJWMTUzLjI1YzIzLjUxLTEwLjI5IDQxLjE2LTMxLjQ4IDQ2LjM5LTU3LjI1SDUyOGM4Ljg0IDAgMTYtNy4xNiAxNi0xNlY0OGMwLTguODQtNy4xNi0xNi0xNi0xNkgzODMuNjRDMzY5LjA0IDEyLjY4IDM0Ni4wOSAwIDMyMCAwcy00OS4wNCAxMi42OC02My42NCAzMkgxMTJjLTguODQgMC0xNiA3LjE2LTE2IDE2djMyYzAgOC44NCA3LjE2IDE2IDE2IDE2aDEyOS42MWM1LjIzIDI1Ljc2IDIyLjg3IDQ2Ljk2IDQ2LjM5IDU3LjI1VjQ0OEgxMTJjLTguODQgMC0xNiA3LjE2LTE2IDE2djMyYzAgOC44NCA3LjE2IDE2IDE2IDE2aDQxNmM4Ljg0IDAgMTYtNy4xNiAxNi0xNnYtMzJjMC04Ljg0LTcuMTYtMTYtMTYtMTZ6Ij48L3BhdGg+Cjwvc3ZnPg==" />
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
tags: [enhancement]
3+
pullRequest: 2683
4+
---
5+
6+
At long last, collection items have been migrated to our next generation scope framework! This means, within a list of items, you can now use relative navigation (`previous item`), absolute navigation via ordinals (`fifth item`), multiple selection (`two items`, optionally preceded with `previous` or `next`), and lastly, requesting multiple items to be individually selected via `every` (`every two items`)!

cursorless-everywhere-talon/cursorless_everywhere_talon.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33

44
from talon import Context, Module, actions
55

6-
from .cursorless_everywhere_types import EditorEdit, EditorState, SelectionOffsets
6+
from .cursorless_everywhere_types import (
7+
EditorEdit,
8+
EditorState,
9+
RangeOffsets,
10+
SelectionOffsets,
11+
)
712

813
mod = Module()
914

@@ -57,6 +62,14 @@ def cursorless_everywhere_edit_text(
5762
):
5863
"""Edit focused element text"""
5964

65+
def cursorless_everywhere_flash_ranges(
66+
ranges: list[RangeOffsets], # pyright: ignore [reportGeneralTypeIssues]
67+
):
68+
"""Flash ranges in focused element"""
69+
actions.skip()
70+
71+
# Private actions
72+
6073
def private_cursorless_talonjs_run_and_wait(
6174
command_id: str, # pyright: ignore [reportGeneralTypeIssues]
6275
arg1: Any = None,
@@ -71,5 +84,5 @@ def private_cursorless_talonjs_run_no_wait(
7184
):
7285
"""Executes a Cursorless command, but does not wait for it to finish, nor return the response"""
7386

74-
def private_cursorless_talonjs_get_response_json() -> str:
87+
def private_cursorless_talonjs_get_response_json() -> str: # pyright: ignore [reportReturnType]
7588
"""Returns the response from the last Cursorless command"""

cursorless-everywhere-talon/cursorless_everywhere_talon_browser.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from .cursorless_everywhere_types import (
44
EditorEdit,
55
EditorState,
6+
RangeOffsets,
67
SelectionOffsets,
78
)
89

@@ -61,6 +62,20 @@ def cursorless_everywhere_edit_text(
6162
if use_fallback(res):
6263
actions.next(edit)
6364

65+
def cursorless_everywhere_flash_ranges(
66+
ranges: list[RangeOffsets], # pyright: ignore [reportGeneralTypeIssues]
67+
):
68+
command = {
69+
"id": "flashRanges",
70+
"ranges": [
71+
js_object_to_python_dict(r, ["start", "end"])
72+
for r in js_array_to_python_list(ranges)
73+
],
74+
}
75+
res = rpc_get(command)
76+
if use_fallback(res):
77+
actions.next(ranges)
78+
6479

6580
def rpc_get(command: dict):
6681
return actions.user.run_rpc_command_get(RPC_COMMAND, command)

cursorless-everywhere-talon/cursorless_everywhere_types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ class SelectionOffsets(TypedDict):
66
active: int
77

88

9+
class RangeOffsets(TypedDict):
10+
start: int
11+
end: int
12+
13+
914
class EditorState(TypedDict):
1015
text: str
1116
selections: list[SelectionOffsets]

cursorless-talon/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ Cursorless is a spoken language for structural code editing, enabling developers
2121

2222
This repository holds the Talon side of Cursorless. If you've arrived here as part of the [Cursorless installation process](https://www.cursorless.org/docs/user/installation/), then you're in the right place!
2323

24+
# Installation
25+
26+
See [Cursorless Installation](https://www.cursorless.org/docs/user/installation/#installing-the-talon-side) ("Installing the Talon side") for how to clone this repo into your Talon user folder.
27+
2428
# Contributing
2529

2630
If you're looking to improve Cursorless, note that Cursorless is now maintained as a monorepo, so if you're here in a browser, and your address bar points to https://github.com/cursorless-dev/cursorless-talon, then you're probably in the wrong place. The monorepo is hosted at [`cursorless`](https://github.com/cursorless-dev/cursorless), and the source of truth for these talon files is in the [`cursorless-talon`](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon) subdirectory.

cursorless-talon/src/apps/vscode_settings.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import os
2-
import traceback
32
from pathlib import Path
43
from typing import Any
54

@@ -61,7 +60,6 @@ def vscode_get_setting_with_fallback(
6160
return actions.user.vscode_get_setting(key, default_value), False
6261
except Exception:
6362
print(fallback_message)
64-
traceback.print_exc()
6563
return fallback_value, True
6664

6765

cursorless-talon/src/marks/decorated_mark.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ def setup_hat_styles_csv(hat_colors: dict[str, str], hat_shapes: dict[str, str])
153153
def init_hats(hat_colors: dict[str, str], hat_shapes: dict[str, str]):
154154
setup_hat_styles_csv(hat_colors, hat_shapes)
155155

156-
vscode_settings_path: Path = actions.user.vscode_settings_path().resolve()
156+
vscode_settings_path: Path | None = None
157+
158+
try:
159+
vscode_settings_path = actions.user.vscode_settings_path().resolve()
160+
except Exception as ex:
161+
print(ex)
157162

158163
def on_watch(path, flags):
159164
global fast_reload_job, slow_reload_job
@@ -166,10 +171,12 @@ def on_watch(path, flags):
166171
"10s", lambda: setup_hat_styles_csv(hat_colors, hat_shapes)
167172
)
168173

169-
fs.watch(str(vscode_settings_path), on_watch)
174+
if vscode_settings_path is not None:
175+
fs.watch(vscode_settings_path, on_watch)
170176

171177
def unsubscribe():
172-
fs.unwatch(str(vscode_settings_path), on_watch)
178+
if vscode_settings_path is not None:
179+
fs.unwatch(vscode_settings_path, on_watch)
173180
if unsubscribe_hat_styles is not None:
174181
unsubscribe_hat_styles()
175182

data/fixtures/recorded/itemTextual/chuckItem4.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

data/fixtures/recorded/itemTextual/clearEveryItemToken.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)