rust/crates
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
..
arena
assists Fix panic when extracting struct 2020-11-09 16:59:57 +01:00
base_db Feedback. 2020-11-02 10:57:31 -07:00
cfg
completion Add some postfix snippet 2020-11-08 20:10:40 +01:00
flycheck
hir Add static semantic token modifier for associated functions with no &self 2020-11-09 13:09:20 -08:00
hir_def Cleanup API 2020-11-06 22:52:42 +01:00
hir_expand Simplify 2020-11-06 22:30:58 +01:00
hir_ty Improve decl_check module readability 2020-11-03 10:13:49 +03:00
ide Merge #6472 2020-11-09 21:13:51 +00:00
ide_db
mbe Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
parser Kill RAW_ literals 2020-11-06 22:23:14 +01:00
paths
proc_macro_api Deny unreachable-pub 2020-11-02 14:07:08 +01:00
proc_macro_srv Deny unreachable-pub 2020-11-02 14:07:08 +01:00
proc_macro_test
profile Deny unreachable-pub 2020-11-02 14:07:08 +01:00
project_model Ignore RUST_SRC_PATH if it is set to invalid value 2020-11-06 11:30:57 +01:00
rust-analyzer Add static semantic token modifier for associated functions with no &self 2020-11-04 20:08:46 -08:00
ssr Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
stdx
syntax Fix debug for SyntaxRewriter 2020-11-09 14:09:49 +01:00
test_utils Feedback. 2020-11-02 10:57:31 -07:00
text_edit
toolchain
tt
vfs Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
vfs-notify