gitnexus 1.6.6-rc.148 → 1.6.6-rc.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -133,11 +133,34 @@ const RUST_SCOPE_QUERY = `
|
|
|
133
133
|
name: (identifier) @reference.name)) @reference.call.free
|
|
134
134
|
|
|
135
135
|
;; References — constructor calls (struct literal)
|
|
136
|
-
;;
|
|
137
|
-
;; (
|
|
138
|
-
;;
|
|
136
|
+
;; tree-sitter-rust gives struct_expression.name one of three node types
|
|
137
|
+
;; (type_identifier | scoped_type_identifier | generic_type_with_turbofish);
|
|
138
|
+
;; the turbofish form additionally nests either a type_identifier or a
|
|
139
|
+
;; scoped_identifier. We enumerate all four shapes below so the capture is
|
|
140
|
+
;; always the trailing identifier (resolved scope-aware), not the full path:
|
|
141
|
+
;; bare Foo {}
|
|
142
|
+
;; scoped foo::bar::Baz {}
|
|
143
|
+
;; turbofish Foo::<T> {}
|
|
144
|
+
;; scoped+turbofish foo::Bar::<T> {}
|
|
139
145
|
(struct_expression
|
|
140
|
-
name: (
|
|
146
|
+
name: (type_identifier) @reference.name) @reference.call.constructor
|
|
147
|
+
|
|
148
|
+
;; Scoped struct (foo::bar::Baz {})
|
|
149
|
+
(struct_expression
|
|
150
|
+
name: (scoped_type_identifier
|
|
151
|
+
name: (type_identifier) @reference.name)) @reference.call.constructor
|
|
152
|
+
|
|
153
|
+
;; Turbofish struct (Foo::<T> {})
|
|
154
|
+
(struct_expression
|
|
155
|
+
name: (generic_type_with_turbofish
|
|
156
|
+
type: (type_identifier) @reference.name)) @reference.call.constructor
|
|
157
|
+
|
|
158
|
+
;; Scoped + turbofish struct (foo::Bar::<T> {}) — the turbofish wraps a
|
|
159
|
+
;; scoped_identifier whose tail is an identifier (not a type_identifier).
|
|
160
|
+
(struct_expression
|
|
161
|
+
name: (generic_type_with_turbofish
|
|
162
|
+
type: (scoped_identifier
|
|
163
|
+
name: (identifier) @reference.name))) @reference.call.constructor
|
|
141
164
|
|
|
142
165
|
;; References — macro invocations (disjoint namespace from functions)
|
|
143
166
|
;; Resolved via MacroRegistry → Macro defs only (never fn of the same name).
|
package/package.json
CHANGED