VS Code just-syntax extension



VS Code extensions for syntax highlighting Just command runner files.
Usage
Binds to [*.]justfile|*.just files.
Development
References
Build
What's in the folder
- This folder contains all of the files necessary for the extension.
syntaxes/just.tmLanguage.yaml - this is the Text mate grammar file that is used for tokenization.
language-configuration.json - this is the language configuration, defining the tokens that are used for comments and brackets.
test/*.just - sample files, opened by the F5 launch configuration and used as snapshot test inputs.
test/*.just.snap - committed snapshots of the scopes produced by the grammar for each sample file.
Get up and running straight away
npm install
- Make sure the language configuration settings in
language-configuration.json are accurate.
- Press
F5 to open a new window with the extension loaded and a couple of test files opened.
- Verify that syntax highlighting works and that the language configuration settings are working.
Make changes
- You can relaunch the extension from the debug toolbar after making changes to the files listed above.
- You can also reload (
Ctrl+R or Cmd+R on Mac) the VS Code window with the extension to load your changes.
Install your extension
- To start using the extension with VS Code, copy it into the
<user home>/.vscode/extensions folder and restart VS Code.
Test
The grammar is tested with snapshot tests from vscode-tmgrammar-test.
Each test/*.just file is tokenized and the result is compared with its test/*.just.snap file.
Both commands compile the grammar first.
just test
# or
npm test
- After an intended grammar change, regenerate the snapshots, review the diff and commit the
.snap files with the grammar change
just test-update
# or
npm run test:update
Embedded languages (shell, Python, JavaScript, ...) are not loaded during tests, so the runner prints grammar not found warnings and snapshots only contain Just scopes and meta.embedded.block.*.
Publish
just version [major|minor|patch]
# or
npm version [major|minor|patch] --no-git-tag-version
- Update
CHANGELOG.md
- Push changes upstream
- Create a tag
just tag
# or
git tag -a $(cat package.json | jq '.version' | cut -d '"' -f 2)
git push --tags
just package
# or
npx @vscode/vsce package
just publish-vsmarket
just publish-ovsx
# or
npx @vscode/vsce publish --packagePath <file>
npx ovsx publish --packagePath <file>