Skip to content

Commit

Permalink
chore(deps): update dependency tree-sitter-rust to v0.20.4 (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
kieran-ryan authored Jul 14, 2024
1 parent b452811 commit a6401eb
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 62 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"tree-sitter-php": "0.20.0",
"tree-sitter-python": "0.20.4",
"tree-sitter-ruby": "0.19.0",
"tree-sitter-rust": "0.20.1",
"tree-sitter-rust": "0.20.4",
"tree-sitter-typescript": "0.20.5"
},
"devDependencies": {
Expand Down
98 changes: 42 additions & 56 deletions src/language/rustLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,67 +27,53 @@ export const rustLanguage: Language = {
},

defineParameterTypeQueries: [
`
(attribute_item
(meta_item
(identifier) @meta-name
arguments: (meta_arguments
[
(
(meta_item
(identifier) @name-key
value: (string_literal) @name
)
(meta_item
(identifier) @value-key
value: (string_literal) @expression
)
)
(
(meta_item
(identifier) @value-key
value: (string_literal) @expression
)
(meta_item
(identifier) @name-key
value: (string_literal) @name
)
`(attribute_item
(attribute
(identifier) @meta-name
arguments: (token_tree
[
(
(identifier) @name-key
(string_literal) @name
(identifier) @value-key
(string_literal) @expression
)
(
(identifier) @value-key
(string_literal) @expression
(identifier) @name-key
(string_literal) @name
)
]
)
]
)
)
(#eq? @meta-name "param")
(#eq? @name-key "name")
(#eq? @value-key "regex")
) @root
`,
)
(#eq? @meta-name "param")
(#eq? @name-key "name")
(#eq? @value-key "regex")
) @root
`,
],
defineStepDefinitionQueries: [
`
(source_file (attribute_item
(meta_item
(
(identifier) @meta-name
arguments: (meta_arguments
[
(string_literal) @expression
(meta_item
value: (string_literal) @expression)
(meta_item
(identifier)
value: (string_literal) @expression)
(meta_item
value: (raw_string_literal) @expression)
]
`(source_file
(attribute_item
(attribute
(
(identifier) @meta-name
arguments: (token_tree
[
(string_literal) @expression
(identifier)
(string_literal) @expression
(raw_string_literal) @expression
]
)
)
)
(#match? @meta-name "given|when|then")
)
)
)
(#match? @meta-name "given|when|then")
)
(function_item) ) @root
`,
(function_item) ) @root
`,
],

snippetParameters: {
int: { type: 'i32', name: 'i' },
float: { type: 'f32', name: 'f' },
Expand Down

0 comments on commit a6401eb

Please sign in to comment.