From f7526556c2859b014a362c385385f760bee83007 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 20 Mar 2026 17:01:43 +0100 Subject: [PATCH 1/4] Move cursorless.nvim to packages/app-neovim/cursorless.nvim --- .gitignore | 6 ++---- .../app-neovim/cursorless.nvim}/.busted | 0 .../cursorless.nvim}/.github/ISSUE_TEMPLATE/config.yml | 0 .../app-neovim/cursorless.nvim}/CONTRIBUTING.md | 0 .../app-neovim/cursorless.nvim}/LICENSE | 0 .../app-neovim/cursorless.nvim}/README.md | 0 .../app-neovim/cursorless.nvim}/lua/cursorless/config.lua | 0 .../cursorless.nvim}/lua/cursorless/cursorless.lua | 0 .../app-neovim/cursorless.nvim}/lua/cursorless/init.lua | 0 .../app-neovim/cursorless.nvim}/lua/cursorless/utils.lua | 0 .../cursorless.nvim}/node/command-server/README.md | 0 .../cursorless.nvim}/node/command-server/index/index.cjs | 0 .../cursorless.nvim}/node/command-server/package.json | 0 .../app-neovim/cursorless.nvim}/test/helpers.lua | 0 .../app-neovim/cursorless.nvim}/test/nvim-shim.sh | 0 .../cursorless.nvim}/test/unit/cursorless_spec.lua | 0 16 files changed, 2 insertions(+), 4 deletions(-) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/.busted (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/.github/ISSUE_TEMPLATE/config.yml (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/CONTRIBUTING.md (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/LICENSE (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/README.md (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/lua/cursorless/config.lua (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/lua/cursorless/cursorless.lua (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/lua/cursorless/init.lua (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/lua/cursorless/utils.lua (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/node/command-server/README.md (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/node/command-server/index/index.cjs (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/node/command-server/package.json (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/test/helpers.lua (100%) rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/test/nvim-shim.sh (100%) mode change 100755 => 100644 rename {cursorless.nvim => packages/app-neovim/cursorless.nvim}/test/unit/cursorless_spec.lua (100%) diff --git a/.gitignore b/.gitignore index b51fe50bd3..fa67b4db01 100644 --- a/.gitignore +++ b/.gitignore @@ -5,14 +5,12 @@ /packages/*/out/ /packages/*/dist/ /packages/app-web-docs/.docusaurus/ +/packages/app-neovim/cursorless.nvim/node/cursorless-neovim/ +/packages/app-neovim/cursorless.nvim/node/test-runner/ /packages/*/tsconfig.tsbuildinfo /packages/test-runner/testSubsetGrep.properties /packages/test-runner/failedTests.properties -# Cursorless Neovim -/cursorless.nvim/node/cursorless-neovim/ -/cursorless.nvim/node/test-runner/ - # Anywhere node_modules/ *.vsix diff --git a/cursorless.nvim/.busted b/packages/app-neovim/cursorless.nvim/.busted similarity index 100% rename from cursorless.nvim/.busted rename to packages/app-neovim/cursorless.nvim/.busted diff --git a/cursorless.nvim/.github/ISSUE_TEMPLATE/config.yml b/packages/app-neovim/cursorless.nvim/.github/ISSUE_TEMPLATE/config.yml similarity index 100% rename from cursorless.nvim/.github/ISSUE_TEMPLATE/config.yml rename to packages/app-neovim/cursorless.nvim/.github/ISSUE_TEMPLATE/config.yml diff --git a/cursorless.nvim/CONTRIBUTING.md b/packages/app-neovim/cursorless.nvim/CONTRIBUTING.md similarity index 100% rename from cursorless.nvim/CONTRIBUTING.md rename to packages/app-neovim/cursorless.nvim/CONTRIBUTING.md diff --git a/cursorless.nvim/LICENSE b/packages/app-neovim/cursorless.nvim/LICENSE similarity index 100% rename from cursorless.nvim/LICENSE rename to packages/app-neovim/cursorless.nvim/LICENSE diff --git a/cursorless.nvim/README.md b/packages/app-neovim/cursorless.nvim/README.md similarity index 100% rename from cursorless.nvim/README.md rename to packages/app-neovim/cursorless.nvim/README.md diff --git a/cursorless.nvim/lua/cursorless/config.lua b/packages/app-neovim/cursorless.nvim/lua/cursorless/config.lua similarity index 100% rename from cursorless.nvim/lua/cursorless/config.lua rename to packages/app-neovim/cursorless.nvim/lua/cursorless/config.lua diff --git a/cursorless.nvim/lua/cursorless/cursorless.lua b/packages/app-neovim/cursorless.nvim/lua/cursorless/cursorless.lua similarity index 100% rename from cursorless.nvim/lua/cursorless/cursorless.lua rename to packages/app-neovim/cursorless.nvim/lua/cursorless/cursorless.lua diff --git a/cursorless.nvim/lua/cursorless/init.lua b/packages/app-neovim/cursorless.nvim/lua/cursorless/init.lua similarity index 100% rename from cursorless.nvim/lua/cursorless/init.lua rename to packages/app-neovim/cursorless.nvim/lua/cursorless/init.lua diff --git a/cursorless.nvim/lua/cursorless/utils.lua b/packages/app-neovim/cursorless.nvim/lua/cursorless/utils.lua similarity index 100% rename from cursorless.nvim/lua/cursorless/utils.lua rename to packages/app-neovim/cursorless.nvim/lua/cursorless/utils.lua diff --git a/cursorless.nvim/node/command-server/README.md b/packages/app-neovim/cursorless.nvim/node/command-server/README.md similarity index 100% rename from cursorless.nvim/node/command-server/README.md rename to packages/app-neovim/cursorless.nvim/node/command-server/README.md diff --git a/cursorless.nvim/node/command-server/index/index.cjs b/packages/app-neovim/cursorless.nvim/node/command-server/index/index.cjs similarity index 100% rename from cursorless.nvim/node/command-server/index/index.cjs rename to packages/app-neovim/cursorless.nvim/node/command-server/index/index.cjs diff --git a/cursorless.nvim/node/command-server/package.json b/packages/app-neovim/cursorless.nvim/node/command-server/package.json similarity index 100% rename from cursorless.nvim/node/command-server/package.json rename to packages/app-neovim/cursorless.nvim/node/command-server/package.json diff --git a/cursorless.nvim/test/helpers.lua b/packages/app-neovim/cursorless.nvim/test/helpers.lua similarity index 100% rename from cursorless.nvim/test/helpers.lua rename to packages/app-neovim/cursorless.nvim/test/helpers.lua diff --git a/cursorless.nvim/test/nvim-shim.sh b/packages/app-neovim/cursorless.nvim/test/nvim-shim.sh old mode 100755 new mode 100644 similarity index 100% rename from cursorless.nvim/test/nvim-shim.sh rename to packages/app-neovim/cursorless.nvim/test/nvim-shim.sh diff --git a/cursorless.nvim/test/unit/cursorless_spec.lua b/packages/app-neovim/cursorless.nvim/test/unit/cursorless_spec.lua similarity index 100% rename from cursorless.nvim/test/unit/cursorless_spec.lua rename to packages/app-neovim/cursorless.nvim/test/unit/cursorless_spec.lua From 42c8b42e8269db622c29b24bdd268eeccd63b71d Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 20 Mar 2026 17:08:49 +0100 Subject: [PATCH 2/4] Update scripts and docs --- .github/actions/test-neovim-lua/action.yml | 2 +- init.lua | 2 +- packages/app-neovim/scripts/populate-dist.sh | 2 +- .../neovim-test-infrastructure.md | 34 +++++++++---------- .../docs/contributing/cursorless-in-neovim.md | 8 ++--- scripts/deploy-cursorless-nvim.sh | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/actions/test-neovim-lua/action.yml b/.github/actions/test-neovim-lua/action.yml index 9a0862f75f..c07152b378 100644 --- a/.github/actions/test-neovim-lua/action.yml +++ b/.github/actions/test-neovim-lua/action.yml @@ -15,5 +15,5 @@ runs: luarocks install luafilesystem - shell: bash run: | - cd cursorless.nvim + cd packages/app-neovim/cursorless.nvim busted --run unit diff --git a/init.lua b/init.lua index 8ef08d16cb..591084d98a 100644 --- a/init.lua +++ b/init.lua @@ -26,7 +26,7 @@ local repo_root = os.getenv("CURSORLESS_REPO_ROOT") if not repo_root then error("CURSORLESS_REPO_ROOT is not set. Run via debug-neovim.sh script.") end -vim.opt.runtimepath:append(repo_root .. "/cursorless.nvim") +vim.opt.runtimepath:append(repo_root .. "/packages/app-neovim/cursorless.nvim") require("talon").setup() require("cursorless").setup() diff --git a/packages/app-neovim/scripts/populate-dist.sh b/packages/app-neovim/scripts/populate-dist.sh index 29c9339dcf..94070a140d 100755 --- a/packages/app-neovim/scripts/populate-dist.sh +++ b/packages/app-neovim/scripts/populate-dist.sh @@ -6,7 +6,7 @@ if [ ! -e "${CURSORLESS_REPO_ROOT-nonexistent}" ]; then CURSORLESS_REPO_ROOT=$(git rev-parse --show-toplevel) fi echo "CURSORLESS_REPO_ROOT: $CURSORLESS_REPO_ROOT" -cursorless_nvim_dir="$CURSORLESS_REPO_ROOT/cursorless.nvim" +cursorless_nvim_dir="$CURSORLESS_REPO_ROOT/packages/app-neovim/cursorless.nvim" cursorless_neovim_node_in_dir="$CURSORLESS_REPO_ROOT/packages/app-neovim" test_runner_node_in_dir="$CURSORLESS_REPO_ROOT/packages/test-runner" diff --git a/packages/app-web-docs/src/docs/contributing/architecture/neovim-test-infrastructure.md b/packages/app-web-docs/src/docs/contributing/architecture/neovim-test-infrastructure.md index 777844a161..ae03f8ae91 100644 --- a/packages/app-web-docs/src/docs/contributing/architecture/neovim-test-infrastructure.md +++ b/packages/app-web-docs/src/docs/contributing/architecture/neovim-test-infrastructure.md @@ -95,21 +95,21 @@ This ends up passing the `init.lua` script as the default config file (`-u`): nvim -u %CURSORLESS_REPO_ROOT%/init.lua ``` -This `init.lua` adds the local `cursorless.nvim` relative path to the runtime path and initializes Cursorless: +This `init.lua` adds the local `packages/app-neovim/cursorless.nvim` relative path to the runtime path and initializes Cursorless: ```lua local repo_root = os.getenv("CURSORLESS_REPO_ROOT") if not repo_root then error("CURSORLESS_REPO_ROOT is not set. Run via debug-neovim.sh script.") end -vim.opt.runtimepath:append(repo_root .. "/cursorless.nvim") +vim.opt.runtimepath:append(repo_root .. "/packages/app-neovim/cursorless.nvim") ... require("cursorless").setup() ``` -NOTE: this relies on having symlinks inside `cursorless.nvim/node/` to point to the development paths `packages/app-neovim` and `packages/test-runner`. This is required in order to have all the symbols loaded for debugging. +NOTE: this relies on having symlinks inside `packages/app-neovim/cursorless.nvim/node/` to point to the development paths `packages/app-neovim` and `packages/test-runner`. This is required in order to have all the symbols loaded for debugging. -This ends up calling `setup()` from `cursorless.nvim/lua/cursorless/init.lua`: +This ends up calling `setup()` from `packages/app-neovim/cursorless.nvim/lua/cursorless/init.lua`: ```lua local function setup(user_config) @@ -257,7 +257,7 @@ export async function launchNeovimAndRunTests() { console.log(`done: ${done}`); ``` -At this stage, we are in a similar situation to the "Cursorless tests for neovim locally" case where `nvim` is started with the `packages/test-runner/src/config/init.lua` config file. Similarly, this `init.lua` adds the local `cursorless.nvim` relative path to the runtime path and initializes Cursorless: +At this stage, we are in a similar situation to the "Cursorless tests for neovim locally" case where `nvim` is started with the `packages/test-runner/src/config/init.lua` config file. Similarly, this `init.lua` adds the local `dist/cursorless.nvim` relative path to the runtime path and initializes Cursorless: ```lua local repo_root = os.getenv("CURSORLESS_REPO_ROOT") @@ -271,7 +271,7 @@ This ends up calling `setup()` from `dist/cursorless.nvim/lua/cursorless/init.lu NOTE: Because `NVIM_NODE_HOST_DEBUG` is not set on CI, `nvim` loads entirely right away and tests are executed. -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. +NOTE: CI uses `dist/cursorless.nvim/` (and not `packages/app-neovim/cursorless.nvim/`), since the symlinks in `packages/app-neovim/cursorless.nvim/` are only created locally in order to get symbols loaded, which we don't need on CI. ## Lua unit tests @@ -280,19 +280,19 @@ This is supported on Linux only, both locally and on CI. Here is the call path when running lua unit tests locally. Note that `->` indicates one file calling another file: ``` -launch.json -> .vscode/tasks.json -> cd cursorless.nvim && busted --run unit -cursorless.nvim/.busted - -> lua interpreter: cursorless.nvim/test/nvim-shim.sh -> nvim -l - -> test specification files: cursorless.nvim/test/unit/*_spec.lua +launch.json -> .vscode/tasks.json -> cd packages/app-neovim/cursorless.nvim && busted --run unit +packages/app-neovim/cursorless.nvim/.busted + -> lua interpreter: packages/app-neovim/cursorless.nvim/test/nvim-shim.sh -> nvim -l + -> test specification files: packages/app-neovim/cursorless.nvim/test/unit/*_spec.lua ``` And here is the call path when running lua unit tests on CI: ``` -.github/workflows/test.yml -> .github/actions/test-neovim-lua/action.yml -> cd cursorless.nvim && busted --run unit -cursorless.nvim/.busted - -> lua interpreter: cursorless.nvim/test/nvim-shim.sh -> nvim -l - -> test specification files: cursorless.nvim/test/unit/*_spec.lua +.github/workflows/test.yml -> .github/actions/test-neovim-lua/action.yml -> cd packages/app-neovim/cursorless.nvim && busted --run unit +packages/app-neovim/cursorless.nvim/.busted + -> lua interpreter: packages/app-neovim/cursorless.nvim/test/nvim-shim.sh -> nvim -l + -> test specification files: packages/app-neovim/cursorless.nvim/test/unit/*_spec.lua ``` ### Running lua unit tests @@ -301,7 +301,7 @@ Many of the cursorless.nvim lua functions are run in order to complete Cursorles indirectly tested by the tests described in the [previous section](#running-neovim-tests-locally). Nevertheless, we run more specific unit tests in order to give better visibility into exactly which functions are failing. The [busted](https://github.com/lunarmodules/busted) framework is used to test lua functions defined in cursorless.nvim. -This relies on a `cursorless.nvim/.busted` file which directs busted to use a lua interpreter and test specifications files: +This relies on a `packages/app-neovim/cursorless.nvim/.busted` file which directs busted to use a lua interpreter and test specifications files: ```bash return { @@ -314,12 +314,12 @@ return { } ``` -The `.busted` file declares the `cursorless.nvim/test/nvim-shim.sh` shell wrapper as its lua interpreter. This script sets up an enclosed neovim environment by using [XDG Base +The `.busted` file declares the `packages/app-neovim/cursorless.nvim/test/nvim-shim.sh` shell wrapper as its lua interpreter. This script sets up an enclosed neovim environment by using [XDG Base Directory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) environment variables (Linux only) pointing to a temp directory. This allows loading cursorless.nvim, any helpers and (optional) plugins needed to run the tests. Consequently, the cursorless.nvim lua functions are exposed to the tests. Afterwards, the shim will use `nvim -l ` for each of the [lua test specifications scripts](https://neovim.io/doc/user/starting.html#-l). The `.busted` file declares that test specifications files are in -`cursorless.nvim/test/unit/`. Any file in that folder ending with `_spec.lua` contains tests and will be executed +`packages/app-neovim/cursorless.nvim/test/unit/`. Any file in that folder ending with `_spec.lua` contains tests and will be executed by neovim's lua interpreter. NOTE: Different tests rely on 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. diff --git a/packages/app-web-docs/src/docs/contributing/cursorless-in-neovim.md b/packages/app-web-docs/src/docs/contributing/cursorless-in-neovim.md index 8067fc571f..5118fc2b32 100644 --- a/packages/app-web-docs/src/docs/contributing/cursorless-in-neovim.md +++ b/packages/app-web-docs/src/docs/contributing/cursorless-in-neovim.md @@ -26,11 +26,11 @@ On Windows, open the Control Panel, navigate to `User Accounts > User Accounts`. This step is only required on Windows if you don't run VSCode with Administrator privileges. -Open a `cmd.exe` with Administrator privileges and create the symbolic links between the source folders and the `cursorless.nvim` destination folder: +Open a `cmd.exe` with Administrator privileges and create the symbolic links between the source folders and the `packages/app-neovim/cursorless.nvim` destination folder: ```bat -mklink /D C:\path\to\cursorless\cursorless.nvim\node\cursorless-neovim C:\path\to\cursorless\packages\app-neovim -mklink /D C:\path\to\cursorless\cursorless.nvim\node\test-runner C:\path\to\cursorless\packages\test-runner +mklink /D C:\path\to\cursorless\packages\app-neovim\cursorless.nvim\node\cursorless-neovim C:\path\to\cursorless\packages\app-neovim +mklink /D C:\path\to\cursorless\packages\app-neovim\cursorless.nvim\node\test-runner C:\path\to\cursorless\packages\test-runner ``` Note that the `C:\path\to\cursorless` path above should match your cloned cursorless repository. @@ -49,7 +49,7 @@ If you don't have the `cursorless-talon-dev` files in your Talon user directory ### Running lua tests -Their are separate cursorless and lua tests. You can run the lua tests by entering the `cursorless.nvim` folder and +Their are separate cursorless and lua tests. You can run the lua tests by entering the `packages/app-neovim/cursorless.nvim` folder and running: `busted --run unit`. These tests currently only work on Linux. ## Sending pull requests diff --git a/scripts/deploy-cursorless-nvim.sh b/scripts/deploy-cursorless-nvim.sh index 48fd709089..bc4f45f96c 100755 --- a/scripts/deploy-cursorless-nvim.sh +++ b/scripts/deploy-cursorless-nvim.sh @@ -23,7 +23,7 @@ git rm -r '*' cd - # Copy static files -rsync -avhW --no-compress --exclude test --exclude .busted cursorless.nvim/ "$staging_dir/" +rsync -avhW --no-compress --exclude test --exclude .busted packages/app-neovim/cursorless.nvim/ "$staging_dir/" # Copy the built .js file mkdir -p "$staging_dir/node/cursorless-neovim/out" From cc3a52c349a73d2c3dc6fd8c340504f27adf2fd2 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 20 Mar 2026 17:53:54 +0100 Subject: [PATCH 3/4] lint fixes --- .../cursorless.nvim/node/command-server/package.json | 10 +++++----- packages/app-neovim/cursorless.nvim/test/nvim-shim.sh | 0 2 files changed, 5 insertions(+), 5 deletions(-) mode change 100644 => 100755 packages/app-neovim/cursorless.nvim/test/nvim-shim.sh diff --git a/packages/app-neovim/cursorless.nvim/node/command-server/package.json b/packages/app-neovim/cursorless.nvim/node/command-server/package.json index d9da516fbd..7b236269ee 100644 --- a/packages/app-neovim/cursorless.nvim/node/command-server/package.json +++ b/packages/app-neovim/cursorless.nvim/node/command-server/package.json @@ -14,15 +14,15 @@ "@types/mocha": "^10.0.10", "@types/node": "^24.12.0", "@types/rimraf": "^^3.0.0", - "@types/vscode": "^1.98.0", + "@types/vscode": "1.98.0", "@typescript-eslint/eslint-plugin": "^8.32.1", "@typescript-eslint/parser": "^8.32.1", "esbuild": "^0.27.4", - "eslint": "^10.0.0", + "eslint": "^10.0.3", "fast-glob": "^3.3.3", - "mocha": "^8.1.3", - "neovim": "^5.0.1", - "typescript": "^5.8.3", + "mocha": "^11.7.5", + "neovim": "^5.4.0", + "typescript": "^5.9.3", "vscode-test": "^1.6.1" }, "dependencies": { diff --git a/packages/app-neovim/cursorless.nvim/test/nvim-shim.sh b/packages/app-neovim/cursorless.nvim/test/nvim-shim.sh old mode 100644 new mode 100755 From 2cbec560a566940a73095bdbe13a48caebd7b667 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 20 Mar 2026 19:01:03 +0100 Subject: [PATCH 4/4] eslint exclude cursorless.nvim --- eslint.config.mts | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint.config.mts b/eslint.config.mts index 3f02db3425..f3faa7fe54 100644 --- a/eslint.config.mts +++ b/eslint.config.mts @@ -23,6 +23,7 @@ const ignoresConfig: ConfigWithExtends = { "packages/*/out/**", "packages/*/dist/**", "packages/app-web-docs/.docusaurus/**", + "packages/app-neovim/cursorless.nvim/**", "packages/app-vscode/src/keyboard/grammar/generated/**", "packages/lib-engine/src/customCommandGrammar/generated/**", "packages/lib-engine/src/snippets/vendor/**",