-
-
Notifications
You must be signed in to change notification settings - Fork 686
Description
Description
This umbrella is part of our efforts to implementing a Grit runtime.
The first goal of this issue is to get to a point where biome search
can make use of the bindings. Not all subtasks necessarily need to be completed to get to that point, though most probably will. We can always continue working on the remaining tasks in parallel to other plugin-related efforts.
Binding status
To use the Grit pattern engine in Biome, we need to make sure the bindings to the engine are implemented. These are effectively traits defined by Grit that need implementation on the Biome side. These are:
- ✅
Node
binding: chore: implement Grit node bindings #2697 - ✅
NodePattern
andLeafNodePattern
bindings: chore(grit): implement Grit snippet bindings #3162 - ✅
ExecContext
binding ⚠️ Binding
binding (no pun intended :))- Since fix(grit): equivalence tests + minor fixes #3595, there are no more
todo!()
s left. However, there are still dummy implementations related to specific features that are listed below.
- Since fix(grit): equivalence tests + minor fixes #3595, there are no more
- ✅
CodeSnippet
binding: fix(grit): add code snippet bindings #3601 ⚠️ ResolvedPattern
binding- Since fix(grit): resolve
todo!
()s ingrit_resolved_pattern.rs
#3603, there are no moretodo!()
s left. However, there are still dummy implementations related to specific features that are listed below.
- Since fix(grit): resolve
⚠️ Language
binding- Only JS/TS so far.
- Padding still needs implementation. See
todo!()
s ingrit_target_language.rs
. - We need to provide TreeSitter-compatible node and field (slot) names. Probably need to investigate how to generate these definitions from TreeSitter grammar files, together with our
.ungram
files. SeeTODO
comments injs_target_language.rs
.
- ✅
File
binding - ✅
Tree
binding
Feature status
Apart from the bindings, we can also identify which features still need implementation:
- ✅ Integrate Biome parsers into Grit bindings (only JS/TS so far)
- ✅ Compile Grit CST to patterns
- ✅ Implement matching engine
- ✅ Implement variables and scopes: feat(grit): implement variable matching #3575
- ⌛️ Comment support
- Some parts are implemented as part of the bindings, but this is entirely untested still.
- ✅ Pattern, predicate and function definitions: feat(grit): support for Grit pattern, predicate and function definitions #3983
- ✅ Auto-wrapping patterns
- 🚫 Rewrites
- The operator works and effects are being produced, but we don't apply them yet. See TODO comment in
grit_context.rs
- The operator works and effects are being produced, but we don't apply them yet. See TODO comment in
- ✅ Leaf node normalization: fix(grit): leaf node normalization #3448
⚠️ Implement built-in Grit functions- Note that Biome doesn't support JS functions inside GritQL
- 🚫 Suppressions
- Grit has its own implementation for suppressions: https://docs.grit.io/guides/config#inline-suppression We probably want to do something that works with Biome's suppression system instead.
- 🚫
multifile
pattern handling - 🚫
sequential
pattern handling - 🚫 Snippet alignment and padding
- 🚫 Compatibility with the Grit pattern library
Legend
Icon | Meaning |
---|---|
✅ | Supported |
🚫 | Not in progress |
⌛️ | In progress |
Partially supported (with some caveats) |
How to Contribute
Everyone is welcome to contribute pieces here! If you'd like to tackle something, please leave a comment below this issue for which item(s) of the checklist below you'd like to pick up. We will create a separate issue and assign it to you to simplify tracking.
If you need any help or have any questions about our plugin efforts in Biome, feel free to ask in the #plugins
channel in Discord.
Funding
To support this effort, please consider sponsoring Biome within our Open Collective or GitHub sponsorship.
We decide not to fund this issue with Polar.sh because it is a long term effort. Polar.sh is designed for short and medium term efforts. It sets a deadline of 6 months to complete a task.