Commit graph

5599 commits

Author SHA1 Message Date
Aleksey Kladov
d953df319b Simplify 2020-03-27 11:25:11 +01:00
Aleksey Kladov
db34abeb85 Get rid of ItemOrMacro 2020-03-26 16:10:01 +01:00
Aleksey Kladov
b7aaefb5a4 Minor incremental tests cleanup 2020-03-26 15:44:31 +01:00
Aleksey Kladov
9f53cec1da Cleanup memory usage stats 2020-03-25 19:35:46 +01:00
Edwin Cheng
07ec31813c fix typo of visibility_of 2020-03-26 00:11:38 +08:00
bors[bot]
0f6fb0ec3b
Merge #3722
3722: Fix parsing lambdas with return type r=matklad a=matklad

We should eat only a single block, and not whatever larger expression
may start with a block.

closes #3721



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-25 16:01:54 +00:00
Aleksey Kladov
f6188caaa0 Fix parsing lambdas with return type
We should eat only a single block, and not whatever larger expression
may start with a block.

closes #3721
2020-03-25 17:01:28 +01:00
Aleksey Kladov
72c6fc3ff0 Fix add visibility false-positive 2020-03-25 15:55:57 +01:00
Aleksey Kladov
b3665fccfb Preserve relative ordering of grouped assists 2020-03-25 15:45:52 +01:00
bors[bot]
785eb32f49
Merge #3717
3717: Always expand macros during analysis r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-25 12:53:48 +00:00
Aleksey Kladov
2ccfb49bab Always expand macros during analysis 2020-03-25 13:53:15 +01:00
Edwin Cheng
2adc9a8d5f Remove collect proc_macro definitions 2020-03-25 20:14:22 +08:00
Edwin Cheng
5bd3aa05d6 Fix trailling whitespace 2020-03-25 19:50:12 +08:00
Edwin Cheng
8afb445357 Rename to CustomDerive 2020-03-25 19:50:12 +08:00
Edwin Cheng
7667aa6033 Refactoring a bit 2020-03-25 19:50:12 +08:00
Edwin Cheng
519dc15cb1 Use dummy implementation 2020-03-25 19:50:12 +08:00
Edwin Cheng
34dc8d25c1 Add basic custom derive lowering 2020-03-25 19:50:12 +08:00
Aleksey Kladov
f7f0f33e05 Remove dead code 2020-03-25 10:09:50 +01:00
bors[bot]
8a73a8937d
Merge #3707
3707: Add ItemScope::visibility_of r=matklad a=edwin0cheng

~This PR implements `HasVisibility` for various constructs and change `Definition::search_scope` to use `Visibility` directly instead of depends on ad-hoc string parsing.~

This PR added `visibility_of`  in `ItemScope` and `Module` and use it directly directly instead of depends on ad-hoc string parsing.

And also add a FIXME to indicate that there is a bug which do not search child-submodules in other files recursively in `Definition::search_scope`.

I will submit another PR to fix that bug after this is merged.

cc @flodiebold 

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-03-25 08:09:26 +00:00
Matt Hooper
7b35da04bf Improvements based on code review feedback 2020-03-25 00:18:55 +01:00
Matt Hooper
9d298115a6 Fmt corrections 2020-03-24 23:22:41 +01:00
Matt Hooper
b70ce559b8 Added more unit tests 2020-03-24 23:22:41 +01:00
Matt Hooper
a197abbc7a Added new inlay hint kind and rules for method chaining 2020-03-24 23:18:42 +01:00
Edwin Cheng
d606521723 Use visibility_of in search 2020-03-25 04:45:55 +08:00
Edwin Cheng
bcfb3700ce Add ItemScope::visibility_of 2020-03-25 04:45:42 +08:00
bors[bot]
fae627174a
Merge #3664
3664: Introduce TokenConverter Trait r=matklad a=edwin0cheng

This PR add a `TokenConverter` Trait to share the conversion logic between raw `lexer` token and Syntax Node Token.

Related #2158.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-03-24 16:41:56 +00:00
bors[bot]
9690f6bc43
Merge #3708
3708: Generalise syntax rewriting infrastructure to allow removal of nodes r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-24 16:15:08 +00:00
Aleksey Kladov
062f6e3bbe Generalise syntax rewriting infrastructure to allow removal of nodes 2020-03-24 17:14:33 +01:00
bors[bot]
7c2cc85806
Merge #3705
3705: Align naming r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-24 11:56:43 +00:00
Aleksey Kladov
9bf2cd609c Align naming 2020-03-24 12:56:07 +01:00
bors[bot]
6ef64622af
Merge #3700
3700: fill match arms with empty block rather than unit tuple r=matklad a=JoshMcguigan

As requested by @Veetaha in #3689 and #3687, this modifies the fill match arms assist to create match arms as an empty block `{}` rather than a unit tuple `()`.

In one test I left one of the pre-existing match arms as a unit tuple, and added a body to another match arm, to demonstrate that the contents of existing match arms persist. 

Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
2020-03-24 11:48:32 +00:00
bors[bot]
8617fe641d
Merge #3694
3694: Complete only missing fields r=matklad a=SomeoneToIgnore



Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-03-24 09:49:25 +00:00
Kirill Bulatov
f1cf1cc1ca Code review fixes
Co-Authored-By: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-24 11:33:47 +02:00
bors[bot]
c6db6e2352
Merge #3696 #3698 #3703
3696: vscode: more type safety r=matklad a=Veetaha



3698: Consider references when applying postfix completions r=matklad a=SomeoneToIgnore

Sometimes my RA debugging workflow breaks because `.dbg` is applied to the variable that is used later in the code.
It's safer to consider the refences to avoid this for completions that may trigger the move.

3703: Don't try to enable proposed API's on stable r=matklad a=matklad



bors r+
🤖

Co-authored-by: veetaha <veetaha2@gmail.com>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-24 08:54:30 +00:00
Kirill Bulatov
dd3b64124b Add a test 2020-03-24 10:43:24 +02:00
Kirill Bulatov
944f28fe5b Use more generic public api 2020-03-24 10:43:22 +02:00
Kirill Bulatov
d5e11b33a3 Remove the upcast 2020-03-24 10:43:00 +02:00
Kirill Bulatov
d221ff4f9e Auto import macros 2020-03-24 10:43:00 +02:00
Josh Mcguigan
7ba934fe58 fill match arms with empty block rather than unit tuple 2020-03-23 19:23:30 -07:00
Kirill Bulatov
4e43df26b2 Consider references when applying postfix completions 2020-03-24 01:56:06 +02:00
Josh Mcguigan
df58ab8963 update itertools version to 0.9.0 2020-03-23 16:22:46 -07:00
Kirill Bulatov
00cbe81a5b Complete only missing fields 2020-03-24 00:36:06 +02:00
Aleksey Kladov
3bd119a4c1 Add a test 2020-03-23 20:57:42 +01:00
bors[bot]
eff1b3fe4d
Merge #3689
3689: implement fill match arm assist for tuple of enums r=matklad a=JoshMcguigan

This updates the fill match arm assist to work in cases where the user is matching on a tuple of enums. 

Note, for now this does not apply when some match arms exist (other than the trivial `_`), but I think this could be added in the future.

I think this also lays the groundwork for filling match arms when matching on tuples of non-enum values, for example a tuple of an enum and a boolean.

Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
2020-03-23 16:41:46 +00:00
Aleksey Kladov
f8fd242199
Merge pull request #3686 from Veetaha/feature/hover-actual-type-params
ra_hir: add more privacy for Type
2020-03-23 14:06:54 +01:00
Aleksey Kladov
a2f7ca27c0
Merge pull request #3678 from edwin0cheng/refactor-rename
Fix rename argument in macro call
2020-03-23 14:06:40 +01:00
Josh Mcguigan
bc48c9d511 review comments 2020-03-23 05:19:09 -07:00
bors[bot]
851a03492e
Merge #3690
3690: ra_hir: add more docs r=matklad a=Veetaha

Cited from [hear](https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/hover/near/191446937)

Co-authored-by: veetaha <veetaha2@gmail.com>
2020-03-23 12:06:11 +00:00
veetaha
e6691844db ra_hir: fix typo 2020-03-23 14:04:50 +02:00
veetaha
0fc21bd303 ra_hir: add more docs 2020-03-23 14:00:51 +02:00