Skip to content

Commit

Permalink
fix(grit): add code snippet bindings (#3601)
Browse files Browse the repository at this point in the history
  • Loading branch information
arendjr authored Aug 6, 2024
1 parent 47cc739 commit a38960e
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions crates/biome_grit_patterns/src/grit_code_snippet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ pub struct GritCodeSnippet {

impl CodeSnippet<GritQueryContext> for GritCodeSnippet {
fn patterns(&self) -> impl Iterator<Item = &Pattern<GritQueryContext>> {
TodoIterator { _snippet: self }
self.patterns.iter().map(|p| &p.1)
}

fn dynamic_snippet(&self) -> Option<&DynamicPattern<GritQueryContext>> {
todo!()
self.dynamic_snippet.as_ref()
}
}

Expand Down Expand Up @@ -55,16 +55,3 @@ impl PatternName for GritCodeSnippet {
"CodeSnippet"
}
}

#[derive(Clone)]
struct TodoIterator<'a> {
_snippet: &'a GritCodeSnippet,
}

impl<'a> Iterator for TodoIterator<'a> {
type Item = &'a Pattern<GritQueryContext>;

fn next(&mut self) -> Option<Self::Item> {
todo!()
}
}

0 comments on commit a38960e

Please sign in to comment.