rust-analyzer/crates/ide/src/syntax_highlighting
bors[bot] 0a715cfbd2
Merge #6472
6472: Add `static` modifier for associated functions r=matklad a=p3achyjr

Adds static semantic token modifier to associated functions, resolves #6194 

## Info

- Associated functions are more-or-less equivalent to static methods in other languages. This PR checks, for each function, whether that function has a self_param, and whether it's enclosed in a trait/impl.

## Changes

- Added method ```is_associated``` to code_model::Function. This basically gets the source from the ast, and checks whether the enclosing scope is an impl or trait.
- Added `static` to HighlightModifiers
- Added unit test

## Tests

- Ran ```cargo test```

Co-authored-by: Anatol Liu <axlui@anatols-mbp.lan>
2020-11-09 21:13:51 +00:00
..
test_data Merge #6472 2020-11-09 21:13:51 +00:00
format.rs Kill RAW_ literals 2020-11-06 22:23:14 +01:00
html.rs Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
injection.rs Simplify 2020-11-06 22:30:58 +01:00
macro_rules.rs Default::default the highlighters 2020-10-14 22:50:26 +02:00
tags.rs Add static semantic token modifier for associated functions with no &self 2020-11-04 20:08:46 -08:00
tests.rs Add static semantic token modifier for associated functions with no &self 2020-11-04 20:08:46 -08:00