GNU bug report logs -
#61302
29.0.60; rust-ts-mode does not show function-invocation on field-properties
Previous Next
Reported by: jostein <at> kjonigsen.net
Date: Sun, 5 Feb 2023 20:16:01 UTC
Severity: normal
Found in version 29.0.60
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On 13/02/2023 21:57, Dmitry Gutov wrote:
> I didn't bother with assignments for now (in the absence of feature
> requests), but they should be even easier to add.
E.g. like this:
diff --git a/lisp/progmodes/rust-ts-mode.el b/lisp/progmodes/rust-ts-mode.el
index 5c71a8ad461..f105c894b28 100644
--- a/lisp/progmodes/rust-ts-mode.el
+++ b/lisp/progmodes/rust-ts-mode.el
@@ -163,11 +163,15 @@ rust-ts-mode--font-lock-settings
(macro_definition "macro_rules!" @font-lock-constant-face)
(macro_definition (identifier) @font-lock-preprocessor-face)
(field_declaration name: (field_identifier) @font-lock-property-face)
- (parameter) @rust-ts-mode--fontify-pattern
- (let_declaration) @rust-ts-mode--fontify-pattern
- (for_expression) @rust-ts-mode--fontify-pattern
- (let_condition) @rust-ts-mode--fontify-pattern
- (match_arm) @rust-ts-mode--fontify-pattern)
+ (parameter pattern: (_) @rust-ts-mode--fontify-pattern)
+ (let_declaration pattern: (_) @rust-ts-mode--fontify-pattern)
+ (for_expression pattern: (_) @rust-ts-mode--fontify-pattern)
+ (let_condition pattern: (_) @rust-ts-mode--fontify-pattern)
+ (match_arm pattern: (_) @rust-ts-mode--fontify-pattern))
+
+ :language 'rust
+ :feature 'assignment
+ '(((assignment_expression left: (_) @rust-ts-mode--fontify-pattern)))
:language 'rust
:feature 'function
@@ -261,7 +265,7 @@ 'rust-ts-mode--fontify-pattern
(treesit-available-p)
`(lambda (node override start end &rest _)
(let ((captures (treesit-query-capture
- (treesit-node-child-by-field-name node "pattern")
+ node
,(treesit-query-compile 'rust '((identifier) @id
(shorthand_field_identifier) @id)))))
(pcase-dolist (`(_name . ,id) captures)
@@ -343,7 +347,7 @@ rust-ts-mode
'(( comment definition)
( keyword string)
( attribute builtin constant escape-sequence
- number type)
+ number type assignment)
( bracket delimiter error function operator property
variable)))
;; Imenu.
This bug report was last modified 2 years and 91 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.