aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting.rs
Commit message (Collapse)AuthorAgeFilesLines
* Use more Rustic highlighting specifiersAleksey Kladov2020-12-191-10/+21
| | | | | *Method* works for OO languages, but in rust we can also have associated constants & types, so let's move this to a modifier.
* Deduplicate highlight tags and symbol kindsAleksey Kladov2020-12-181-47/+54
| | | | | | | Curiously, LSP uses different enums for those, and unsurprising and annoyingly, there are things which exist in one but not in the other. Let's not repeat the mistake and unify the two things
* Lifetime reference searchLukas Wirth2020-12-161-0/+1
|
* Move to upstream `macro_rules!` modelJonas Schievink2020-12-151-23/+29
|
* Use METHOD semantic token typeLaurențiu Nicola2020-12-041-5/+10
|
* Add attribute highlight modifier to all tokens inside attributesLukas Wirth2020-11-211-3/+16
|
* Merge #6472bors[bot]2020-11-091-1/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]>
| * Add static semantic token modifier for associated functions with no &selfAnatol Liu2020-11-091-2/+2
| | | | | | | | | | | | refactor logic into code_model.rs address comments
| * Add static semantic token modifier for associated functions with no &selfAnatol Liu2020-11-081-1/+1
| | | | | | | | | | | | refactor logic into code_model.rs address comments
| * Add static semantic token modifier for associated functions with no &selfAnatol Liu2020-11-051-14/+2
| | | | | | | | refactor logic into code_model.rs
| * Add static semantic token modifier for associated functions with no &selfAnatol Liu2020-11-051-0/+15
| |
* | . is an operatorAleksey Kladov2020-11-091-1/+3
| | | | | | | | closes #6498
* | Kill RAW_ literalsAleksey Kladov2020-11-061-9/+7
|/ | | | | Syntactically, they are indistinguishable from non-raw versions, so it doesn't make sense to separate then *at the syntax* level.
* Remove more unreachable pubsAleksey Kladov2020-11-021-4/+5
|
* Highlight never type as BuiltinTypeLukas Wirth2020-10-261-0/+3
|
* Fix unary minus highlightingLukas Wirth2020-10-251-1/+8
|
* Add Callable modifier for variables that implements FnonceGrayJack2020-10-161-1/+1
|
* Add HighlightModifier::Callable and add it for localsGrayJack2020-10-161-0/+3
|
* More idiomatic classification APIAleksey Kladov2020-10-151-3/+3
|
* More clarificationsAleksey Kladov2020-10-151-2/+2
|
* Unconfuse expression and pattern field init shorthandsAleksey Kladov2020-10-151-1/+1
|
* Default::default the highlightersLukas Wirth2020-10-141-3/+3
|
* Factor macro_rules! highlighting outLukas Wirth2020-10-141-117/+18
|
* Factor format string highlighting outLukas Wirth2020-10-141-75/+8
|
* Skip macro matcher fragment name semantic highlightingLukas Wirth2020-10-101-3/+115
|
* Fix handling of consuming self, refactor shared logic into a single functionPaul Daniel Faria2020-09-061-29/+33
|
* Add consuming modifier to lvalues that are passed by value and not CopyPaul Daniel Faria2020-09-061-2/+39
|
* Merge #5823bors[bot]2020-08-221-6/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5823: Don't underline function definition if self is &mut r=Nashenas88 a=matklad The self is right there, and is already underlined, so it makes little sense to emit even more underlines. before: ![before](https://user-images.githubusercontent.com/1711539/90672843-0d379500-e257-11ea-840f-b0caed4410f1.png) after: ![after](https://user-images.githubusercontent.com/1711539/90672840-0c9efe80-e257-11ea-9739-23af433841c6.png) Co-authored-by: Aleksey Kladov <[email protected]>
| * Don't underline function definition if self is &mutAleksey Kladov2020-08-191-6/+0
| | | | | | | | | | The self is right there, and is already underlined, so it makes little sense to emit even more underlines.
* | :arrow_up: ungrammarAleksey Kladov2020-08-211-1/+2
|/
* Remove dead codeAleksey Kladov2020-08-191-25/+15
|
* Apply couple of rule of thumbs to simplify highlighting codeAleksey Kladov2020-08-191-19/+16
| | | | | | | | | | | | | | | | | Main one: instead of adding a parameter to function to handle special case, make the caller handle it. Second main one: make sure that function does a reasonable thing. `highlight_def` picks a color for def, *regardless* of the context the def is use. Feeding an info from the call-site muddies the responsibilities here. Minor smells, flagging the function as having space for improvement in the first place: * many parameters, some of which are set as constants on most call-sites (introduce severalfunction instad) * boolean param (add two functions instead)
* Inline trivial functionAleksey Kladov2020-08-191-8/+6
|
* SimplifyAleksey Kladov2020-08-191-9/+4
|
* MinorAleksey Kladov2020-08-191-2/+1
|
* Minor cleanupsAleksey Kladov2020-08-191-1/+1
|
* Better nameAleksey Kladov2020-08-191-4/+4
|
* Better API factoring around self access modesAleksey Kladov2020-08-191-10/+16
|
* Add SelfParam to code_modelAleksey Kladov2020-08-191-12/+8
|
* Add new method to Semantics, method_receiver_kind, which returns the kind of ↵Paul Daniel Faria2020-08-161-65/+74
| | | | | | | self The options are Shared, Mutable, Consuming, and Copied. Use this to add proper highlighting to methods based on usage.
* Mark mutating functions with `mutable` modifier, and owning functions with ↵Paul Daniel Faria2020-08-161-10/+32
| | | | `consuming`.
* Rename ra_ide -> ideAleksey Kladov2020-08-131-0/+872