Aleksey Kladov
ba8d6d1e4e
Remove more unreachable pubs
2020-11-02 16:58:33 +01:00
Lukas Wirth
269e67312d
Highlight never type as BuiltinType
2020-10-26 22:27:30 +01:00
Lukas Wirth
c9af469b85
Fix unary minus highlighting
2020-10-25 23:05:30 +01:00
GrayJack
a483b5545d
Add Callable modifier for variables that implements Fnonce
2020-10-16 07:52:18 -03:00
GrayJack
83d6bc7113
Add HighlightModifier::Callable and add it for locals
2020-10-16 06:38:32 -03:00
Aleksey Kladov
56e67e3a39
More idiomatic classification API
2020-10-15 17:38:17 +02:00
Aleksey Kladov
f9c1336873
More clarifications
2020-10-15 17:37:55 +02:00
Aleksey Kladov
bc287b8f9b
Unconfuse expression and pattern field init shorthands
2020-10-15 17:37:36 +02:00
Lukas Wirth
bab29e65eb
Default::default the highlighters
2020-10-14 22:50:26 +02:00
Lukas Wirth
8c6dc5f28a
Factor macro_rules! highlighting out
2020-10-14 19:23:59 +02:00
Lukas Wirth
df87be88d8
Factor format string highlighting out
2020-10-14 19:23:45 +02:00
Lukas Wirth
1416413d69
Skip macro matcher fragment name semantic highlighting
2020-10-10 23:21:12 +02:00
Paul Daniel Faria
a1a7b07ad3
Fix handling of consuming self, refactor shared logic into a single function
2020-09-06 14:34:01 -04:00
Paul Daniel Faria
7af947a032
Add consuming modifier to lvalues that are passed by value and not Copy
2020-09-06 12:26:53 -04:00
bors[bot]
e65d48d1fb
Merge #5823
...
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 <aleksey.kladov@gmail.com>
2020-08-22 14:41:17 +00:00
Aleksey Kladov
863b1fb731
⬆️ ungrammar
2020-08-21 19:14:05 +02:00
Aleksey Kladov
8000d1d30d
Don't underline function definition if self is &mut
...
The self is right there, and is already underlined, so it makes little
sense to emit even more underlines.
2020-08-19 20:02:33 +02:00
Aleksey Kladov
eb7bb2cba0
Remove dead code
2020-08-19 19:54:00 +02:00
Aleksey Kladov
b56e020077
Apply couple of rule of thumbs to simplify highlighting code
...
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)
2020-08-19 17:53:41 +02:00
Aleksey Kladov
11a1bb1c3e
Inline trivial function
2020-08-19 17:41:56 +02:00
Aleksey Kladov
a9778c6d73
Simplify
2020-08-19 17:37:19 +02:00
Aleksey Kladov
0b62b990ba
Minor
2020-08-19 17:33:25 +02:00
Aleksey Kladov
422ac441c2
Minor cleanups
2020-08-19 17:31:26 +02:00
Aleksey Kladov
5da1dc9a8b
Better name
2020-08-19 17:30:43 +02:00
Aleksey Kladov
61754678fb
Better API factoring around self access modes
2020-08-19 17:02:50 +02:00
Aleksey Kladov
b9b4693ce3
Add SelfParam to code_model
2020-08-19 15:16:24 +02:00
Paul Daniel Faria
3456e2eec7
Add new method to Semantics, method_receiver_kind, which returns the kind of self
...
The options are Shared, Mutable, Consuming, and Copied. Use this to add proper
highlighting to methods based on usage.
2020-08-16 10:26:16 -04:00
Paul Daniel Faria
a044ff0138
Mark mutating functions with mutable
modifier, and owning functions with consuming
.
2020-08-16 10:22:51 -04:00
Aleksey Kladov
1b0c7701cc
Rename ra_ide -> ide
2020-08-13 17:58:27 +02:00