Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ insert_final_newline = false
# with a line that has trailing white space. Many of our recorded
# tests use strings with trailing white space to represent the final
# document contents. For example
# data/fixtures/recorded/languages/ruby/changeCondition.yml
# resources/fixtures/recorded/languages/ruby/changeCondition.yml
trim_trailing_whitespace = false

[Makefile]
Expand Down
3 changes: 0 additions & 3 deletions .git-blame-ignore-revs

This file was deleted.

2 changes: 1 addition & 1 deletion .github/actions/lint-lua-ls/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ runs:
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix profile add --accept-flake-config .#lua-language-server
shell: bash
- run: scripts/lint-lua-ls.sh
- run: resources/scripts/lint-lua-ls.sh
Comment thread
AndreasArvidsson marked this conversation as resolved.
shell: bash
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
git config commit.gpgsign true

- name: Push compiled files to cursorless.nvim plugin repo
run: bash -x scripts/deploy-cursorless-nvim.sh ${{ env.STAGING_DIRECTORY }}
run: bash -x resources/scripts/deploy-cursorless-nvim.sh ${{ env.STAGING_DIRECTORY }}

push-cursorless-talon:
name: Push cursorless-talon subrepo
Expand Down Expand Up @@ -127,4 +127,4 @@ jobs:
git config commit.gpgsign true

- name: Push cursorless-talon subrepo
run: bash -x scripts/deploy-cursorless-talon.sh
run: bash -x resources/scripts/deploy-cursorless-talon.sh
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
run: pnpm --color lint

- name: Forbid TODO
run: ./scripts/forbid-todo.sh
run: ./resources/scripts/forbid-todo.sh
Comment thread
AndreasArvidsson marked this conversation as resolved.

build-website:
name: Build Website
Expand All @@ -44,7 +44,7 @@ jobs:
uses: ./.github/actions/setup-node

- name: Build website
run: bash -x scripts/build-and-assemble-website.sh
run: bash -x resources/scripts/build-and-assemble-website.sh

test-main:
name: Test
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
run: pnpm --color -F '!@cursorless/app-web' -F '!@cursorless/app-web-docs' build

- name: Install neovim dependencies
run: bash -x scripts/install-neovim-dependencies.sh
run: bash -x resources/scripts/install-neovim-dependencies.sh

- name: Setup neovim
uses: rhysd/action-setup-vim@v1
Expand Down
7 changes: 6 additions & 1 deletion .luarc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"runtime.version": "Lua 5.1",
"diagnostics.ignoredFiles": "Disable",
"diagnostics.globals": ["vim", "talon", "it", "describe"],
"workspace.ignoreDir": ["data/playground/lua/", ".luarocks", ".lua", "dist"]
"workspace.ignoreDir": [
"resources/playground/lua/",
".luarocks",
".lua",
"dist"
]
}
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
minimum_pre_commit_version: "3.2.0"
ci:
autoupdate_schedule: monthly
exclude: /vendor/|^data/playground/
exclude: /vendor/|^resources/playground/
repos:
- repo: meta
hooks:
Expand Down Expand Up @@ -33,7 +33,7 @@ repos:
- id: detect-private-key
- id: end-of-file-fixer
exclude_types: [svg]
exclude: ^patches/.*\.patch$|\.scope$
exclude: ^resources/patches/.*\.patch$|\.scope$
- id: fix-byte-order-marker
- id: forbid-submodules
- id: mixed-line-ending
Expand All @@ -42,8 +42,8 @@ repos:
# with a line that has trailing white space. Many of our recorded
# tests use strings with trailing white space to represent the final
# document contents. For example
# data/fixtures/recorded/languages/ruby/changeCondition.yml
exclude: ^data/fixtures/recorded/.*/[^/]*\.yml$|\.scope$|/generated/|^patches/
# resources/fixtures/recorded/languages/ruby/changeCondition.yml
exclude: ^resources/fixtures/recorded/.*/[^/]*\.yml$|\.scope$|/generated/|^resources/patches/

- repo: local
hooks:
Expand All @@ -67,15 +67,15 @@ repos:
hooks:
- id: format-recorded-tests
name: format-recorded-tests
files: ^data/fixtures/recorded/.*/[^/]*\.yml$
files: ^resources/fixtures/recorded/.*/[^/]*\.yml$
language: system
entry: pnpm transform-recorded-tests

- repo: local
hooks:
- id: check-recorded-test-marks
name: check-recorded-test-marks
files: ^data/fixtures/recorded/.*/[^/]*\.yml$
files: ^resources/fixtures/recorded/.*/[^/]*\.yml$
language: system
entry: pnpm transform-recorded-tests --check-marks

Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/packages/lib-engine/src/snippets/vendor/

# We use our own format for our recorded yaml tests to keep them compact
/data/fixtures/recorded/**/*.yml
/resources/fixtures/recorded/**/*.yml

# Anywhere
node_modules/
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

- Main extension code is in `/packages/app-vscode/`
- Engine code is in `/packages/lib-engine/`
- Tests are in `data/fixtures/recorded/`
- Language-specific parsing is defined in the `queries/*.scm` files
- Tests are in `resources/fixtures/recorded` and `resources/fixtures/scopes`
- Language-specific parsing is defined in the `resources/queries/*.scm` files

## Build and Test

Expand All @@ -33,7 +33,7 @@ When documenting actions or modifiers:
## Implementation Notes

- Many actions (`drop`, `float`, `puff`) work with both line and non-line targets
- Always check test fixtures in `/data/fixtures/recorded/` to understand behavior
- Always check test fixtures in `/resources/fixtures/recorded` to understand behavior
- Implementation for many actions is in `/packages/lib-engine/src/actions/`
- After running Python scripts or tests, delete any `__pycache__` directories and `.pyc` files created under the repository root.

Expand Down
22 changes: 0 additions & 22 deletions NOTICE.md

This file was deleted.

10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ Checkout the [docs](https://www.cursorless.org/docs/) and [videos](https://www.y

And I heard you like GIFs?

![Curly repack ox](images/curlyRepackOx.gif)
![Move arg air and each to after drum](images/moveArgAirAndEachToAfterDrum.gif)
![Chuck tail red pipe slice past end of file](images/chuckTailRedPipeSlicePastEndOfFile.gif)
![Curly repack ox](resources/images/curlyRepackOx.gif)
![Move arg air and each to after drum](resources/images/moveArgAirAndEachToAfterDrum.gif)
![Chuck tail red pipe slice past end of file](resources/images/chuckTailRedPipeSlicePastEndOfFile.gif)

## Installation

Expand Down Expand Up @@ -59,7 +59,3 @@ See [contributing](https://www.cursorless.org/docs/contributing/).
## Change Log

See [CHANGELOG.md](CHANGELOG.md).

## Attributions

See [NOTICE.md](NOTICE.md).
4 changes: 2 additions & 2 deletions eslint.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ignoresConfig: ConfigWithExtends = {
ignores: [
// Workspace
".git/**",
"data/playground/**",
"resources/playground/**",
// Packages
"packages/*/out/**",
"packages/*/dist/**",
Expand Down Expand Up @@ -145,7 +145,7 @@ const disabledTypeCheckConfig: ConfigWithExtends = {
"**/vite.config.ts",
"eslint.config.mts",
"prettier.config.cjs",
"typings/**",
"resources/typings/**",
"**/*.js",
"**/*.mjs",
],
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
# https://app.netlify.com/projects/cursorless/deploys

[build]
command = "./scripts/build-and-assemble-website.sh"
command = "./resources/scripts/build-and-assemble-website.sh"
Comment thread
AndreasArvidsson marked this conversation as resolved.
publish = "dist/app-web"
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
},
"pnpm": {
"patchedDependencies": {
"@types/nearley@2.11.5": "patches/@types__nearley@2.11.5.patch",
"nearley@2.20.1": "patches/nearley@2.20.1.patch"
"@types/nearley@2.11.5": "resources/patches/@types__nearley@2.11.5.patch",
"nearley@2.20.1": "resources/patches/nearley@2.20.1.patch"
},
"overrides": {
"@swc/helpers": "^0.5.17",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/app-neovim/scripts/debug-neovim.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REM executing this batch script requires .bat to be registered to be opened by cmd.exe
REM which means no other software has overriden this
nvim -u %CURSORLESS_REPO_ROOT%/init.lua
nvim -u %CURSORLESS_REPO_ROOT%/packages/app-neovim/init.lua
2 changes: 1 addition & 1 deletion packages/app-neovim/scripts/debug-neovim.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export NVIM_NODE_LOG_FILE="${workspaceFolder}/packages/app-neovim/out/nvim_node.
export NVIM_NODE_LOG_LEVEL="info"
export CURSORLESS_MODE="${cursorless_mode}"

command nvim -u "${workspaceFolder}/init.lua"
command nvim -u "${workspaceFolder}/packages/app-neovim/init.lua"
6 changes: 5 additions & 1 deletion packages/app-neovim/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"]
"include": [
"src/**/*.ts",
"src/**/*.json",
"../../resources/typings/**/*.d.ts"
]
}
6 changes: 5 additions & 1 deletion packages/app-talonjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"]
"include": [
"src/**/*.ts",
"src/**/*.json",
"../../resources/typings/**/*.d.ts"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ export default class VscodeHatRenderer {
/**
* Creates an SVG from the hat SVG that pads, offsets and scales it to end up
* in the right size / place relative to the character it will be placed over.
* [This image](../../../../images/svg-calculations.png) may or may not be helpful.
* [This image](../../../../resources/images/svg-calculations.png) may or may not be helpful.
*
* @param fontMeasurements Info about the user's font
* @param shape The hat shape to process
Expand Down
25 changes: 13 additions & 12 deletions packages/app-vscode/src/scripts/populateDist/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type { Asset } from "./Asset";
export const assets: Asset[] = [
{ source: "../../CHANGELOG.md", destination: "CHANGELOG.md" },
{ source: "../../LICENSE", destination: "LICENSE" },
{ source: "../../NOTICE.md", destination: "NOTICE.md" },
{ source: "../../README.md", destination: "README.md" },
{
source: "../lib-cheatsheet-local/out/index.html",
Expand All @@ -15,16 +14,19 @@ export const assets: Asset[] = [
optionalInDev: true,
},
{
source: "../../fonts/cursorless-glyph.svg",
source: "../../resources/fonts/cursorless-glyph.svg",
destination: "fonts/cursorless-glyph.svg",
},
{
source: "../../fonts/cursorless.woff",
source: "../../resources/fonts/cursorless.woff",
destination: "fonts/cursorless.woff",
},
{ source: "../../images/hats", destination: "images/hats" },
{
source: "../../data/fixtures/recorded/tutorial",
source: "../../resources/images/hats",
destination: "images/hats",
},
{
source: "../../resources/fixtures/recorded/tutorial",
destination: "tutorial",
},
{
Expand All @@ -36,7 +38,10 @@ export const assets: Asset[] = [
destination: "media/tutorialWebview.css",
},
{ source: "./images/logo.png", destination: "images/logo.png" },
{ source: "../../images/logo.svg", destination: "images/logo.svg" },
{
source: "../../resources/images/logo.svg",
destination: "images/logo.svg",
},
{
source: "resources/font_measurements.js",
destination: "resources/font_measurements.js",
Expand All @@ -50,12 +55,8 @@ export const assets: Asset[] = [
destination: "resources/installationDependencies.js",
},
{
source: "../../third-party-licenses.csv",
destination: "third-party-licenses.csv",
},
{
source: "../../queries",
destination: "queries",
source: "../../resources/queries",
destination: "resources/queries",
},
{
generateContent: generateBuildInfo,
Expand Down
2 changes: 1 addition & 1 deletion packages/app-vscode/src/scripts/preprocessSvgHats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { promises as fsp, readdirSync } from "node:fs";
import * as path from "node:path";

async function main() {
const directory = path.join(getCursorlessRepoRoot(), "images/hats");
const directory = path.join(getCursorlessRepoRoot(), "resources/images/hats");

const dumper = new parser.XMLBuilder({
ignoreAttributes: false,
Expand Down
6 changes: 5 additions & 1 deletion packages/app-vscode/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src/**/*.ts", "src/**/*.json", "../../typings/**/*.d.ts"]
"include": [
"src/**/*.ts",
"src/**/*.json",
"../../resources/typings/**/*.d.ts"
]
}
2 changes: 1 addition & 1 deletion packages/app-web-docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ This command generates static content into the `out` directory and can be served

### Deploy

After building this site, we copy the output to the `docs` subdir of the staging directory for our website, which is then deployed by Netlify. See the [deploy script](../../scripts/build-and-assemble-website.sh) for more details.
After building this site, we copy the output to the `docs` subdir of the staging directory for our website, which is then deployed by Netlify. See the [deploy script](../../resources/scripts/build-and-assemble-website.sh) for more details.
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function renderFacet(
<Code
link={{
name: "GitHub",
url: `https://github.com/cursorless-dev/cursorless/blob/main/data/fixtures/${fixture.name}.scope`,
url: `https://github.com/cursorless-dev/cursorless/blob/main/resources/fixtures/${fixture.name}.scope`,
}}
languageId={languageId ?? fixture.languageId}
renderWhitespace={renderWhitespace}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If you are adding support for a new language that isn't natively detected by VSC

2. Add an entry pointing to your support table to [the global scope support table](../../../../../packages/lib-common/src/scopeSupportFacets/languageScopeSupport.ts)

3. Create an empty `.scm` file in [`queries/`](../../../../../queries) to hold your parse tree patterns. It should be named after your language, eg `java.scm`.
3. Create an empty `.scm` file in [`resources/queries/`](../../../../../resources/queries) to hold your parse tree patterns. It should be named after your language, eg `java.scm`.

You can file a PR with just these changes to get the ball rolling.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,20 @@ If one of the above facets doesn't apply to your language, you can mark it as `n

We have a bulk test recorder for scope tests. You can use it by running Cursorless in debug mode, and then saying `"cursorless record scope"`, and selecting your language. This will create a temporary file containing slots for every scope facet in your language which you've marked `supported` but that doesn't yet have any tests. You can then fill in the tests for each facet by providing a small snippet of code exemplifying the given facet.

When you're done, say `"cursorless save scope"` to save the tests to the appropriate files in the `data/fixtures/recorded/scopes` directory.
When you're done, say `"cursorless save scope"` to save the tests to the appropriate files in the `resources/fixtures/recorded/scopes` directory.

This step will create partial tests for each of the facets of the given scope. Once you've implemented the scopes in step 5 below, you can automatically update these tests to include the scope ranges, as described in step 6.

## 5. Add parse tree patterns for the given scope

Launch your extension in debug mode and open a file in your language. You can create one or more files in [`playground/`](../../../../../data/playground) and feel free to include those in your PR.
Launch your extension in debug mode and open a file in your language. You can create one or more files in [`playground/`](../../../../../resources/playground) and feel free to include those in your PR.

Then add parse tree patterns for the given scope to your language's `.scm` file in the [`queries` directory](../../../../../queries). The parse tree patterns should match the syntactic constructs that should be considered to be the given scope. Tag the nodes in the parse tree that correspond to the given scope with the internal identifier you found in step 1 above, eg `@namedFunction`. Note that you use the scope identifier (`@namedFunction`), _**not**_ the facet identifier (`@namedFunction.class`).
Then add parse tree patterns for the given scope to your language's `.scm` file in the [`resources/queries` directory](../../../../../resources/queries). The parse tree patterns should match the syntactic constructs that should be considered to be the given scope. Tag the nodes in the parse tree that correspond to the given scope with the internal identifier you found in step 1 above, eg `@namedFunction`. Note that you use the scope identifier (`@namedFunction`), _**not**_ the facet identifier (`@namedFunction.class`).

### Notes / tips

- See our [Tree-sitter query syntax](tree-sitter-query-syntax.md) guide for more information on the syntax we support.
- Look at the existing language definitions in the [`queries` directory](../../../../../queries) for examples.
- Look at the existing language definitions in the [`resources/queries` directory](../../../../../resources/queries) for examples.
- Use the [scope visualizer](../user/scope-visualizer.md) to see your scope highlighted in real time every time you save the `.scm` file.
- Use the command `"parse tree <target>"` to see the parse tree for a given target. For example `"parse tree line"` will show you the parse tree for the current line, as well as all of its ancestors. This will generate a markdown file with parse tree info, which you can then use to write your patterns. You might find it helpful to open a markdown preview of the file.
- You will likely want to look at `node-types.json` for your language, (eg [java](https://github.com/tree-sitter/tree-sitter-java/blob/master/src/node-types.json)). This file is generated from the language's `grammar.js`, which might also be helpful to look at (eg [java](https://github.com/tree-sitter/tree-sitter-java/blob/master/grammar.js)).
Expand Down
Loading
Loading