Skip to content

Conversation

@GrayJack
Copy link
Contributor

This PR added the HighlightModifier::Callable variant and assigned it to variables and parameters that are fn pointers, closures and implements FnOnce trait.

This allows to colorize these variables/parameters when used in call expression.

@lnicola
Copy link
Member

lnicola commented Oct 16, 2020

We should also add the modifier to package.json so it shows up in autocomplete.

@matklad
Copy link
Contributor

matklad commented Oct 20, 2020

Let's add a test for this here: https://github.com/rust-analyzer/rust-analyzer/blob/20d369a826e8f333cba1988325480a49a730f00e/crates/ide/src/syntax_highlighting/tests.rs#L96-L135

This might require adding an Fn lang item as well (see Copy in the same test)

@GrayJack
Copy link
Contributor Author

GrayJack commented Oct 21, 2020

@matklad

Done! 😄

@matklad
Copy link
Contributor

matklad commented Oct 23, 2020

bors r+

Thanks!

@bors
Copy link
Contributor

bors bot commented Oct 23, 2020

@bors bors bot merged commit 2fa942a into rust-lang:master Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants