rust/crates/ide/src
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
..
diagnostics Support struct variants in extract_struct_from_enum_variant 2020-11-03 20:57:04 +01:00
display Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
references Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
syntax_highlighting Merge #6472 2020-11-09 21:13:51 +00:00
typing Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
call_hierarchy.rs Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
diagnostics.rs Do insertion lookahead in algo::diff 2020-10-26 16:03:37 +01:00
display.rs Extract call_info and completion into separate crates 2020-10-18 13:09:00 +03:00
doc_links.rs Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
expand_macro.rs rename mock_analysis -> fixture 2020-10-02 17:49:44 +02:00
extend_selection.rs Kill RAW_ literals 2020-11-06 22:23:14 +01:00
file_structure.rs Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
fixture.rs Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
fn_references.rs rename mock_analysis -> fixture 2020-10-02 17:49:44 +02:00
folding_ranges.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
goto_definition.rs Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
goto_implementation.rs Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
goto_type_definition.rs Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
hover.rs Merge #6331 #6342 2020-10-24 19:08:12 +00:00
inlay_hints.rs Only show self ident when showing parameter self hints 2020-11-02 21:56:16 +01:00
join_lines.rs Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
lib.rs Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
markdown_remove.rs Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
markup.rs Rename ra_ide -> ide 2020-08-13 17:58:27 +02:00
matching_brace.rs Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
parent_module.rs Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
prime_caches.rs Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
references.rs Remove more unreachable pubs 2020-11-02 16:58:33 +01:00
runnables.rs add doctest runnables on struct #6356 2020-10-27 14:11:27 +01:00
status.rs Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00
syntax_highlighting.rs Merge #6472 2020-11-09 21:13:51 +00:00
syntax_tree.rs Kill RAW_ literals 2020-11-06 22:23:14 +01:00
typing.rs Re-export base_db from ide_db 2020-10-24 11:39:57 +03:00