bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61302: 29.0.60; rust-ts-mode does not show function-invocation on fi


From: Dmitry Gutov
Subject: bug#61302: 29.0.60; rust-ts-mode does not show function-invocation on field-properties
Date: Sun, 19 Feb 2023 02:13:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 19/02/2023 01:31, Randy Taylor wrote:

Fix one bug, introduce another 😉.

Any use declaration tail (I guess that's the lingo we're using?) should not 
have a face applied to it if it's lowercase.

I guess we do. Unless you have better naming suggestions ;-)

For example:
```
use deeply::nested::function as other_function;
```
function should not have any face applied to it.

```
use a::b::{C, d, e::F, g::h::I, g::h::i};
```
i should not have any face applied to it.

Only if they are capitalized should we give them a face: font-lock-type-face.
As it stands now, they are all font-lock-constant-face.

The previous patch was perfect except for the missing use_as_clause queries - 
if I add those back, I think everything is good unless I'm missing something.

Thanks for catching that, I missed one treesit-node-parent call when inlining a function.

The variable feature is highlighting some things incorrectly (it was before 
too, but I think it's a little worse now).
Adding these to rust-ts-mode--variable-p takes care of the issues that I see.
`((equal "extern_crate_declaration" parent-type) nil) ((equal "lifetime" parent-type) nil) ((equal 
"scoped_type_identifier" parent-type) nil) ((equal "use_as_clause" parent-type) nil) ((equal 
"use_list" parent-type) nil)`

This should be taken care of by the new approach (enumeration of all
allowed parent types).
Missing:
      (closure_parameters (identifier) @font-lock-variable-name-face)

This one goes into the 'definition' feature. I just made that change today in emacs-29, check it out.

      (field_initializer value: (identifier) @font-lock-variable-name-face)

Thanks, added. Also added unary_expression.

Would it be possible to alphabetize the queries in the variable feature BTW? It 
makes it easier to see what's there/missing.
And you know I like things alphabetized 😉.

No problem! I generally like to group by functionality, but alphabetic is fine, and this case seems particularly suited to it.

See the revised in attachment.

Attachment: rust-ts-fontify-scope-v4.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]