From 70bbbd7d193a7928c9b621af9a7e192ef8251f6b Mon Sep 17 00:00:00 2001 From: Joey Hain Date: Fri, 3 Nov 2023 14:21:01 -0700 Subject: add highlight scope for type parameters (#8660) * rust: add highlight scope for type parameters * handle optional type parameters--- runtime/queries/rust/locals.scm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'runtime/queries/rust/locals.scm') diff --git a/runtime/queries/rust/locals.scm b/runtime/queries/rust/locals.scm index 75e5d181..cb75d155 100644 --- a/runtime/queries/rust/locals.scm +++ b/runtime/queries/rust/locals.scm @@ -2,6 +2,12 @@ [ (function_item) + (struct_item) + (enum_item) + (union_item) + (type_item) + (trait_item) + (impl_item) (closure_expression) (block) ] @local.scope @@ -11,8 +17,15 @@ (parameter (identifier) @local.definition) +(type_parameters + (type_identifier) @local.definition) +(constrained_type_parameter + left: (type_identifier) @local.definition) +(optional_type_parameter + name: (type_identifier) @local.definition) + (closure_parameters (identifier) @local.definition) ; References (identifier) @local.reference - +(type_identifier) @local.reference -- cgit v1.2.3-70-g09d2