Commit graph

6805 commits

Author SHA1 Message Date
Aleksey Kladov
1b8ce5b37b Move impls to ItemScope 2019-12-20 16:52:02 +01:00
Aleksey Kladov
030e540ad1 Reduce visibility 2019-12-20 16:52:02 +01:00
Aleksey Kladov
2ce1aa32c4 Rename ModuleScope -> ItemScope 2019-12-20 16:52:02 +01:00
Aleksey Kladov
16ac792f48 Docs 2019-12-20 16:52:02 +01:00
Aleksey Kladov
0f212b3798 Move ModuleScope to a new module 2019-12-20 16:52:02 +01:00
Aleksey Kladov
49aac9ef63 Add item_scope module 2019-12-20 16:52:02 +01:00
bors[bot]
cfc50ff160
Merge #2615
2615: Fix wrong path parsing for macro call in pattern position r=edwin0cheng a=edwin0cheng

The parser incorrectly insert a `PathPat` inside `MacroCall` syntax node when parsing inside a pattern position, for example : 

```rust
let foo!() = 0;
```

become:

```
 MACRO_CALL@[60; 66)
    PATH_PAT@[60; 63)     <------------- It should not exist
      PATH@[60; 63)
        PATH_SEGMENT@[60; 63)
          NAME_REF@[60; 63)
            IDENT@[60; 63) "foo"
    EXCL@[63; 64) "!"
    TOKEN_TREE@[64; 66)
      L_PAREN@[64; 65) "("
      R_PAREN@[65; 66) ")"
```

This PR fix this bug and add some test to make sure goto-defintion works for macro inside pattern.


Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-12-20 15:30:36 +00:00
Edwin Cheng
4a7e19946a Fix parser for macro call in pattern position 2019-12-20 23:26:04 +08:00
bors[bot]
af5e2abe15
Merge #2614
2614: Clippy cleanup r=matklad a=kjeremy

Just a few tweaks from the latest clippy.  There are a lot more but we should probably tweak our settings.

Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-12-20 14:46:24 +00:00
kjeremy
f22aabc136 Use unwrap_or_default 2019-12-20 09:43:30 -05:00
kjeremy
133b4063a6 Remove useless clone 2019-12-20 09:43:01 -05:00
bors[bot]
d590f6ce12
Merge #2592
2592: Add std::ops::Index support for infering r=edwin0cheng a=edwin0cheng

see also #2534

Seem like this can't fix #2534 for this case:

```rust
fn foo3(bar: [usize; 2]) {
    let baz = bar[1];   // <--- baz is still unknown ?
    println!("{}", baz);
}
```

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-12-20 14:36:53 +00:00
bors[bot]
81a1b14d78
Merge #2613
2613: Remove code that never was alive? r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-20 14:28:41 +00:00
Aleksey Kladov
794bbab70d Remove code that never was alive? 2019-12-20 15:26:19 +01:00
bors[bot]
890ec6f798
Merge #2612
2612: Fix resolve for field init shorthand r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-20 13:50:44 +00:00
Aleksey Kladov
3d4b48e481 Fix resolve for field init shorthand 2019-12-20 14:48:14 +01:00
bors[bot]
a0571359f3
Merge #2611
2611: Fix highlighting for field init shorthand r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-20 13:12:39 +00:00
Aleksey Kladov
77af7b087f Fix highlighting for field init shorthand 2019-12-20 14:12:14 +01:00
Aleksey Kladov
d057afb945 Improve highlighting test 2019-12-20 14:12:14 +01:00
bors[bot]
a2ce8ab275
Merge #2610
2610: Reduce copy-paste some more r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-20 12:58:55 +00:00
Aleksey Kladov
2d8a001465 Reduce copy-paste some more 2019-12-20 13:58:09 +01:00
bors[bot]
fbc2cf2b69
Merge #2609
2609: Use generic ItemLoc for impls r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-20 12:48:27 +00:00
Aleksey Kladov
1234dda9ee Use generic ItemLoc for impls 2019-12-20 13:47:44 +01:00
Aleksey Kladov
d137df0137 Remove more copy-paste 2019-12-20 13:19:41 +01:00
Aleksey Kladov
957c0171e6 Remove more copy-paste 2019-12-20 13:11:01 +01:00
bors[bot]
6537762024
Merge #2608
2608: Support for nested traits r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-20 11:43:19 +00:00
Aleksey Kladov
f42697e54b Support for nested traits 2019-12-20 12:29:25 +01:00
Aleksey Kladov
fe1b160dcf Support for nested statics, consts and type aliases 2019-12-20 12:22:55 +01:00
Aleksey Kladov
ac5a3f611b Support for nested ADT 2019-12-20 12:20:49 +01:00
Aleksey Kladov
94ad07af4b Introduce ContainerId 2019-12-20 12:07:23 +01:00
Aleksey Kladov
8fc20b6503 Rename ContainerId -> AssocContainerId 2019-12-20 12:00:05 +01:00
bors[bot]
6e9335d311
Merge #2607
2607: More ground work for local defs r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-20 10:56:59 +00:00
Aleksey Kladov
67c2aea182 Rebuild ra_lsp_server and nest helper function.
Completion now works again, so there's no need not to nest
2019-12-20 11:52:17 +01:00
Aleksey Kladov
d316ba9a13 Handle nested declrations in from_source 2019-12-20 11:52:17 +01:00
Aleksey Kladov
a04177f135 Add local functions to bodies 2019-12-20 11:52:17 +01:00
Edwin Cheng
76d688a328 Use fill instread of for loop 2019-12-20 03:04:55 +08:00
bors[bot]
08c6933104
Merge #2601
2601: ⬆️ deps r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-19 17:32:51 +00:00
Aleksey Kladov
932d805062 ⬆️ deps 2019-12-19 18:28:57 +01:00
Aleksey Kladov
c7291386d3 ⬆️ Rust 2019-12-19 18:27:44 +01:00
bors[bot]
0000c7753e
Merge #2600
2600: Plumbing for local items support r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-19 17:22:40 +00:00
Aleksey Kladov
9ccad60acc Implement ChildBySource for DefWithBody 2019-12-19 18:21:26 +01:00
Aleksey Kladov
ba12e83c26 Add body as a possible container for items 2019-12-19 18:12:46 +01:00
Aleksey Kladov
5bd8de3f5e Allow storing defs in bodies 2019-12-19 18:09:50 +01:00
bors[bot]
90f3b31efc
Merge #2599
2599: Drop dead code r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-19 17:08:12 +00:00
Aleksey Kladov
b2731ab78a Drop dead code 2019-12-19 18:07:39 +01:00
bors[bot]
f00904e996
Merge #2598
2598: Touch up TokenSet a bit r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-19 16:15:19 +00:00
Aleksey Kladov
0ed8ce096d Touch up TokenSet a bit 2019-12-19 17:13:33 +01:00
bors[bot]
aee2eee362
Merge #2597
2597: Handle start imports in import groups r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-12-19 16:04:24 +00:00
Aleksey Kladov
43ed3d1196 Handle start imports in import groups 2019-12-19 16:57:22 +01:00
bors[bot]
a766f63650
Merge #2594
2594: Omit default parameter types r=matklad a=SomeoneToIgnore

Part of https://github.com/rust-analyzer/rust-analyzer/issues/1946

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2019-12-19 15:35:42 +00:00