Don't let the cursor slow you down
Go to file
Aaron Adams aa768597e6
Initial lua support (#1962)
## What

Adds support for the `lua` programming language

## Checklist

- [x] Recorded tests for the new language
- [x] Used `"change"` / `"clear"` instead of` "take"` for selection
tests to make recorded tests easier to read
- [x] Added a few specific tests that use `"chuck"` instead of
`"change"` to test removal behaviour when it's interesting, especially:
  - [x] `"chuck arg"` with single argument in list
  - [x] `"chuck arg"` with multiple arguments in list
  - [x] `"chuck item"` with single argument in list
  - [x] `"chuck item"` with multiple arguments in list
- [x] Added `@textFragment` captures. Usually you want to put these on
comment and string nodes. This enables `"take round"` to work within
comments and strings.
- [x] Added a test for `"change round"` inside a string, eg `"hello
(there)"`
- [-] Supported` "type"` both for type annotations (eg `foo: string`)
and declarations (eg `interface Foo {}`) (and added tests for this
behaviour 😊)
- [x] Supported` "item"` both for map pairs and list entries (with tests
of course)

## Scope Support

| Supported | Tested | Term | Capture | Definition | Comment |
| - | - | - | - | - | - |
| ✓ | ✓ | `list` | `@list` | List type equivalent | - |
| ✓ | ✓ | `inside list` | `@list.interior` | Inside of a
list | - |
| ✓ | ✓ | `map` | `@map` | Dictionary type equivalent | - |
| ✓ | ✓ | `inside map` | `@map.interior` | Inside of a
dictionary | - |
| ✓ | ✓ | `key` | `@collectionKey` | Dictionary key
equivalent | - |
| ✓ | ✓ | `funk` | `@namedFunction` | A named function
declaration | - |
| ✓ | ✓ | `inside funk` | `@namedFunction.interior` | The
inside of a lambda declaration | - |
| ✓ | ✓ | `funk name` | `@functionName` | Name of declared
function | - |
| ✓ | ✓ | `lambda` | `@anonymousFunction` | A lambda
declaration | - |
| ✓ | ✓ | `inside lambda` | `@anonymousFunction.interior` |
The inside of a lambda declaration | - |
| ✓ | ✓ | `name` | `@name` | Variable name | - |
| ✓ | ✓ | `value` | `@value` | Right-hand-side value of an
assignment | - |
| ✓ | ✓ | `value` | `@value` | Value returned from a
function | - |
| ✓ | ✓ | `value` | `@value` | Value of a key-value pair | -
|
| ✓ | ✓ | `state` | `@statement` | Any single coded
statement | - |
| ✓ | ✓ | `if state` | `@ifStatement` | An if conditional
block | - |
| ✓ | ✓ | `condition` | `@condition` | Condition of an if
block | - |
| ✓ | ✓ | `condition` | `@condition` | Condition of a while
loop | - |
| ✓ | ✓ | `condition` | `@condition` | Condition of a do
while style loop | - |
| - | - | `condition` | `@condition` | Condition of a for loop | - |
| ✓ | ✓ | `condition` | `@condition` | Condition of a
ternary expression | - |
| ✓ | ✓ | `branch` | `@branch` | The resulting code
associated with a conditional expression | - |
| ✓ | ✓ | `comment` | `@comment` | Code comment | - |
| ✓ | ✓ | `string` | `@string` | Single line strings | - |
| ✗ | ✗ | `string` | `@string` | Multi-line strings |
https://github.com/cursorless-dev/cursorless/pull/1962#issuecomment-1783674916
|
| ✓ | ✓ | - | `@textFragment` | Used to capture string-type
nodes (strings and comments) | - |
| ✓ | ✓ | `call` | `@functionCall` | A function call (not a
function definition) | - |
| ✓ | ✓ | `callee` | `@functionCallee` | Name of the
function being called | - |
| ✓ | ✓ | `arg` | `@argumentOrParameter` | Arguments to
functions and calls | - |
| _ | _ | `class` | `@class` | Class or structure declaration | - |
| _ | _ | `inside class` | `@class.interior` | The inside of a class
declaration | - |
| _ | _ | `class name` | `@className` | Name of class or structure
declaration | - |
| _ | _ | `type` | `@type` | Type declarations | - |

---------

Co-authored-by: fidgetingbits <fidgetingbits@memeoid.cx>
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
2024-03-19 17:26:38 +00:00
.github Make josh codeowner of keyboard files (#2204) 2024-01-27 10:22:24 +00:00
.meta-updater Migrate to a pnpm monorepo (#1281) 2023-03-21 13:28:05 +00:00
.vscode keyboard: Use parser for key sequences (#2051) 2023-12-05 15:27:34 +00:00
changelog Fallback to Talon actions when focus is not on the text editor (#2235) 2024-03-19 16:27:59 +00:00
cursorless-snippets Add Go support to snippets (#1591) 2023-07-07 08:09:44 +00:00
cursorless-talon Fallback to Talon actions when focus is not on the text editor (#2235) 2024-03-19 16:27:59 +00:00
cursorless-talon-dev Public get text action (#2069) 2023-12-19 14:52:12 +00:00
data/playground Initial lua support (#1962) 2024-03-19 17:26:38 +00:00
docs Add a page about visual impairments to the docs (#2258) 2024-03-18 11:40:27 +00:00
fonts Update Cursorless icon in status bar (#2078) 2023-12-02 09:33:33 +00:00
images images/hats: close subpath in hole.svg (#2167) 2024-01-10 14:50:24 +00:00
packages Initial lua support (#1962) 2024-03-19 17:26:38 +00:00
patches bump docusauruas => 3.1.0 (#2176) 2024-01-18 06:32:17 +00:00
queries Initial lua support (#1962) 2024-03-19 17:26:38 +00:00
schemas Switch statement subject (#2046) 2023-11-23 11:29:04 +00:00
scripts keyboard: Use parser for key sequences (#2051) 2023-12-05 15:27:34 +00:00
typings Move custom Object.keys() overload to util (#2020) 2023-11-11 16:21:41 +00:00
.editorconfig keyboard: Use parser for key sequences (#2051) 2023-12-05 15:27:34 +00:00
.eslintrc.json Disallow .only in mocha tests (#2107) 2023-12-07 13:41:28 +00:00
.git-blame-ignore-revs Update .git-blame-ignore-revs to exclude 4dc746c (#1198) 2022-12-22 10:02:23 +00:00
.gitignore move subset regular expressions to a separate file (#1690) 2023-08-14 13:52:43 +00:00
.npmrc Migrate to a pnpm monorepo (#1281) 2023-03-21 13:28:05 +00:00
.pre-commit-config.yaml Bump black to 24.1.1 (#2216) 2024-02-05 08:52:07 +00:00
.prettierignore keyboard: Use parser for key sequences (#2051) 2023-12-05 15:27:34 +00:00
.prettierrc Switch to prettier trailingComma: "all" (#1084) 2022-10-24 16:08:53 +02:00
.syncpackrc.json Migrate to a pnpm monorepo (#1281) 2023-03-21 13:28:05 +00:00
CHANGELOG.md knausj => community (#1914) 2023-09-28 10:31:22 +00:00
CONTRIBUTING.md Serve docs folder and API reference on GitHub pages (#477) 2022-03-16 23:23:03 +00:00
LICENSE Add license 2021-05-04 12:07:25 +01:00
netlify.toml Migrate to a pnpm monorepo (#1281) 2023-03-21 13:28:05 +00:00
NOTICE.md Clean up badges; add ratings badge (#488) 2022-01-17 14:06:49 +00:00
package.json bump pnpm => 8.15.3 (#2248) 2024-02-24 11:44:55 +00:00
pnpm-lock.yaml bump sanitize-html => 2.12.1; pnpm dedupe (#2264) 2024-03-15 12:58:35 +00:00
pnpm-workspace.yaml Migrate to a pnpm monorepo (#1281) 2023-03-21 13:28:05 +00:00
pyproject.toml Target Python 3.11 (Talon 0.4) (#1880) 2023-12-18 15:42:56 +00:00
README.md bump maintenance badge (#2230) 2024-02-08 13:16:49 +00:00
SECURITY.md Create SECURITY.md (#1184) 2022-12-15 18:44:28 +01:00
third-party-licenses.csv Create local extension sandbox (#691) 2022-05-25 19:46:15 +01:00
tsconfig.base.json bump typescript => 5.2.2 (#1979) 2023-11-13 13:30:21 +00:00
tsconfig.json Merge cursorless-vscode-core into cursorless-vscode (#1421) 2023-04-14 22:03:16 +00:00

Welcome to Cursorless!

Rating Documentation Tests Maintenance License: MIT

Cursorless is a spoken language for structural code editing, enabling developers to code by voice at speeds not possible with a keyboard. Cursorless decorates every token on the screen and defines a spoken language for rapid, high-level semantic manipulation of structured text.

Checkout the docs and videos to learn more. See installation for installation instructions.

And I heard you like GIFs?

Curly repack ox Move arg air and each to after drum Chuck tail red pipe slice past end of file

Installation

Currently depends on Talon, though a keyboard version is planned.

See installation for installation instructions.

Extension Settings

This extension contributes the following settings:

  • cursorless.showOnStart: Whether decorations should appear on workspace start
  • cursorless.hatSizeAdjustment: Percentage to increase or decrease hat size; positive increases size
  • cursorless.hatVerticalOffset: How much to vertically shift the hats as a percentage of font size; positive is up
  • cursorless.hatEnablement.colors: Whether to enable particular hat colors.
  • cursorless.hatEnablement.shapes: Whether to enable particular hat shapes.
  • cursorless.hatPenalties.colors: How much to penalize each hat color. You will probably want to set this one to the number of syllables in the given style. Cursorless will then sort every style combination by number of syllables to refer to it.
  • cursorless.hatPenalties.shapes: How much to penalize each hat shape. You will probably want to set this one to the number of syllables in the given style. Cursorless will then sort every style combination by number of syllables to refer to it.
  • cursorless.maximumHatStylePenalty: The maximum allowed penalty for a hat style. Any hat style whose penalty is greater than this amount will not be used. A hat style penalty is defined to be the shape penalty plus the colour penalty. Setting this value less than or equal to zero is treated as no maximum.

Known Issues

  • Cursorless calculates the position of the hats based on the characteristics of your font. If you find that the hats are off center you can try running this command: cursorless.recomputeDecorationStyles

Contributing

See contributing.

Change Log

See CHANGELOG.md.

Attributions

See NOTICE.md.