Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
722b5ea
[spr] initial version
haberdashPI Jul 12, 2025
7544022
implementing `merge`
haberdashPI Jul 13, 2025
9e41878
wip command `foreach` and `merge`
haberdashPI Jul 15, 2025
27ef0b9
working default tests, rust refactor roadmap
haberdashPI Jul 15, 2025
5cde003
refactor command code
haberdashPI Jul 15, 2025
c8c9246
working merge
haberdashPI Jul 15, 2025
fb69f99
more coverage
haberdashPI Jul 16, 2025
41f1e4c
wip test coverage
haberdashPI Jul 16, 2025
dfa7b09
working coverage output from rust
haberdashPI Jul 18, 2025
f162596
sketch of constraining `finalKey` for `master-key.prefix`
haberdashPI Jul 18, 2025
860a44a
wip error handling refactor and foreach key expansion
haberdashPI Jul 21, 2025
402e111
wip refactoring to handle span information
haberdashPI Jul 26, 2025
c0dad48
notes
haberdashPI Jul 26, 2025
a0a1c1f
preliminary file processing pipeline skeleton
haberdashPI Jul 29, 2025
1fd3d74
pipeline can be run from typescript command
haberdashPI Jul 29, 2025
8dbc2f9
tweaks
haberdashPI Jul 31, 2025
cdc4241
updated larkin bindings to aspirational format
haberdashPI Jul 31, 2025
08af0f9
working error reporting in javascript
haberdashPI Jul 31, 2025
98b8849
error reporting cleanup
haberdashPI Aug 1, 2025
711c271
larkin updates
haberdashPI Aug 1, 2025
8fcd402
wip `define` field
haberdashPI Aug 1, 2025
1a41ca8
constructor for `define`
haberdashPI Aug 1, 2025
a6c74a6
`define` wip
haberdashPI Aug 3, 2025
2dfbb57
integrated `define` into `file`
haberdashPI Aug 4, 2025
a9b5af6
define generic variable expansion
haberdashPI Aug 5, 2025
e79c33d
working foreach variable expansion
haberdashPI Aug 6, 2025
1e57d75
poc for define variable resolution
haberdashPI Aug 13, 2025
8d9cefb
basic unit tests for `define` working
haberdashPI Aug 13, 2025
3d342f3
wip variable resolution for `define`
haberdashPI Aug 13, 2025
4431439
basic variable resolution for `define` is working
haberdashPI Aug 13, 2025
99d888e
`define` variable exapnsion wip
haberdashPI Aug 16, 2025
a8bb8ed
working `deinfe` tests
haberdashPI Aug 16, 2025
8b1f266
plan for refactoring `define` expansion
haberdashPI Aug 18, 2025
0013682
wip expression evaluation
haberdashPI Aug 21, 2025
e0ba618
`bind` tests working again
haberdashPI Aug 30, 2025
f323d81
wip debug binding resolution
haberdashPI Aug 31, 2025
3e7caa3
compiled `define` processing
haberdashPI Sep 2, 2025
22e4182
first define test passing
haberdashPI Sep 2, 2025
270d00b
working basic parsing for keyFile
haberdashPI Sep 3, 2025
a572b89
wip expression evaluation
haberdashPI Sep 6, 2025
6ad50b7
simple expression evaluation working
haberdashPI Sep 7, 2025
de71085
foreach error shows proper span
haberdashPI Sep 8, 2025
57a0c48
design of `all_modes_but` function
haberdashPI Sep 8, 2025
84cfeb5
mostly working pipeline for `bind` and `define` parsing
haberdashPI Sep 10, 2025
e42b152
unit tests: file parsing reports errors in open file
haberdashPI Sep 10, 2025
43901ca
wip refactoring/documentation
haberdashPI Sep 13, 2025
fb2fbe1
updated documentation and doc build
haberdashPI Sep 14, 2025
249bd6e
wip error propagation refactoring
haberdashPI Sep 15, 2025
5933f25
cleanup error propagation
haberdashPI Sep 20, 2025
cd00f67
cleanup / update notes
haberdashPI Sep 20, 2025
32184e8
added `tags` field to `[[bind]]`
haberdashPI Sep 20, 2025
37a6e75
support `skipWhen` in `runCommands` items
haberdashPI Sep 20, 2025
170c0cd
cleanup compiler warnings
haberdashPI Sep 20, 2025
9991040
better errors for expressions
haberdashPI Sep 24, 2025
d4ab532
working tests for expression errors
haberdashPI Sep 25, 2025
2b11a48
`foreach` supports expression evaluation, `define.val` works at readtime
haberdashPI Sep 25, 2025
3b440f8
working `[[mode]]` section
haberdashPI Sep 30, 2025
9e4db64
`combined` doc fields moved
haberdashPI Sep 30, 2025
e0dade0
command normalization at runtime
haberdashPI Oct 1, 2025
c5b54f2
`finalKey` validation
haberdashPI Oct 1, 2025
e5c2a64
bare-key handling tests
haberdashPI Oct 2, 2025
48ee91e
working method to generate keybinding.json output
haberdashPI Oct 4, 2025
92b9701
update notes
haberdashPI Oct 4, 2025
6b20153
working `all_prefixes`
haberdashPI Oct 5, 2025
3ff16c7
checks for legacy file format
haberdashPI Oct 6, 2025
f42d407
implemented `kind`
haberdashPI Oct 7, 2025
5c1ea65
header / file directives
haberdashPI Oct 9, 2025
b92e685
prefix refactored
haberdashPI Oct 10, 2025
ac4c767
fix prefix unit tests, update docs
haberdashPI Oct 11, 2025
d50e51f
remove incorrect line positions from rhai script error messages
haberdashPI Oct 12, 2025
0d9059f
add additional legacy warning checks
haberdashPI Oct 12, 2025
177fb4d
rename constant
haberdashPI Oct 12, 2025
da9bbd0
wip: error checking improvements
haberdashPI Oct 13, 2025
8170c5b
fixed some tests, added check for `keys` regex error
haberdashPI Oct 15, 2025
ce8fd3e
key binding validation tested
haberdashPI Oct 15, 2025
4e2e709
tests for all identified error conditions
haberdashPI Oct 17, 2025
91d6bdb
removed errant profile txt file
haberdashPI Oct 17, 2025
926798d
working linting integration tests
haberdashPI Oct 18, 2025
94d298e
cleanup mode.whenNoBinding parsing
haberdashPI Oct 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- main
tags:
- v[0-9]+.[0-9]+.[0-9]+*
paths:
- src/**

pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize', 'ready_for_review']

Expand Down Expand Up @@ -44,7 +47,9 @@ jobs:
run: pnpm install --frozen-lockfile && pnpm exec playwright install chromium
- name: Unit Tests
env: { COVERAGE: 'true' }
run: mise test${{ matrix.environment }}
run: |
mise test${{ matrix.environment }}
mise test-rust
- name: Integration Tests
if: matrix.environment == ''
env: { COVERAGE: 'true' }
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
!.vscode/settings.json

# build output
out
*.vsix
Expand All @@ -8,8 +10,12 @@ node_modules

# code coverage
.nyc_output/**
*.info
*.profdata
coverage/**
coverage.json
*.profraw
*.lcov

# unit testing
test/temp/**
Expand Down
18 changes: 10 additions & 8 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"connor4312.esbuild-problem-matchers",
"ms-vscode.extension-test-runner",
"ms-playwright.playwright",
]
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"connor4312.esbuild-problem-matchers",
"ms-vscode.extension-test-runner",
"ms-playwright.playwright",
"rust-lang.rust-analyzer",
"hverlin.mise-vscode",
]
}
4 changes: 3 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--profile",
"debug",
"master-key-debug",
"--install-extension",
"tamasfe.even-better-toml"
],
"outFiles": [
"${workspaceFolder}/out/node/**/*.js"
Expand Down
34 changes: 34 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"eslint.validate": [
"javascript",
"javascriptreact",
"yaml",
"github-actions-workflow" // for GitHub Actions workflow files
],
"rust-analyzer.linkedProjects": [
"src/rust/parsing/Cargo.toml"
],
"window.title": "vscode-master-key",
// NOTE: if we update the version of rust used in `mise.toml.` these
// paths also need to be updated
"rust-analyzer.cargo.sysroot": "${userHome}/.rustup/toolchains/1.90.0-aarch64-apple-darwin",
"rust-analyzer.cargo.sysrootSrc": "${userHome}/.rustup/toolchains/1.90.0-aarch64-apple-darwin/lib/rustlib/src/rust",
"rust-analyzer.checkOnSave": true,
"rust-analyzer.cargo.allTargets": false,
"rust-analyzer.cargo.buildScripts.rebuildOnSave": true,
"workbench.colorCustomizations": {
"iLoveWorkSpaceColors": false,
"iLoveWorkSpaceRandom": false,
"useWorkspaceLite": false
},
"debug.javascript.defaultRuntimeExecutable": {
"pwa-node": "/Users/davidlittle/.local/share/mise/shims/node"
},
"files.watcherExclude": {
"**/.git/**": true,
"**/.jj/**": true,
"**/target/**": true,
"out/**": true,
},
"python.defaultInterpreterPath": "${userHome}/.local/share/mise/installs/python/3.10.4/bin/python",
}
36 changes: 18 additions & 18 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@
}
]
},
{
"applyTo": "allDocuments",
"source": "tsc",
"fileLocation": "relative",
"pattern": [
{
"regexp": "^\\[lint\\]\\s+([0-9]+):([0-9]+)\\s*([a-z]+)\\s*(.*)$",
"line": 1,
"column": 2,
"severity": 3,
"message": 4
},
{
"regexp": "^\\[lint\\]\\s(.*\\ts)\\s*$",
"file": 1,
}
]
},
{
"applyTo": "allDocuments",
"base": "$esbuild",
Expand All @@ -40,24 +58,6 @@
}
}
},
{
"applyTo": "closedDocuments",
"source": "eslint",
"fileLocation": "absolute",
"pattern": [
{
"regexp": "^\\[lint\\]\\s(.*)$",
"file": 1,
},
{
"regexp": "^\\[lint\\]\\s+([0-9]+):([0-9]+)\\s+([a-z]+)\\s+(.*)$",
"line": 1,
"code": 2,
"severity": 3,
"message": 4
}
]
},
],
"isBackground": true,
"label": "npm: watch:esbuild",
Expand Down
5 changes: 1 addition & 4 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
.vitepress/commands.mjs
commands/*
.vitepress/bindings.mjs
bindings/*
expressions/*
guide.md
.vitepress/dist/**
**/*.md
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default defineConfig([
'src/rust/parsing/lib/**/*.{js,ts,t.ds}',
'out/**/*.js',
'src/oldtest/**',
'src/oldparsing/**',
'docs/.vitepress/theme/**/*.{js,ts,t.ds}',
]),
{
Expand Down
143 changes: 97 additions & 46 deletions mise.toml
Original file line number Diff line number Diff line change
@@ -1,40 +1,81 @@
[tools]
"cargo:wasm-pack" = "0.13.1"
node = "20"
"npm:pnpm" = "10.12.4"
"npm:typescript" = "5.8.3"
"npm:vsce" = "2.15"
rust = { version = "1.87", targets = "wasm32-unknown-unknown" }
watchexec = "2.3.2"
"ubi:haberdashpi/simple-src-docs" = "0.6.0"
"npm:c8" = "latest"
"npm:http-server" = "14.1.1"
"npm:pnpm" = "10.13.1"
"ubi:haberdashpi/simple-src-docs" = "0.6.0"
watchexec = "2.3.2"
rust = { version = "1.90", targets = "wasm32-unknown-unknown", component = "llvm-tools-preview" }
"cargo:wasm-pack" = "0.13.1"
"cargo:cargo-binutils" = "0.3.6"
"cargo:rustfilt" = "latest"
"cargo:nu" = "latest"

[hooks]
postinstall = ['pnpm install --frozen-lockfile', 'pnpm exec playwright install chromium']
postinstall = [
'pnpm install --frozen-lockfile',
'pnpm exec playwright install chromium',
'rustup toolchain install nightly -c llvm-tools-preview', # needed to compute test coverage
'rustup add target wasm32-unknown-unknown', # mise doesn't seem to install this automatically
]

[tasks.lint]
run = 'pnpm exec eslint src'

[tasks.check-types]
run = 'tsc --noEmit --project tsconfig.json'

# [tasks.build-rust]
# sources = ['src/rust/parsing/src/**/*.rs', 'src/rust/parsing/Cargo.toml']
# outputs = ['out/**/*.wasm', 'src/rust/parsing/lib/*']
# dir = 'src/rust/parsing'
# run = [
# 'wasm-pack build --target web --out-dir lib',
# 'cp lib/parsing_bg.wasm ../../../out/parsing_bg.wasm',
# ]
# TODO: maybe consider using colons and figure out mise task hierarchies???
[tasks.build-rust]
dir = 'src/rust/parsing'
sources = ['src/**/*.rs', 'Cargo.toml']
outputs = ['lib/*']
run = [
'wasm-pack build --target web --out-dir lib',
'mkdir -p ../../../out',
'cp lib/parsing_bg.wasm ../../../out/parsing_bg.wasm',
]

[vars]
coverage_options = '''--ignore-filename-regex '/.cargo/registry' --ignore-filename-regex '.rustup/toolchains' --ignore-filename-regex 'rustc/' --compilation-dir src/rust/parsing --instr-profile coverage/parsing.profdata --Xdemangler rustfilt'''

[tasks.test-rust]
dir = 'src/rust/parsing'
shell = 'nu -c'
env.RUST_BACKTRACE = "1"
run = '''
def main [...args] {
if ($env.COVERAGE? | default false | into bool) {
$env.RUSTFLAGS = '-C instrument-coverage'
$env.LLVM_PROFILE_FILE = 'coverage/parsing.profraw'

let object_files = cargo +nightly test --tests --no-run --message-format=json |
from json -o | where profile?.test |
get filenames.0 |
each { |f| $'--object=($in)' }

cargo +nightly test --tests ...$args -- --nocapture
cargo +nightly profdata -- merge -sparse coverage/parsing.profraw -o coverage/parsing.profdata
(cargo +nightly cov -- export {{vars.coverage_options}} --format=lcov ...($object_files) o>
coverage/parsing.info)

cargo +nightly cov -- report --use-color {{vars.coverage_options}} ...($object_files)
} else {
cargo test ...$args -- --nocapture
}
}
main
'''

[tasks.build]
depends = ['check-types', 'lint'] #, 'build-rust']
depends = ['check-types', 'lint', 'build-rust']
sources = ['src/**/*.ts']
run = ['pwd', 'node esbuild.mjs']
run = 'node esbuild.mjs'

[tasks.package]
depends = ['check-types', 'lint'] #, 'build-rust']
depends = ['check-types', 'lint', 'build-rust']
sources = ['src/**/*.ts']
run = [
'node esbuild.mjs --release',
Expand All @@ -50,15 +91,16 @@ run = 'tsc -p src/test --outDir out/test'

[tasks.test]
depends = ['build-tests']
shell = 'bash -c'
shell = 'nu -c'
run = '''
if $COVERAGE; then
pnpm exec vscode-test --config .vscode-test.mjs --extensionDevelopmentPath=. \
--version=insiders --coverage --coverage-output=coverage/unit \
--coverage-reporter=json
else
pnpm exec vscode-test --config .vscode-test.mjs --extensionDevelopmentPath=. --version=insiders
fi
if ($env.COVERAGE? | default false | into bool) {
(pnpm exec vscode-test --config .vscode-test.mjs --extensionDevelopmentPath .
--version insiders --coverage --coverage-output coverage/unit
--coverage-reporter json)
} else {
(pnpm exec vscode-test --config .vscode-test.mjs --extensionDevelopmentPath .
--version=insiders)
}
'''

[tasks.test-web]
Expand All @@ -72,39 +114,48 @@ depends = ['build --web']
run = 'pnpm exec vscode-test-web --extensionDevelopmentPath=.'

[tasks.assemble-coverage]
run = [
'c8 --temp-directory coverage/integration/tmp/ report -r json -o coverage/integration/',
'''
pnpm exec istanbul-merge --out coverage/merged/coverage-final.json \
coverage/integration/coverage-final.json coverage/unit/coverage-final.json
''',
'''
pnpm exec nyc report -t coverage/merged --report-dir coverage -r lcov -r text \
--exclude node_modules --exclude out --exclude .vscode-test \
--exclude src/test
''',
]
shell = 'nu -c'
run = '''
c8 --temp-directory coverage/integration/tmp/ report -r json -o coverage/integration/',
(pnpm exec istanbul-merge --out coverage/merged/coverage-final.json
coverage/integration/coverage-final.json coverage/unit/coverage-final.json)
(pnpm exec nyc report -t coverage/merged --report-dir coverage -r lcov
--exclude node_modules --exclude out --exclude .vscode-test
--exclude src/test)
mv coverage/lcov.info coverage/ts_coverage.info'

cat coverage/*_coverage.info o> coverage/lcov.info
lcov-summary coverage/lcov.info
'''

[tasks.test-integration]
depends = ['build', 'build-tests']
run = 'pnpm exec playwright test'

[tasks.extract-docs]
sources = ['README.md', 'src/extension/**/*.ts', 'docs/templates/**/*.md']
outputs = { auto = true }
run = 'simple-src-docs -d docs src README.md docs/templates'
sources = ['README.md', 'src/extension/**/*.ts', 'src/rust/**/*.rs', 'src/docs/**/*.md']
outputs = ['docs/**/*.md']
run = ['simple-src-docs -d docs src README.md', 'cp src/docs/index.md docs/']

[tasks.dev-docs]
depends = ['extract-docs']
run = 'pnpm exec vitepress dev docs'

[tasks.build-docs]
sources = [
'docs/index.md',
'docs/guide.md',
'docs/bindings/**/*.md',
'docs/commands/**/*.md',
]
sources = ['docs/**/*.md']
outputs = ['docs/.vitepress/dist/**/*']
depends = ['extract-docs']
run = 'pnpm exec vitepress build docs'

[tasks.clean-docs]
shell = 'nu -c'
run = '''
let to_remove = glob docs/**/*.md
if not ($to_remove | is-empty) {
rm ...$to_remove
}
'''

[tasks.report-coverage]
depends = ['test --coverage', 'test-integration']
run = ['c8 report -r html', 'http-server coverage']
Loading