Skip to content

Commit

Permalink
Merge pull request #102 from GoooIce/main
Browse files Browse the repository at this point in the history
Fix rust snippet template with lowercase
  • Loading branch information
GoooIce authored Oct 7, 2022
2 parents e6579c2 + 68400d9 commit 579bafa
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/language/rustLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const rustLanguage: Language = {
],
defineStepDefinitionQueries: [
`
(attribute_item
(source_file (attribute_item
(meta_item
(
(identifier) @meta-name
Expand All @@ -81,9 +81,10 @@ export const rustLanguage: Language = {
]
)
)
) @root
)
(#match? @meta-name "given|when|then")
)
(function_item) ) @root
`,
],

Expand All @@ -101,10 +102,10 @@ export const rustLanguage: Language = {
'': { type: 'String', name: 'arg' },
},
defaultSnippetTemplate: `
#[{{ keyword }}(expr = "{{ expression }}")]
fn {{ #underscore }}{{ expression }}{{ /underscore }}(world: &mut TheWorld, {{ #parameters }}{{ #seenParameter }}, {{ /seenParameter }}{{ name }}: {{ type }}{{ /parameters }}) {
// {{ blurb }}
}
#[{{ #lowercase }}{{ keyword }}{{ /lowercase }}(expr = "{{ expression }}")]
fn {{ #underscore }}{{ expression }}{{ /underscore }}(world: &mut TheWorld, {{ #parameters }}{{ #seenParameter }}, {{ /seenParameter }}{{ name }}: {{ type }}{{ /parameters }}) {
// {{ blurb }}
}
`,
}

Expand Down

0 comments on commit 579bafa

Please sign in to comment.