rust-lang / rust-mode

Emacs configuration for Rust
Apache License 2.0
1.1k stars 176 forks source link

Highlight funcalls #426

Closed gnuvince closed 3 months ago

gnuvince commented 2 years ago

One feature I quite like of Emacs's go-mode is how it highlights function calls. I use a theme that has very few colors, and highlighting the calls helps to guide my eyes. I replicated the feature for rust-mode. Here's a screenshot.

image

rust-highfive commented 2 years ago

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brotzeit (or someone else) soon.

Please see the contribution instructions for more information.

brotzeit commented 2 years ago

Thanks for the contribution! But it seems to me that this isn't the default behavior. Look at other language major modes like elisp. Function calls have the face default.

But we could add this as optional feature.

brotzeit commented 2 years ago

Any opinions on this ? If users like this feature we can merge this anyway...

yugaego commented 2 years ago

it seems to me that this isn't the default behavior. Look at other language major modes like elisp. Function calls have the face default.

This is true.

Any opinions on this ? If users like this feature we can merge this anyway

I personally find function calls using default face inconvenient (in other major modes too). It would be nice to have a customizable face for function calls.

brotzeit commented 1 year ago

Does this work with treesitter ? I guess font-locking will change a lot with this new feature.

psibi commented 5 months ago

@gnuvince Now that treesiter mode support is merged, can you see if it works with that: https://github.com/rust-lang/rust-mode?tab=readme-ov-file#tree-sitter ?

psibi commented 3 months ago

I'm gently closing this PR for now as there haven't been any recent updates. However, feel free to reopen it whenever you're ready to pick it up again.