Commit Graph

104 Commits

Author SHA1 Message Date
Pokey Rule
9f79e1cb2c
Support "every line air past bat" (#1462)
We also support fancier constructs like the following:

- "every line block air past bat"
- "every line air past block bat"
- "every line past bat"
- "every line past block bat"

The approach is to detect ranges of the form `"every <scope> <target>
past <target>"` and to turn them into a special range target, distinct
from `"continuous"` or `"slice"`. We remove the `"every <scope>"`
modifier as well because that's done after we construct the range.

The reason we need a special range target is that exclusion needs to be
smart to handle scopes whose domain is larger than their content range

We also add slight special casing for line targets so that when you're
at the beginning / end of a line, that line is considered part of the
range

## Checklist

- [x] Only expand to containing scope if the given end is excluded, eg
expand end target if "until". Might need to tweak construction of ranges
so that each side is responsible for exclusion to make "every token
until line bat" work, because otherwise it gets downgraded so we won't
actually skip the right thing. eg try "every token air past state bat"
if "bat" is in the middle of the statement.
- [x] Add tests for above examples
- [x] Handle case where one side is not in a scope
- [x] Handle case where one side is in a scope but you don't want it to
jump to parent (eg "take every state past bat" when we're inside a
function but between statements)
- [x] Add test for "every line air until bat"
- [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
2023-05-15 14:44:35 +00:00
Pokey Rule
3e92ee67df
Support adding languages using only queries (#1449)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet
2023-05-11 16:08:53 +00:00
Pokey Rule
5d6fbc280d
Fix spoken form in readme (#1429)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet
2023-04-16 15:15:25 +00:00
Pokey Rule
e37762f6ca
Merge cursorless-vscode-core into cursorless-vscode (#1421)
- Depends on #1393

## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet
2023-04-14 22:03:16 +00:00
Pokey Rule
570f16230e
Add recorded test formatter to pre-commit (#1423)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2023-04-14 12:15:11 +00:00
Pokey Rule
22fc39a1b4
Add documentation for "phones" (#1411)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-11 10:29:53 +00:00
Martin Rykfors
d5aa63d45c
Improve relative / ordinal diagram in the docs (#1277)
## Checklist

- [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] I have tested building the docs

Replace the hand-written diagram of relative / ordinal modifiers with
one generated by LaTeX / tikz.

If it is necessary in the future to change this image, you can reuse and
modify the below latex code to regenerate it.

```
\documentclass[tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calligraphy}

% to convert pdf -> png:
% convert -density 300 relative-ordinal.pdf -quality 100 -background white -alpha remove relative_ordinal.png

\begin{document}
\def\spacing{1.4cm}
\newcommand{\ibrace}[4]{
    \draw [decorate, decoration = {brace, amplitude=5pt}] (#2*\spacing, #1*0.8cm + 0.5cm) --  (#3*\spacing, #1*0.8cm + 0.5cm)
    node[above=5pt, pos=0.5, scale=0.8] {\texttt{"#4"}};
}
\newcommand{\bbrace}[4]{
    \draw [decorate, decoration = {brace, amplitude=5pt}] (#2*\spacing, #1*0.8cm + 0.5cm) --  (#3*\spacing, #1*0.8cm + 0.5cm)
    node[above=-20pt, pos=0.5, scale=0.8] {#4};
}
\newcommand{\funk}[3]{
    \draw[fill=black] (#1*\spacing,0) circle (0.1cm) node[below=#2, text width=1cm,align=left,scale=0.7] (F#1)
    {\texttt{"#3"}};
}
\begin{tikzpicture}[ultra thick]

\funk{0}{0pt}{first funk}
\funk{1}{0pt}{second funk}
\funk{2}{0pt}{third previous funk}
\funk{3}{0pt}{second previous funk}
\funk{4}{0pt}{previous funk}
\funk{5}{0pt}{funk}
\funk{6}{0pt}{next funk}
\funk{7}{0pt}{second next funk}
\funk{8}{0pt}{third next funk}
\funk{9}{0pt}{second last funk}
\funk{10}{0pt}{last funk}

\draw[latex-] (F5) -- +(0,-0.8cm) node[below=2pt,scale=0.8] {input target};

\ibrace{0}{6}{8}{next three funks};
\ibrace{0}{2}{4}{previous three funks};
\ibrace{1}{5}{7}{three funks};
\ibrace{2}{3}{5}{three funks backward};
\ibrace{0}{0}{1}{first two funks};
\ibrace{0}{9}{10}{last two funks};
\bbrace{-3}{10}{0}{iteration scope};
\end{tikzpicture}

\end{document}
```

---------

Co-authored-by: Martin Rykfors <martin.rykfors@evolabel.com>
2023-04-02 21:13:39 +00:00
Pokey Rule
94bab18f73
Support inline snippets; add Talon snippet api (#1329)
- Fixes #1324
- Fixes #1325 

Note that I created a Talon-side insertion api that supports the full
set of options, including substitutions, targets, and scopes, but
decided to leave it out for now because I'm not sure exactly how it
should look and we don't need it for the mathfly support we're planning
to use it for. In particular, we should probably figure out #803 before
we implement the more complex api because snippets really want a
destination, not a target. I did use the complex Talon-side api to
record some tests of the extension api, though

Here is the complex Talon snippet insertion api in case useful at some
point

<details><summary>Complex talon api</summary>

```diff
From e39e03e3a06a6db4f1edb245a5225037d0ea08d3 Mon Sep 17 00:00:00 2001
From: Pokey Rule <755842+pokey@users.noreply.github.com>
Date: Fri, 24 Mar 2023 14:22:40 +0000
Subject: [PATCH] Complex insert snippet Talon api

---
 cursorless-talon/src/snippets.py | 35 ++++++++++++++++++++++++--------
 1 file changed, 27 insertions(+), 8 deletions(-)

diff --git a/cursorless-talon/src/snippets.py b/cursorless-talon/src/snippets.py
index a9f100f58..409512011 100644
--- a/cursorless-talon/src/snippets.py
+++ b/cursorless-talon/src/snippets.py
@@ -91,15 +91,34 @@ class Actions:
             },
         )
 
-    def cursorless_insert_snippet(body: str):
+    def cursorless_insert_snippet(
+        body: str,
+        target: Optional[dict] = None,
+        scope: Optional[str] = None,
+        snippet_variable: Optional[str] = None,
+        text: Optional[str] = None,
+    ):
         """Inserts a custom snippet"""
-        actions.user.cursorless_implicit_target_command(
-            "insertSnippet",
-            {
-                "type": "custom",
-                "body": body,
-            },
-        )
+        snippet_arg: dict[str, Any] = {
+            "type": "custom",
+            "body": body,
+        }
+        if scope:
+            snippet_arg["scopeType"] = {"type": scope}
+        if snippet_variable:
+            snippet_arg["substitutions"] = {snippet_variable: text}
+
+        if target:
+            actions.user.cursorless_single_target_command_with_arg_list(
+                "insertSnippet",
+                target,
+                [snippet_arg],
+            )
+        else:
+            actions.user.cursorless_implicit_target_command(
+                "insertSnippet",
+                snippet_arg,
+            )
 
     def cursorless_wrap_with_snippet_by_name(
         name: str, variable_name: str, target: dict
-- 
2.39.2

```

</details>

## 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
2023-03-27 09:44:19 +00:00
Andreas Arvidsson
763bd04d34
Added missing install to pnpm (#1355)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet
2023-03-23 12:34:47 +00:00
Pokey Rule
aae89f69fa
Fix broken docs links (#1353)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet
2023-03-23 12:30:11 +00:00
Pokey Rule
10155b6dcc
Update adding-a-new-package.md (#1346)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet
2023-03-22 11:53:59 +00:00
Pokey Rule
f90f49677d
Migrate to a pnpm monorepo (#1281)
- closes https://github.com/cursorless-dev/cursorless/issues/945
- closes https://github.com/cursorless-dev/cursorless/issues/1044
- depends on https://github.com/cursorless-dev/cursorless/pull/1322
- depends on https://github.com/cursorless-dev/cursorless/pull/1327

## Checklist

- [x] Split into smaller PRs for ease of review
- [x] Try DX tests again
https://github.com/cursorless-dev/cursorless/discussions/1289
- [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] File issue for speeding up cheatsheet / making it not optional
locally https://github.com/cursorless-dev/cursorless/issues/1307
- [x] Set package manager in package.json
https://nodejs.org/api/packages.html#packagemanager
- [x] Re-add lint rule to prevent api types from importing anything
- [x] Try local install
  - [x] Make sure cheatsheet works
- [x] Make sure local extension build depends on building cheatsheet, or
allows no cheatsheet
- [x] Figure out why we're getting so many extra `internal` modules
- [x] Update https://github.com/cursorless-dev/cursorless/issues/931 to
indicate we're now patching instead of swizzling
- [x] Make sure lint rules are actually running in CI
- [x] Check that we've addressed everything in
https://github.com/cursorless-dev/cursorless/issues/945
- [x] Incorporate changes from
https://github.com/cursorless-dev/cursorless/pull/1166
- [x] ~~Make sure this PR doesn't break doc links; see
https://github.com/cursorless-dev/cursorless/pull/942#discussion_r968556276~~
There's no way to avoid these links getting broken if we upgrade
typedoc; filed https://github.com/cursorless-dev/cursorless/issues/1304
to track
- [x] Revert https://github.com/cursorless-dev/cursorless/pull/1284
- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] I have not broken the cheatsheet
- [x] Generate cursorless-vscode package.json automatically, and change
the name we use to `@cursorless/cursorless-vscode` in the `package.json`
checked into source control
- [x] Be sure to update meta-updater to check for that instead of name
`cursorless` (see fixme in its `index.ts`)

## Desiderata

- From https://github.com/cursorless-dev/cursorless/discussions/1289

### Correctly flagging errors

- [x] `D1`: It is a compile error to import external packages that are
not listed in `package.json`
   - [x] `D1.1`: `vscode` (for some reason this one behaves strangely)
   - [x] `D1.2`: Other packages
- [x] `D2`: It is **not** a compile error to import from local packages
that you depend on, using our preferred syntax (eg `@cursorless/foo`)
- [x] `D3`: It is a compile error to import from local packages that you
depend on, **not** using our preferred syntax (eg `../foo`)
- [x] `D4`: It is a compile error to import from local packages that you
do **not** depend on, either
- [x] `D4.1`: using our non-preferred syntax (eg `../packages/foo`), or
  - [x] `D4.2`: using preferred syntax (eg `@cursorless/foo`)
- [ ] `D5`: It is a compile error to import from anything other than
`index.ts` in another module
  - [x] `D5.1`: **no** `@cursorless/foo/bar`
  - [x] `D5.2`: **no** `../foo/bar`
  - [x] `a`: Even if you depend on the module
- [ ] `b`: Even if `bar` was re-exported in `foo/index.ts`. In that case
it should be required to import `@cursorless/foo`. Untested, but
probably works, and I ran out of steam 😅
- [x] `D6`: It is **not** a compile error to import external packages
listed in `package.json`
   - [x] `D6.1`: `vscode` (for some reason this one behaves strangely)
   - [x] `D6.2`: Other packages

### Auto-import
- [x] `D7`: Auto-import doesn't import from external packages not listed
in `package.json`
   - [x] `D7.1`: `vscode` (for some reason this one behaves strangely)
   - [x] `D7.2`: Other packages
- [x] `D8`: Auto-import imports from external packages listed in
`package.json`
   - [x] `D8.1`: `vscode` (for some reason this one behaves strangely)
   - [x] `D8.2`: Other packages
- [x] `D9`: Auto-import imports from local packages that you depend on,
using our preferred syntax (eg `@cursorless/foo`)
- [x] `D10`: Auto-import doesn't import from local packages that you
don't depend on
- [x] `D11`: Auto-import doesn't import from anything other than
`index.ts` in another package (eg **no** `@cursorless/foo/bar`)
   - [x] `D11.1`: When you depend on the package
   - [x] `D11.2`: When you don't depend on the package

### Other DX
- [x] `D12`: Find references across projects when no file from the
referencing project is open
- [x] `D13`: Rename across projects when no file from the referencing
project is open
- [x] `D14`: Jump to definition across projects
- [ ] `D15`: It is easy to move a file from one package to another
- [ ] `D16`: It is easy to create a new package
- [ ] `D17`: Breakpoints work in Cursorless extension
- [x] `D18`: Breakpoints work on Cursorless root website
- [ ] `D19`: Breakpoints work on Cursorless docs website
2023-03-21 13:28:05 +00:00
Aditya Kode
2defceb46a
Added "clone" action to docs (#1292) 2023-03-08 23:53:18 -07:00
Pokey Rule
628c471845
Workaround for VSCode profile creation bug (#1296) 2023-03-07 06:15:40 -07:00
Pokey Rule
1fcb776a44
Make surrounding pair docs clearer (#1287)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
2023-03-03 14:41:01 +00:00
Pokey Rule
1b18e38efe
Restructure directories in preparation for move to pnpm workspace (#1275)
This PR does a massive restructure of our directories in preparation for
splitting up into separate packages for #945. Here is the new layout:

<img width="286" alt="image"
src="https://user-images.githubusercontent.com/755842/220430713-56d211fe-043a-46ae-b802-449cd0693cd5.png">


## 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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-23 15:09:07 +01:00
Pokey Rule
9ee77715fe
Reintroduce stable hats (#1252) 2023-02-10 09:55:46 -07:00
Pokey Rule
bca3c8a008
Fixes for vscode 1.75.0 (#1249)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
2023-02-10 08:18:22 +01:00
Pokey Rule
bac6592da7
Revert "Stable hats (#1225)" (#1251)
This reverts commit 9406cd30a7.

## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-04 16:55:59 +00:00
Pokey Rule
9406cd30a7
Stable hats (#1225)
- Fixes #432 

## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] Add test for case where enabled hat styles change, both adding or
removing an enabled hat style
- [ ] 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)
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-04 17:21:37 +01:00
Pokey Rule
9197dddb3c
fix broken link syntax in readme (#1237)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet
2023-01-19 15:35:42 +01:00
Pokey Rule
7bc4b9d1ea
Add indent / dedent to docs (#1230)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet
2023-01-16 17:01:10 +01:00
Pokey Rule
eee6eea194
Support "bring" in custom api (#1226)
Enables things like:

```talon
foo bar <user.cursorless_target>:
    some.stuff()
    user.cursorless_command("replaceWithTarget", cursorless_target)
    other.stuff()
```

## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet

Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
2023-01-13 11:47:27 +01:00
Pokey Rule
6f86978a0b
Fix extension debugging launch sandbox (#1205)
- Fixes #1202
- Follows the approach [suggested in the VSCode
docs](https://code.visualstudio.com/updates/v1_72#_extension-debugging-in-a-clean-environment)

## Migration path for existing developers

1. Ensure your version of VSCode is at least 1.72.0 to support the
[experimental settings profile
feature](https://code.visualstudio.com/updates/v1_72#_settings-profiles)
2. Perform steps 3 and 4 of the [contributing setup
guide](https://deploy-preview-1205--cursorless.netlify.app/docs/contributing/#steps)
to initialize the new sandbox
3. If you would like to install all extensions into the new sandbox that
you had in your old sandbox, run (on Linux / Mac):

   ```bash
code --extensions-dir .vscode-sandbox/extensions --list-extensions |
xargs -n1 code --profile=cursorlessDevelopment --install-extension
   ```

from within the `cursorless` directory. Alternately, you can install
extensions individually; see the note in step 4 of the [contributing
setup
guide](https://deploy-preview-1205--cursorless.netlify.app/docs/contributing/#steps)
4. Delete the old sandbox by running `rm -rf .vscode-sandbox` within the
`cursorless` directory

## Checklist

- [ ] 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)
- [ ] I have not broken the cheatsheet
2023-01-04 13:53:59 +01:00
Pokey Rule
f8a03dd735
Add "branch" scope type (#1149) 2023-01-03 15:21:58 +00:00
Andreas Arvidsson
1a0616521b
Allow using "this" to refer to current token with empty selection (#1094)
- Fixes #1043
- Fixes #1141 
- Depends on https://github.com/cursorless-dev/cursorless/pull/1187

## 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)

Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-12-22 21:04:45 +01:00
David Vo
62d4238574
[keyboard] Add some missing scopes (#1189) 2022-12-17 15:11:53 +00:00
Pokey Rule
f032b4cf9f
Improve customization docs (#1171)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
2022-12-14 11:36:22 +01:00
Pokey Rule
7936b3f393
Tweak keyboard docs (#1170)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet
2022-12-14 11:21:03 +01:00
Simeon Cheeseman
c9e06d765c
Fix test fixture upgrade scripts (#942)
Fixed the v1 to v2 script to preserve order and not drop any values.

- [ ] ~~Use normalisation code for updating fixtures in
a4cee9611f/src/test/suite/recorded.test.ts (L130-L138~~)
(filed https://github.com/cursorless-dev/cursorless/issues/1168 to
follow up on this one)

Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-12-12 11:11:46 +00:00
Pokey Rule
661a260627
Add more info to snippets customization docs (#1169)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet
2022-12-11 19:10:46 +01:00
Pokey Rule
541832fa24
Initial basic keyboard actions (#958)
See
https://deploy-preview-958--cursorless.netlify.app/docs/user/experimental/keyboard/modal/

## Checklist

- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] Figure out why it fails if cursorless test case recorder is active
- [x] Figure out why it won't let go of `type` once it hits an error, eg
test case recorder error
2022-12-08 12:35:44 +01:00
Pokey Rule
57888f198c
Add instructions to restart Talon when updating cursorless-talon (#1164)
## Checklist

- [ ] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [ ] 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)
- [ ] I have not broken the cheatsheet
2022-12-07 11:59:08 +01:00
ym-han
a253d5e351
fix link in docs to supported langs in code (#1159)
Fixes link in README.md to `constants.ts`
2022-12-06 19:20:56 +00:00
Pokey Rule
255e889547
Create guidelines.md (#1139) 2022-11-15 19:50:13 +01:00
Andreas Arvidsson
ba9644becb
Add word separator setting (#1078)
* Added word separator setting. Removed language specific regex components.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated tests

* Word separator is now a list

* Update documentation

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Mock word separators for tests

* Minor tweaks

* Update src/core/tokenizerConfiguration.ts

Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Revert "Minor tweaks"

This reverts commit b7f3695975.

* cleanup

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Use join to create key

* Update src/core/tokenizer.ts

Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>

* Update docs

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
2022-10-24 20:17:42 +01:00
Andreas Arvidsson
a4cee9611f
Generic scope handler interfaces (#1031)
* Original scope handlers

* More stuff

* Use proper token stage in sub token stage

* Work around for identifier matcher

* Use new scope handler in relative scope stage

* Use new scope handlers in ordinal scope stage

* Update usage of containing indices

* Rename

* Refactored create target

* Clean up

* clean up

* Add some tests that should pass

* Add a bunch more tests

* Attempt at different approach to scope handlers

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Initial implementation of new idea

* More work on this stuff

* Rename and add some todos

* More stuff

* Tweaks

* Renames and docstrings

* Restructuring

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* More jsdocs

* Tweaks

* Test fixes

* Fix error messages

* Revert `OrdinalScopeStage`

* Tweak

* jsdocs; fix import

* Don't export legacy types

* Fix import

* Preparation for surrounding pairs

* Naming cleanup

* Unify `getLegacyScopeStage` functions

* Lots of cleanup

* Fix regex `lastIndex` issue

* More cleanup

* More cleanup

* More cleanup

* Add `ancestorIndex` in prepartion for #124

* Add more jsdocs

* More docs

* More docs

* docstrings

* Improve hierarchical error type

* Docs

* More minor dog tweaks

* More docs

* More docs

* Doc strings and a couple tests

* Remove `isPreferredOver`

* Support `ancestorIndex` on api surface

* Improved jsdocs

* Split and cleanup relative stages

* Make scope handler constructor args optional

* More legacy type fixes

* Add `"identifier"` scope

* Working new code

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Docs + cheatsheet

* Update docs

* Add jsdoc

* jsdoc

* JSDocs

* doc tweaks

* reflow

* Tweaks

Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-23 11:56:31 +02:00
Will Sommers
57caa79493
Add unit sub-selection for values in SCSS/CSS (#722)
* Add unit scope to SCSS/CSS

* Add unit to docs

* Add unit to new targetDescriptor type

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix upgrade types

* Improve unit support

* Minor import cleanup

* Remove `that` marks to fix tests

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
2022-10-14 13:50:05 +01:00
Andreas Arvidsson
9195bf2ff0
Added "its" modifier to use with inference (#1024)
* Added its modifier to use with inference

* Fix test failures

* Remove unnecessary spy

Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
2022-10-14 12:32:20 +01:00
Pokey Rule
2b21593d98
Add cursorless-talon-dev (#1017)
* Add cursorless-talon-dev

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Tweaks

* More tweaks

* Woops

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
2022-10-11 00:07:44 +02:00
Andreas Arvidsson
eef8bfc631
Support complex relative grammar (#987)
* Added support for plural lists

* Updated relative scope modifier grammar

* Added ordinals to relative modifier

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added plural list for regex scopes

* Update cursorless-talon/src/modifiers/relative_scope.py

Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>

* Update cursorless-talon/src/modifiers/relative_scope.py

Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>

* Added link to inflection license

* Use plural scope type in ordinal scope

* Added support for <ordinal> last scope grammar

* Clean up

* Added words to csv

* Updated modifier grammar

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated legend

* Added docs

* Update defaults.json

* Start tweaking modifier cheatsheet

* More cheatsheet updates

* More tweaks

* Cleanup cheatsheet representation

* Some talon cleanup

* Change formatting for cheatsheet captures

* Fix captures in cheatsheet

* More capture cleanup

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Revert ts config

* Revert old cheatsheet changes

* Fixes

* Tweak docs

* More doc tweaks

* Add diagram

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
2022-10-07 20:58:00 +02:00
John Efford
eaf63cea54
VsCode fallback (#925) 2022-09-26 18:30:38 +01:00
Pokey Rule
9195c6aaa7
Support default recorder config per directory (#970)
* Support directory-specific config

* Improve documentation

Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
2022-09-21 14:42:32 +02:00
Pokey Rule
c86d41a7fc
Add landing page (#857)
* nx g @nrwl/next:app cursorless-org

* Attempt to get things working

* Remove cypress for now

* Add --prod flag

* Try again

* Another fix

* Remove website-root/index.html

* Use static export

* Another attempt

* whoops

* another

* Some style tweaks

* Add inconsolata

* Working iPhone 13

* Desktop version

* Fix dark

* Cleanup cheatsheet defaults updater support

* Basic working mobile

* More tweaks

* Working desktop

* Center hats

* Initial working embedded video

* Add related videos opt

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add cursorless.org client-side launch config

* Switch to react-player; better error handling

* Working mobile layout

* Move hats component

* Add player controls

* Use video placeholder

* Revert "Use video placeholder"

This reverts commit 40f45286ed.

* Bunch of tweaks from jam sesh

* More jam sesh tweaks

* Working mobile; some desktop tweaks

* Working draft of desktop

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Tweak media breakpoints

* Fix isExternal

* Fix button background for light mode

* Docusaurus respect system color scheme

* Some design tweaks

* Font tweaking

* More messing around

* Working mobile

* Work toward proportional layout

* Workign resize code

* Start of screen stuff

* Get layout working at more sizes

* Fix background color on mobile

* Attempt to fix iPhone landscape

* Remove video placeholder

* Add doc comment

* Start adding meta tags

* More styling tweaks

* Add button hover

* Fix favicon

* Attempt to fix social tags

* Hack to use deploy preview URL

* Revert "Hack to use deploy preview URL"

This reverts commit d0251e74d9.

* Fix social embed

* Hack deploy preview URL again

* Revert "Hack deploy preview URL again"

This reverts commit 6acb1326ae.

* Tweak share

* Hack url

* Revert "Hack url"

This reverts commit 77c109d521.

* Cleanup from looking through PR

* More cleanup

* whoops

* bump package-lock

* Fix order of fonts

* Add regular font weight

* Revert cheatsheet

* Kick CI

* Update cursorless-nx/apps/cursorless-org/pages/_app.tsx

Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>

* Tweaks

* Tweaks

* website/ => docs-site/

* Lots of tweaks

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Attempt to fix docs build

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
2022-09-15 16:31:10 +01:00
James Stout
4b38d4cefa
Added warning about using WSL on Windows. (#921)
* Added warning about using WSL on Windows.

* Update docs/contributing/CONTRIBUTING.md

Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>

* Update docs/contributing/CONTRIBUTING.md

* Update docs/contributing/CONTRIBUTING.md

Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
2022-09-12 19:17:23 +01:00
Will Sommers
898f51f2e8
Update cursorless reference, help terms and docs (#599) 2022-09-07 16:08:37 +01:00
Pokey Rule
3c41868de3
Tweak docs search ranking (#915)
* Swizzle SearchBar

* Ignore swizzled file

* Tweak search rankings in docs site

* Capture original Algolia settings

* Documentation

* Modifications to Algolia crawler and index settings

* Tweak wording

* More tweaks

* run `yarn`

Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
2022-09-07 15:15:13 +01:00
Will Sommers
2d93ee35b1
Various additions to documentation (#703)
* Add various additions to documentation

* Add head/tail to scopes list

* Update Readme according to feedback

* Apply suggestions from code review

* Tweaks

* Tweaks

* Revert fix to old cheatsheet

Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
2022-08-17 15:38:35 +01:00
Pokey Rule
af15ae2c05
Fix special chars without accents (#907)
* Add some tests for special chars

* Tweak naming

* Remove `preserveAccents` setting

* `accentsToPreserve` => `lettersToPreserve`

* Fixes

* Update doc string

* Fix `æ`

* Improve tests

Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
2022-08-04 08:44:44 +02:00
Pokey Rule
1c968f62d0
Add grapheme Unicode normalization support for hats (#899)
* Allow case-sensitive targets (lowercase AND uppercase)
Fixes #896

* Support #276

* Fix typo

* Start implementing generic IDE

* Add tests

* Attempt to normalise unknown graphemes

* Try to fix

* Fix tokenizer; add tests

* Attempt at Swedish character preservation

* Fix Swedish

* More fixes

* Tweak

* Stronger typing

* Tweak config

* More cleanup

* Doc string

* Make unknown symbol spoken for configurable

* Tweak formatting

* Fix dependency loop in graph

* Add docs

* Imports fix

* Doc tweak

* Update src/core/TokenGraphemeSplitter.ts

Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>

* Tweaks from PR review

* Fix char modifier

* Cleanup

* Tweak naming

Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
2022-08-02 15:30:29 +01:00