You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Welcome! So glad you've decided to help make Cursorless in Neovim better.
4
+
5
+
Note that Cursorless is maintained as a monorepo, hosted at [`cursorless`](https://github.com/cursorless-dev/cursorless), and the source of truth for all of the files here lives there, so that's where you'll want to file a PR. We automatically deploy from our monorepo to the [cursorless.nvim repo](https://github.com/hands-free-vim/cursorless.nvim) in CI.
6
+
7
+
See [the Cursorless neovim contributor docs](https://www.cursorless.org/docs/contributing/cursorless-in-neovim/) to get started.
Copy file name to clipboardExpand all lines: cursorless.nvim/README.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@
20
20
21
21
# cursorless.nvim
22
22
23
-
Neovim plugin to support Cursorless
23
+
Very experimental Neovim plugin providing partial Cursorless support. We support much of the core functionality, but many features are not yet implemented, in particular hats and language-specific scopes. Expect some rough edges, but please give it a try, and if you like it, consider [contributing](https://www.cursorless.org/docs/contributing/cursorless-in-neovim/)!
24
24
25
25
## Prerequisites
26
26
@@ -109,6 +109,10 @@ Some Linux package managers ship with a version of `nvim` too old for Lazy. If t
109
109
110
110
If you are on Linux, avoid using the snap package for `npm` as it may not be able to globally expose the neovim npm package due to sandboxing. If this is the case, install node via another method (nvm, brew, etc).
111
111
112
-
## Contributors
112
+
## Contributing
113
113
114
-
Welcome! So glad you've decided to help make Cursorless in Neovim better. You'll want to start by getting [set up](https://github.com/saidelike/cursorless/blob/nvim-talon/docs/contributing/cursorless-in-neovim.md). You may also find the [Neovim API docs](https://neovim.io/doc/user/api.html) helpful to learn about Neovim extension development.
114
+
Welcome! So glad you've decided to help make Cursorless in Neovim better.
115
+
116
+
Note that Cursorless is maintained as a monorepo, hosted at [`cursorless`](https://github.com/cursorless-dev/cursorless), and the source of truth for all of the files here lives there, so that's where you'll want to file a PR. We automatically deploy from our monorepo to the [cursorless.nvim repo](https://github.com/hands-free-vim/cursorless.nvim) in CI.
117
+
118
+
See [the Cursorless neovim contributor docs](https://www.cursorless.org/docs/contributing/cursorless-in-neovim/) to get started.
1. Clone [`cursorless`](https://github.com/cursorless-dev/cursorless) locally. Note that it doesn't matter where you clone it, as long as you _**do not**_ clone it into your Talon user directory.
18
18
2. Open the newly created `cursorless` directory in VSCode. If you're on Windows, don't use WSL (see [#919](https://github.com/cursorless-dev/cursorless/issues/919) for discussion / workaround).
Copy file name to clipboardExpand all lines: docs/contributing/architecture/neovim-test-infrastructure.md
+32-55Lines changed: 32 additions & 55 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,22 @@
1
-
# Tests
1
+
# Neovim test infrastructure
2
2
3
-
Tests in Cursorless are done in various ways depending on what is tested.
3
+
We'll start with a high-level overview of the architecture of the Cursorless tests for neovim, and then we'll dive into the details.
4
4
5
-
1.**Cursorless tests for VSCode**: tests the actions (`take`, `chuck`, etc.) inside VSCode.
5
+
## Neovim tests
6
6
7
-
2.**Cursorless unit tests**: tests specific TypeScript functions (`toggle decorations`, `visible multiple regions`, etc.). These tests don't rely on VSCode or neovim.
8
-
9
-
3.**Cursorless tests for neovim**: tests the actions (`take`, `chuck`, etc.) inside neovim. 99% of them are the same as the "Cursorless tests for VSCode" except some new ones are needed in order to test all actions, due to no hats being supported yet in neovim (and the fact that lots of "Cursorless tests for VSCode" rely on hats).
7
+
Here is the call path when running Neovim tests locally. Note that `->` indicates one file calling another file:
-> test specification files: cursorless.nvim/test/unit/*_spec.lua
53
-
```
54
-
55
-
5.**Cursorless tests for Talon**: XXX
56
-
57
-
## 1. Cursorless tests for VSCode
58
-
59
-
XXX
60
-
61
-
## 2. Cursorless unit tests
62
-
63
-
XXX
64
-
65
-
## 3. Cursorless tests for neovim
66
-
67
-
### 3.1 Cursorless tests for neovim locally
32
+
### Running Neovim tests locally
68
33
69
34
This is supported on Windows, Linux and OSX.
70
35
@@ -236,21 +201,21 @@ async function runTestsInDir(
236
201
237
202
Consequently, the recorded tests from `data/fixtures/recorded/` are executed when `packages/cursorless-neovim-e2e/src/suite/recorded.neovim.test.ts` is invoked.
238
203
239
-
### 3.2 Cursorless tests for neovim on CI
204
+
### Running Neovim tests on CI
240
205
241
206
This is supported on Linux only.
242
207
243
208
It starts from `.github/workflows/test.yml` which currently only tests the latest stable neovim version on Linux:
This ends up calling the default function from `package/test-harness/src/scripts/runNeovimTestsCI.ts` which calls `launchNeovimAndRunTests()` from `packages/test-harness/src/launchNeovimAndRunTests.ts`:
@@ -310,14 +275,33 @@ NOTE: Because `NVIM_NODE_HOST_DEBUG` is not set on CI, `nvim` loads entirely rig
310
275
311
276
NOTE: CI uses `dist/cursorless.nvim/` (and not `cursorless.nvim/`), since the symlinks in `cursorless.nvim/` are only created locally in order to get symbols loaded, which we don't need on CI.
312
277
313
-
## 4. Lua unit tests for neovim
278
+
## Lua unit tests
314
279
315
280
This is supported on Linux only, both locally and on CI.
316
281
282
+
Here is the call path when running lua unit tests locally. Note that `->` indicates one file calling another file:
only) pointing to a temp directory. This allows loading cursorless.nvim, any helpers and (optional) plugins needed to run
338
322
the tests. Consequently, the cursorless.nvim lua functions are exposed to the tests. Afterwards, the shim will use `nvim -l <spec_script>` for each of the [lua test specifications scripts](https://neovim.io/doc/user/starting.html#-l).
339
-
340
323
The `.busted` file declares that test specifications files are in
341
324
`cursorless.nvim/test/unit/`. Any file in that folder ending with `_spec.lua` contains tests and will be executed
342
325
by neovim's lua interpreter.
343
-
344
326
NOTE: Different tests rely on
345
327
the same custom test helper functions. These functions are exposed as globals in a file called `helpers.lua` placed in `nvim/plugin/` inside the isolated XDG environment. These helpers themselves also have their own unit tests that will be run by busted.
346
-
347
328
This busted setup was inspired by this [blog
348
329
post](https://hiphish.github.io/blog/2024/01/29/testing-neovim-plugins-with-busted/), which goes into greater detail.
Copy file name to clipboardExpand all lines: docs/contributing/cursorless-in-neovim.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
# Cursorless in Neovim
2
2
3
-
This document describes how to get set up to work on the Cursorless neovim plugin.
3
+
This document describes how to get set up to work on the Cursorless neovim plugin. You may also find the [Neovim API docs](https://neovim.io/doc/user/api.html) helpful to learn about Neovim extension development.
4
+
5
+
Note that Cursorless is maintained as a monorepo, hosted at [`cursorless`](https://github.com/cursorless-dev/cursorless), and the source of truth for all of the files in cursorless.nvim lives there. We automatically deploy from our monorepo to the [cursorless.nvim repo](https://github.com/hands-free-vim/cursorless.nvim) in CI.
4
6
5
7
## Initial setup
6
8
@@ -50,7 +52,7 @@ running: `busted --run unit`. These tests currently only work on Linux.
50
52
51
53
## Sending pull requests
52
54
53
-
The [cursorless.nvim](https://github.com/hands-free-vim/cursorless.nvim) repo is part of the larger cursorless monorepo, and is currently part of a pending PR to that monorepo only. If you'd like to send a PR to `cursorless.nvim`, please send a PR against the `nvim-talon` branch of this [repo](https://github.com/saidelike/cursorless).
55
+
The source of truth for `cursorless.nvim` lives in the [Cursorless monorepo](https://github.com/cursorless-dev/cursorless/). We automatically push to the [cursorless.nvim](https://github.com/hands-free-vim/cursorless.nvim) repo in CI. If you'd like to contribute to `cursorless.nvim`, please open a PR in the [Cursorless monorepo](https://github.com/cursorless-dev/cursorless/).
0 commit comments