feat: add support for feature gates#48
Merged
GordonSmith merged 1 commit intobytecodealliance:mainfrom May 29, 2025
Merged
Conversation
fixes: bytecodealliance#34 Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds support for recognizing WIT feature‐gate annotations (@unstable, @since, @deprecated) in both unit/integration tests and the TextMate grammar.
- Introduces new unit tests covering basic and comprehensive feature‐gate usage.
- Adds integration tests and snapshot updates for feature‐gate scenarios.
- Extends
wit.tmLanguage.jsonwith#feature-gateand#feature-gate-contentrules and integrates them into relevant grammar scopes. - Updates VS Code launch configuration to point at the
tests/grammarfolder.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/grammar/unit/feature-gates-test.wit | New unit tests exercising all feature gates |
| tests/grammar/unit/basic-feature-gates.wit | New basic feature-gate unit test |
| tests/grammar/integration/feature-gates.wit | Integration test covering world/interface cases |
| tests/grammar/integration/feature-gates.wit.snap | Updated expected tokenization snapshots |
| syntaxes/wit.tmLanguage.json | Added feature-gate rules and includes |
| .vscode/launch.json | Adjusted test path to tests/grammar |
Comments suppressed due to low confidence (3)
tests/grammar/unit/basic-feature-gates.wit:1
- [nitpick] The test filename
basic-feature-gates.witis inconsistent with the*-test.witsuffix used elsewhere. Consider renaming it tobasic-feature-gates-test.witfor consistency.
// SYNTAX TEST "source.wit" "This tests basic feature gate annotations"
syntaxes/wit.tmLanguage.json:727
- The
#resourcerule'sbeginpattern likely does not allow leading whitespace, so indentedresourcedeclarations inside interfaces or worlds won’t be matched. Consider updating its regex to^\\s*\\b(resource)to handle indentation.
{
"include": "#resource"
},
.vscode/launch.json:16
- [nitpick]
${workspaceRoot}is deprecated in VS Code launch settings. Replace it with${workspaceFolder}to align with current recommendations.
"${workspaceRoot}/tests/grammar"
Contributor
|
🎉 This change has been included in wit-idl-v0.3.4 🎉 The release is available on:
Your release-please bot 🚀🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes: #34