Commit graph

689 commits

Author SHA1 Message Date
Emmanuel Thompson
35bec31bca Add space after lifetime
In macro expansion, this lead to invalid syntax
2021-04-06 23:22:44 -04:00
bors[bot]
c2be91dcd8
Merge #8245
8245: Properly resolve intra doc links in hover and goto_definition r=matklad a=Veykril

Unfortunately involves a bit of weird workarounds due to pulldown_cmark's incorrect lifetimes on `BrokenLinkCallback`... I should probably open an issue there asking for the fixes to be pushed to a release since they already exist in the repo for quite some time it seems.

Fixes #8258, Fixes #8238

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-05 12:30:20 +00:00
Florian Diebold
cd227f581e Add and start using TraitRef and ProjectionTy builders 2021-04-04 13:16:38 +02:00
Edwin Cheng
b636080f67 Fix joinLines panic if run on the empty last line 2021-04-03 11:20:16 +08:00
Jonas Schievink
7ceaba21df Only populate prelude for crate-level DefMaps 2021-04-02 19:00:26 +02:00
bors[bot]
5ef0c7a213
Merge #8283
8283: Resolve associated types r=flodiebold a=Veykril

Prior we were only resolving paths until the first type was found, then discarding the result if the path wasn't fully consumed. That of course causes associated types to not resolve. Fixes #5003

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-04-01 21:11:06 +00:00
Lukas Wirth
9fe10a9606 Resolve associated types with type anchors 2021-04-01 21:52:07 +02:00
Lukas Wirth
444f6caaba Resolve associated types 2021-04-01 21:31:25 +02:00
Ayomide Bamidele
7bea1d8bfe Additional syntax highlighting screenshot in manual 2021-03-31 18:45:15 +01:00
Ayomide Bamidele
4296cc3318 Gif of "let = " typing assist 2021-03-31 16:39:04 +01:00
Ayomide Bamidele
d82176c146 Gifs and screenshots for features in manual (syntax highlighting and typing) 2021-03-31 16:20:54 +01:00
bors[bot]
55d7d71590
Merge #8267
8267: Adding gifs and screenshots for features in manual r=matklad a=MozarellaMan

For #6539

This includes most of gif or screenshot examples of most items in the "Features" header. With the exceptions of:

- **On Typing Assists** - couldn't get it to work for a demo, I'm probably missing something?
- **Structural search and replace** - looked to be already a visual example of the feature
- **Workspace symbol** - wasn't sure how best to show this, all of the examples maybe? Also wasn't sure of the best code example to show it off
- **Semantic Syntax Highlighting** - seemed obvious enough to not need a screenshot, but I could easily add this

All the gifs/pngs are hosted in this [comment](https://github.com/rust-analyzer/rust-analyzer/issues/6539#issuecomment-809574840). Please let me know if any of them aren't suitable (and why) and I'll improve it! Or if you don't like the theme/font

Co-authored-by: Ayomide Bamidele <48062697+MozarellaMan@users.noreply.github.com>
2021-03-31 10:01:56 +00:00
Ayomide Bamidele
276022682b Gifs and screenshots for features in manual 2021-03-31 00:08:10 +01:00
Lukas Wirth
8d786dc4c3 Replace Range<usize> usage with TextRange 2021-03-30 22:42:21 +02:00
Chetan Khilosiya
518c9c7548 Revert "8024: Added test case for highlighting trait items."
This reverts commit d7dcd41801.
2021-03-31 01:46:01 +05:30
Chetan Khilosiya
d0fcd5c5e0 8024: Fix for function name change. 2021-03-31 00:47:37 +05:30
Chetan Khilosiya
d7dcd41801 8024: Added test case for highlighting trait items. 2021-03-31 00:31:15 +05:30
Chetan Khilosiya
56f624532a 8024: Updated the implementation for trait modifier.
Fixed the test cases.
2021-03-31 00:31:15 +05:30
Chetan Khilosiya
f269fe7156 8024: Added the trait modifier for methods
method in impls and method calls will have trait modifier.
2021-03-31 00:31:15 +05:30
bors[bot]
fd7c454d51
Merge #8186
8186: Lower traits to `TraitRef` instead of `TypeRef` r=matklad a=Veykril



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-03-30 16:45:05 +00:00
Lukas Wirth
bb56b7a75c Use new new docs string source mapping in goto_def and hover 2021-03-30 18:27:16 +02:00
Lukas Wirth
9a327311e4 Implement basic Documentation source to syntax range mapping 2021-03-30 17:20:43 +02:00
Lukas Wirth
9df78ec4a4 Properly resolve intra doc links in hover and goto_definition 2021-03-30 14:03:32 +02:00
ivan770
4fcba8b1bf
Fix code style 2021-03-30 12:58:41 +02:00
ivan770
6ef6e4dee1
Improved node lookup algorithm, added more movable nodes 2021-03-30 12:44:09 +02:00
Jonas Schievink
41c7448e12 Accurately classify assoc. types in paths 2021-03-30 02:09:17 +02:00
Lukas Wirth
6b8358d4d9 Remove code duplication in highlight injection 2021-03-29 20:11:28 +02:00
Lukas Wirth
c2a63b97a8 Rename target_ty to self_ty 2021-03-29 17:47:47 +02:00
Ayomide Bamidele
8e11796dc5 formatting fix 2021-03-29 12:56:02 +01:00
Ayomide Bamidele
a813062ed2 Folding range for statics 2021-03-29 12:20:26 +01:00
Ayomide Bamidele
391be07298 Folding range for consts 2021-03-29 12:17:19 +01:00
Ayomide Bamidele
23601454fe New FoldKinds - Consts, Statics 2021-03-29 11:49:14 +01:00
Ayomide Bamidele
f6702dda9a Test cases for folding consts and statics 2021-03-29 11:43:03 +01:00
bors[bot]
ae7de296ae
Merge #8222
8222: Don't mark unlinked file diagnostic as unused r=lnicola a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8215, at least on VS Code

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-03-29 07:30:28 +00:00
bors[bot]
bb1d925dab
Merge #8212
8212: Basic support macro 2.0 r=jonas-schievink a=edwin0cheng

Turn out it is quite straight forward :)

r @jonas-schievink 

![m2](https://user-images.githubusercontent.com/11014119/112712565-6eb99380-8f0b-11eb-88de-5d7f974dfe6d.png)


Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-03-28 15:43:11 +00:00
Jonas Schievink
bd18e5fa87 Don't mark unlinked file diagnostic as unused 2021-03-28 03:56:03 +02:00
Lukas Wirth
c9e479870b Prefer add mod declaration to lib.rs over file.rs in UnlinkedFile fix 2021-03-27 23:43:07 +01:00
Edwin Cheng
eedadd7024 Add support for doc on hover for macro 2.0 2021-03-27 14:57:11 +08:00
Edwin Cheng
4520002b63 Unleash macro 2.0 in hightlight and more 2021-03-27 14:42:49 +08:00
cynecx
5ff3299dd6 syntax: return owned string instead of leaking string 2021-03-26 18:30:59 +01:00
ivan770
50e28aec25
Ignore main functions not in root module 2021-03-26 16:04:53 +02:00
Jonas Schievink
37c6ce34a9 Document unlinked-file diagnostic 2021-03-24 22:18:17 +01:00
Brandon
903a2e98f9 Clean up implementation 2021-03-24 00:47:55 -07:00
Brandon
0d063b8d21 Fix MISSING: command error with macros 2021-03-24 00:00:38 -07:00
bors[bot]
c6d6a7d412
Merge #8178
8178: Show item info when hovering intra doc links r=Veykril a=Veykril

![r4uIITP0IZ](https://user-images.githubusercontent.com/3757771/112197618-91e2fb00-8c0c-11eb-9edc-a7923214d2b6.gif)


Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-03-23 19:58:03 +00:00
Lukas Wirth
caaeb92882 Cleanup intra_doc_link parsing 2021-03-23 20:56:38 +01:00
Lukas Wirth
8b0d0bd9c7 Show item info when hovering intra doc links 2021-03-23 19:57:04 +01:00
Lukas Wirth
6bdf505d7c simplify 2021-03-23 17:49:06 +01:00
Lukas Wirth
638dcac092 Make more use of the HIR in rename::rename_to_self 2021-03-23 16:54:21 +01:00
Lukas Wirth
bad4e48672 Set up a search scope when searching for mbe macro references 2021-03-23 11:32:10 +01:00