Commit graph

27 commits

Author SHA1 Message Date
Aleksey Kladov
f8a59adf5e Tease apart orthogonal concerns in markdown link rewriting
`hir` should know nothing about URLs, markdown and html. It should
only be able to:

* resolve stringy path from documentation
* generate canonical stringy path for a def

In contrast, link rewriting should not care about semantics of paths
and names resolution, and should be concern only with text mangling
bits.
2020-08-26 20:24:00 +02:00
Aleksey Kladov
cd9ecdf467 Remove monomorphisation from doclinks resolving code 2020-08-25 14:58:22 +02:00
Aleksey Kladov
66e5ced894 Remove AttrDef 2020-08-25 14:44:15 +02:00
Aleksey Kladov
7487885309 Simplify 2020-08-25 12:58:00 +02:00
Aleksey Kladov
575fb9ab6a Move attrs from code_module to a separate module 2020-08-25 12:56:01 +02:00
Aleksey Kladov
663749beab Minor 2020-08-25 12:48:00 +02:00
Aleksey Kladov
b45dd9ef54 Use the same abstraction for attrs and docs
Doc comments *are* attributes, so there's no reason to have two crates
here.
2020-08-25 12:13:31 +02:00
Zac Pullar-Strecker
b835f06cec Merge remote-tracking branch 'upstream/master' into 503-hover-doc-links 2020-08-25 16:44:36 +12:00
Zac Pullar-Strecker
452afaebe1 Changes from review 2020-08-25 16:40:43 +12:00
Pavan Kumar Sunkara
335add49db Add description for crates that will be published 2020-08-24 13:07:22 +02:00
Zac Pullar-Strecker
5452368fad Renames, comments, and dead code removal 2020-08-24 21:50:30 +12:00
Zac Pullar-Strecker
7bbca7a1b3 Merge remote-tracking branch 'upstream/master' into 503-hover-doc-links 2020-08-24 21:20:13 +12:00
Pavan Kumar Sunkara
a8fa5cd42e Add version to deps in cargo.toml 2020-08-24 11:10:41 +02:00
Aleksey Kladov
863b1fb731 ⬆️ ungrammar 2020-08-21 19:14:05 +02:00
Aleksey Kladov
61754678fb Better API factoring around self access modes 2020-08-19 17:02:50 +02:00
Aleksey Kladov
70fd542822 Introduce hir::Param
We generally shouldn't expose TypeRef out of hir. So, let's just use a
placehoder here.
2020-08-19 16:04:18 +02:00
Aleksey Kladov
b9b4693ce3 Add SelfParam to code_model 2020-08-19 15:16:24 +02:00
Aleksey Kladov
a3b0a3aeb8 Minor cleanups 2020-08-19 13:46:34 +02:00
bors[bot]
529ca7e5e0
Merge #5643
5643: Add new consuming modifier, apply consuming and mutable to methods r=matklad a=Nashenas88

This adds a new `consuming` semantic modifier for syntax highlighters.

This also emits `mutable` and `consuming` in two cases:

- When a method takes `&mut self`, then it now has `function.mutable` emitted.
- When a method takes `self`, and the type of `Self` is not `Copy`, then `function.consuming` is emitted.

CC @flodiebold 

Co-authored-by: Paul Daniel Faria <Nashenas88@users.noreply.github.com>
2020-08-19 11:27:02 +00:00
Dmitry
e18748ed15 Merge remote-tracking branch 'rust-analyzer/master' 2020-08-18 19:37:22 +07: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
0ca1ba29e8 Don't expose hir::Path out of hir
Conjecture: it's impossible to use hir::Path *correctly* from an IDE.

I am not entirely sure about this, and we might need to add it back at
some point, but I have to arguments that convince me that we probably
won't:

* `hir::Path` has to know about hygiene, which an IDE can't set up
  properly.

* `hir::Path` lacks identity, but you actually have to know identity
  to resolve it correctly
2020-08-15 18:50:41 +02:00
Dmitry
73315c9168 synchronizing changes 2020-08-15 02:37:43 +07:00
Aleksey Kladov
125744c057 Rename hypothetical -> speculative 2020-08-14 15:23:27 +02:00
Aleksey Kladov
9664c57e60 Make hygiene private to hir 2020-08-13 23:54:37 +02:00
Aleksey Kladov
ae71a631fd Rename ra_hir -> hir 2020-08-13 16:36:55 +02:00