Skip to content

feat(tree-sitter): add tree-sitter devcontainer feature#4

Merged
pocky merged 1 commit into
mainfrom
feat/tree-sitter
Feb 26, 2026
Merged

feat(tree-sitter): add tree-sitter devcontainer feature#4
pocky merged 1 commit into
mainfrom
feat/tree-sitter

Conversation

@pocky
Copy link
Copy Markdown
Contributor

@pocky pocky commented Feb 26, 2026

Summary

  • Add tree-sitter as a new devcontainer feature, enabling consistent CLI installation and optional grammar compilation inside containers
  • Support multiple grammar options (none, PHP, all) to cover common use cases without requiring full recompilation
  • Add test infrastructure with scenario-based validation, ensuring compatibility with Ubuntu LTS (GLIBC 2.35+) base images
  • Extend test-local.sh with --base-image flag to support per-feature base image overrides during local testing

Changes

Feature: tree-sitter

  • src/tree-sitter/devcontainer-feature.json: Feature metadata with version and grammars options (none/php/all)
  • src/tree-sitter/install.sh: Installation script that downloads the tree-sitter CLI binary and conditionally compiles requested grammars

Tests: tree-sitter

  • test/tree-sitter/test.sh: Base test suite verifying CLI is installed and functional
  • test/tree-sitter/scenarios.json: Scenario configuration defining three test variants
  • test/tree-sitter/base-image.txt: Pins tests to mcr.microsoft.com/devcontainers/base:ubuntu to ensure GLIBC compatibility with tree-sitter binaries
  • test/tree-sitter/install_tree_sitter_latest.sh: Scenario script for CLI-only installation
  • test/tree-sitter/install_tree_sitter_with_php.sh: Scenario script validating PHP grammar compilation
  • test/tree-sitter/install_tree_sitter_with_all_grammars.sh: Scenario script validating all grammars compilation

Test Infrastructure

  • test-local.sh: Add --base-image flag support to allow overriding the base image at invocation time, falling back to per-feature base-image.txt configuration

Test plan

  • Run ./test-local.sh tree-sitter and verify all three scenarios pass
  • Run ./test-local.sh --base-image mcr.microsoft.com/devcontainers/base:ubuntu tree-sitter and confirm CLI flag override works
  • Verify tree-sitter --version succeeds inside a container built with the feature
  • Verify PHP grammar .so file is present when grammars=php option is set

Generated with awf commit workflow

- `src/tree-sitter/devcontainer-feature.json`: Add feature metadata with grammar options
- `src/tree-sitter/install.sh`: Add installation script with conditional grammar compilation
- `test-local.sh`: Add --base-image flag support with default ubuntu base
- `test/tree-sitter/base-image.txt`: Set compatible ubuntu base image for GLIBC requirements
- `test/tree-sitter/test.sh`: Add base test suite for feature validation
- `test/tree-sitter/scenarios.json`: Add test scenarios configuration
- `test/tree-sitter/install_tree_sitter_latest.sh`: Add CLI-only test scenario
- `test/tree-sitter/install_tree_sitter_with_php.sh`: Add PHP grammar compilation test
- `test/tree-sitter/install_tree_sitter_with_all_grammars.sh`: Add all-grammars test scenario
@pocky pocky marked this pull request as ready for review February 26, 2026 13:02
@pocky pocky merged commit 08a3f59 into main Feb 26, 2026
4 checks passed
@pocky pocky deleted the feat/tree-sitter branch February 26, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant