-
Notifications
You must be signed in to change notification settings - Fork 11
Add Bicep language support #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Bicep language support #151
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
Co-authored-by: HerringtonDarkholme <[email protected]>
Co-authored-by: HerringtonDarkholme <[email protected]>
Co-authored-by: HerringtonDarkholme <[email protected]>
|
@copilot please fix a typical Bicep language isn't like It looks like this thing param location string = resourceGroup().location
param storageAccountName string = 'toylaunch${uniqueString(resourceGroup().id)}'
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-05-01' = {
name: storageAccountName
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
properties: {
accessTier: 'Hot'
}
} |
Co-authored-by: HerringtonDarkholme <[email protected]>
Updated the examples to use realistic Bicep code with |
|
I can confirm bicep's identifier name |
|
@copilot please review the code and compare this to other language implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for the Azure Bicep language to ast-grep by integrating the tree-sitter-bicep grammar v1.1.0. Since Bicep doesn't support $ as an identifier character, the implementation uses underscore _ as the expando character for pattern matching, following the same convention as other languages with this constraint (C, C++, SQL, TOML).
Changes:
- Created a new
@ast-grep/lang-biceppackage with standard monorepo structure - Configured underscore as the expando character for Bicep pattern matching
- Added comprehensive documentation and test coverage
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/bicep/package.json | Package configuration with dependencies and scripts |
| packages/bicep/index.js | Language registration module with expando character configuration |
| packages/bicep/nursery.js | Test setup with pattern matching validation |
| packages/bicep/postinstall.js | Standard postinstall script for parser setup |
| packages/bicep/index.d.ts | TypeScript type definitions for language registration |
| packages/bicep/README.md | Usage documentation with Bicep-specific examples |
| packages/bicep/CHANGELOG.md | Initial release changelog entry |
| .changeset/strong-pears-help.md | Changeset for version management |
| pnpm-lock.yaml | Dependency lockfile updates for tree-sitter-bicep v1.1.0 |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reviewed and compared to other language implementations. The Bicep package follows the correct structure and patterns: ✅ All files match other packages (index.js, package.json, nursery.js, index.d.ts, postinstall.js, README.md, CHANGELOG.md) The implementation is complete and ready.
Confirmed. The identifier pattern |
Implements support for Azure Bicep using
tree-sitter-bicepv1.1.0.Implementation
_(underscore)/[a-zA-Z_*][a-zA-Z0-9_]*/-$is invalidtree_sitter_bicepsymbol,.bicepextensionUsage
Users write patterns with
$as usual - ast-grep handles the internal translation to_for Bicep's grammar requirements. Examples use realistic Bicep syntax withparamandresourcedeclarations for Azure infrastructure-as-code scenarios.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.