Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
bc76520
refactor: drop the extension entry point and build step
johannschopplich Oct 2, 2026
aa71231
chore: upgrade pnpm and the dev dependencies
johannschopplich Oct 2, 2026
a8caffb
feat: add a TextMate grammar for TOON spec 4.1
johannschopplich Oct 2, 2026
1290895
test: check the grammar against spec probes and the decode fixtures
johannschopplich Oct 2, 2026
29f1f44
test: snapshot the tokens of an example document
johannschopplich Oct 2, 2026
09ea6fb
build: ship a files allowlist instead of .vscodeignore
johannschopplich Oct 2, 2026
edd5a3f
ci: cache pnpm through setup-node and bump the actions
johannschopplich Oct 2, 2026
088ebbd
ci: publish to the Marketplace and Open VSX without stored tokens
johannschopplich Oct 2, 2026
8609601
chore: release with bumpp
johannschopplich Oct 2, 2026
9043241
docs: describe the extension as a grammar for TOON spec 4.1
johannschopplich Oct 2, 2026
4b3adf4
chore: add a launch config for the extension host
johannschopplich Oct 2, 2026
615f286
docs: align the contributing guide with the grammar-only setup
johannschopplich Oct 2, 2026
a5bae74
docs: drop the placeholder docs page
johannschopplich Oct 2, 2026
2189afb
docs: trim the README to the port skeleton
johannschopplich Oct 2, 2026
cc874c6
docs: trim CONTRIBUTING.md to setup and pull request rules
johannschopplich Oct 2, 2026
6ab75de
chore: upgrade @toon-format/spec to 4.1.2
johannschopplich Oct 2, 2026
4db87ad
test: load files with node:fs/promises and import.meta.resolve
johannschopplich Oct 2, 2026
e99b4fe
test: snapshot the spec examples instead of a hand-written fixture
johannschopplich Oct 2, 2026
345cb91
chore: drop the declaration options and dist from tsconfig and .gitig…
johannschopplich Oct 2, 2026
988ecff
ci: typecheck the tests
johannschopplich Oct 2, 2026
ede9890
fix(grammar): scope a value that follows the colon without a space
johannschopplich Oct 2, 2026
aa19c18
fix(grammar): scope `[]` in inline arrays as a string
johannschopplich Oct 2, 2026
5869776
fix(grammar): split only inline arrays and rows, on the header's deli…
johannschopplich Oct 2, 2026
4dda0d4
fix(grammar): flag escapes in quoted keys and field names
johannschopplich Oct 2, 2026
dbe16f4
fix(grammar): flag unterminated quoted strings
johannschopplich Oct 2, 2026
c76c69f
feat: indent TOON files with two spaces by default
johannschopplich Oct 2, 2026
5545766
ci: create the GitHub release in a job without OIDC
johannschopplich Oct 2, 2026
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
24 changes: 5 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,18 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v7
with:
persist-credentials: false

- name: Setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v6

- name: Setup Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@v7
with:
node-version: 24

- name: Get pnpm store directory
id: pnpm-cache
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Cache pnpm dependencies
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile
Expand All @@ -52,10 +41,7 @@ jobs:
run: pnpm run lint

- name: Typecheck
run: pnpm run test:types

- name: Build
run: pnpm run build
run: pnpm run typecheck

- name: Test
run: pnpm run test
65 changes: 45 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release + Publish
name: Release

on:
push:
Expand All @@ -7,45 +7,70 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
release:
name: Release
changelog:
runs-on: ubuntu-latest

permissions:
id-token: write
contents: write

steps:
- name: Checkout
uses: actions/checkout@v5
uses: actions/checkout@v7
with:
fetch-depth: 0 # Required for fetching tags and generating release notes
persist-credentials: true

- name: Setup pnpm
uses: pnpm/action-setup@v4
fetch-depth: 0
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v6
uses: actions/setup-node@v7
with:
node-version: 24
cache: pnpm

- name: Generate changelog and create GitHub release
run: npx changelogithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
runs-on: ubuntu-latest
timeout-minutes: 15
# Both registries trust OIDC tokens from this environment only
environment: release
permissions:
contents: read
id-token: write # OIDC for Azure login and Open VSX trusted publishing
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false

- name: Setup pnpm
uses: pnpm/action-setup@v6

# No dependency cache in a job that can mint publishing tokens
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 24

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build extension
run: pnpm run build
- name: Package extension
run: pnpm run package --out toon.vsix

- name: Log in to Azure
uses: azure/login@v3
with:
client-id: ${{ vars.AZURE_CLIENT_ID }}
tenant-id: ${{ vars.AZURE_TENANT_ID }}
subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}

- name: Publish to VS Code Marketplace
run: pnpm run publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: pnpm exec vsce publish --packagePath toon.vsix --azure-credential

- name: Publish to Open VSX
run: pnpm exec ovsx publish toon.vsix --trusted-publishing
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
dist
node_modules
.DS_Store
.env
Expand Down
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Extension",
"type": "extensionHost",
"request": "launch",
"args": ["--extensionDevelopmentPath=${workspaceFolder}"]
}
]
}
13 changes: 0 additions & 13 deletions .vscodeignore

This file was deleted.

102 changes: 12 additions & 90 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,117 +1,39 @@
# Contributing to toon-vscode
# Contributing to the TOON VS Code Extension

Thank you for your interest in contributing to the official Visual Studio Code extension for TOON!
## Development Setup

## Project Setup

This project uses `pnpm` for dependency management and TypeScript for development.
The extension is a TextMate grammar (`syntaxes/toon.tmLanguage.json`) plus a language configuration – there is no build step.

```bash
# Clone the repository
git clone https://github.com/toon-format/vscode.git
cd toon-vscode

# Install dependencies
cd vscode
pnpm install

# Build the extension
pnpm build

# Development mode (watch)
pnpm dev

# Run linting
pnpm test
pnpm lint

# Type check
pnpm test:types
```

## Development Workflow

1. **Fork the repository** and create a feature branch
2. **Make your changes** following the coding standards below
3. **Add tests** for any new functionality
4. **Ensure all checks pass** (lint, type check, build)
5. **Submit a pull request** with a clear description
`test/grammar.test.ts` snapshots the tokens of every `examples/valid` and `examples/conversions` document in `@toon-format/spec`, probes the scopes of cases the examples lack, and runs the spec's decode fixtures. After an intended grammar change, update the snapshots with `pnpm test -u` and review the diff in `test/__snapshots__/`.

## Testing the Extension

To test your changes in VS Code:

1. Open the project in VS Code
2. Press `F5` to launch an Extension Development Host
3. Test your changes in the development instance
4. Check the Debug Console for errors or logs
To try a change in VS Code, press `F5` to launch an Extension Development Host, open a `.toon` file, and run **Developer: Inspect Editor Tokens and Scopes**.

## Coding Standards

### TypeScript

- All code must include TypeScript types
- Use strict mode (configured in `tsconfig.json`)
- Run type checking before committing:
```bash
pnpm test:types
```

### Code Style

- We use ESLint with `@antfu/eslint-config`
- Run before committing:
```bash
pnpm lint
pnpm lint:fix # Auto-fix issues
```

### Node.js Version Support
ESLint runs with `@antfu/eslint-config`. `pnpm lint:fix` fixes what it can.

We target Node.js 24+ to match the main toon repository.
## Pull Requests

## SPEC Compliance

All implementations must comply with the [TOON specification](https://github.com/toon-format/spec/blob/main/SPEC.md).

Before submitting changes that affect TOON format handling:
1. Verify against the official SPEC.md
2. Test with examples from the specification
3. Document any spec version requirements

## Pull Request Guidelines

- **Title**: Use a clear, descriptive title
- **Description**: Explain what changes you made and why
- **Tests**: Include tests or manual testing instructions for your changes
- **Documentation**: Update README or documentation if needed
- **Commits**: Use clear commit messages ([Conventional Commits](https://www.conventionalcommits.org/) preferred)

Your pull request will use our standard template which guides you through the required information.
Add tests or a snapshot update for every grammar change and use [Conventional Commits](https://www.conventionalcommits.org/) for commit messages. The grammar follows [SPEC.md](https://github.com/toon-format/spec/blob/main/SPEC.md) – changes to the format itself belong in [toon-format/spec](https://github.com/toon-format/spec).

## Publishing

Publishing to the Visual Studio Marketplace is handled by the release workflow. Only maintainers can trigger releases.

To package the extension locally:
```bash
pnpm package # Creates a .vsix file
```

## Communication

- **GitHub Issues**: For bug reports and feature requests
- **GitHub Discussions**: For questions and general discussion
- **Pull Requests**: For code reviews and implementation discussion
Maintainers release with `pnpm release`, which bumps the version and pushes a `v*` tag. The release workflow then publishes to the Visual Studio Marketplace and Open VSX. `pnpm package` builds a `.vsix` locally.

## Maintainers

This is a collaborative project. Current maintainers:

- [@VishalRaut2106](https://github.com/VishalRaut2106)
- [@eveiljuice](https://github.com/eveiljuice)
- [@johannschopplich](https://github.com/johannschopplich)

All maintainers have equal and consensual decision-making power. For major architectural decisions, please open a discussion issue first.

## License

By contributing, you agree that your contributions will be licensed under the MIT License.
By contributing, you agree that your contributions are licensed under the MIT License.
Loading
Loading