]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoMerge #2620
bors[bot] [Fri, 20 Dec 2019 19:09:02 +0000 (19:09 +0000)]
Merge #2620

2620: Update packages r=matklad a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoProtect against null as revealed by `npm test`
kjeremy [Fri, 20 Dec 2019 18:52:34 +0000 (13:52 -0500)]
Protect against null as revealed by `npm test`

4 years agoUpdate to latest packages
kjeremy [Fri, 20 Dec 2019 18:52:11 +0000 (13:52 -0500)]
Update to latest packages

4 years agoMerge #2617
bors[bot] [Fri, 20 Dec 2019 18:16:16 +0000 (18:16 +0000)]
Merge #2617

2617: Remove index resolving from hover r=matklad a=kjeremy

I have left in `HoverResult`'s support for multiple entries because we may still want that at some point.

Per https://github.com/rust-analyzer/rust-analyzer/issues/2542#issuecomment-565238142

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoMerge #2619
bors[bot] [Fri, 20 Dec 2019 17:58:59 +0000 (17:58 +0000)]
Merge #2619

2619: Coerce closures to fn pointers r=flodiebold a=flodiebold

E.g. `let x: fn(A) -> B = |x| { y };`

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
4 years agoCoerce closures to fn pointers
Florian Diebold [Fri, 20 Dec 2019 17:53:40 +0000 (18:53 +0100)]
Coerce closures to fn pointers

E.g. `let x: fn(A) -> B = |x| { y };`

4 years agoMerge #2618
bors[bot] [Fri, 20 Dec 2019 17:29:11 +0000 (17:29 +0000)]
Merge #2618

2618: Fix coercion of last expression in function body r=flodiebold a=flodiebold

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
4 years agoFix coercion of last expression in function body
Florian Diebold [Fri, 20 Dec 2019 17:27:51 +0000 (18:27 +0100)]
Fix coercion of last expression in function body

4 years agoMerge #2616
bors[bot] [Fri, 20 Dec 2019 17:18:52 +0000 (17:18 +0000)]
Merge #2616

2616: Handle closure return types r=flodiebold a=flodiebold

Fixes #2547.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
4 years agoHandle closure return types
Florian Diebold [Fri, 20 Dec 2019 15:41:32 +0000 (16:41 +0100)]
Handle closure return types

Fixes #2547.

4 years agoRemove unused imports
kjeremy [Fri, 20 Dec 2019 16:18:24 +0000 (11:18 -0500)]
Remove unused imports

4 years agoRemove the index resolution from hover
kjeremy [Fri, 20 Dec 2019 16:12:31 +0000 (11:12 -0500)]
Remove the index resolution from hover

We are reasonably precise now to do this.

4 years agoMerge #2615
bors[bot] [Fri, 20 Dec 2019 15:30:36 +0000 (15:30 +0000)]
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>
4 years agoFix parser for macro call in pattern position
Edwin Cheng [Fri, 20 Dec 2019 15:11:07 +0000 (23:11 +0800)]
Fix parser for macro call in pattern position

4 years agoMerge #2614
bors[bot] [Fri, 20 Dec 2019 14:46:24 +0000 (14:46 +0000)]
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>
4 years agoUse unwrap_or_default
kjeremy [Fri, 20 Dec 2019 14:43:30 +0000 (09:43 -0500)]
Use unwrap_or_default

4 years agoRemove useless clone
kjeremy [Fri, 20 Dec 2019 14:43:01 +0000 (09:43 -0500)]
Remove useless clone

4 years agoMerge #2592
bors[bot] [Fri, 20 Dec 2019 14:36:53 +0000 (14:36 +0000)]
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>
4 years agoMerge #2613
bors[bot] [Fri, 20 Dec 2019 14:28:41 +0000 (14:28 +0000)]
Merge #2613

2613: Remove code that never was alive? r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRemove code that never was alive?
Aleksey Kladov [Fri, 20 Dec 2019 14:26:19 +0000 (15:26 +0100)]
Remove code that never was alive?

4 years agoMerge #2612
bors[bot] [Fri, 20 Dec 2019 13:50:44 +0000 (13:50 +0000)]
Merge #2612

2612: Fix resolve for field init shorthand r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoFix resolve for field init shorthand
Aleksey Kladov [Fri, 20 Dec 2019 13:47:01 +0000 (14:47 +0100)]
Fix resolve for field init shorthand

4 years agoMerge #2611
bors[bot] [Fri, 20 Dec 2019 13:12:39 +0000 (13:12 +0000)]
Merge #2611

2611: Fix highlighting for field init shorthand r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoFix highlighting for field init shorthand
Aleksey Kladov [Fri, 20 Dec 2019 13:11:49 +0000 (14:11 +0100)]
Fix highlighting for field init shorthand

4 years agoImprove highlighting test
Aleksey Kladov [Fri, 20 Dec 2019 13:10:31 +0000 (14:10 +0100)]
Improve highlighting test

4 years agoMerge #2610
bors[bot] [Fri, 20 Dec 2019 12:58:55 +0000 (12:58 +0000)]
Merge #2610

2610: Reduce copy-paste some more r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoReduce copy-paste some more
Aleksey Kladov [Fri, 20 Dec 2019 12:58:09 +0000 (13:58 +0100)]
Reduce copy-paste some more

4 years agoMerge #2609
bors[bot] [Fri, 20 Dec 2019 12:48:27 +0000 (12:48 +0000)]
Merge #2609

2609: Use generic ItemLoc for impls r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoUse generic ItemLoc for impls
Aleksey Kladov [Fri, 20 Dec 2019 12:47:44 +0000 (13:47 +0100)]
Use generic ItemLoc for impls

4 years agoRemove more copy-paste
Aleksey Kladov [Fri, 20 Dec 2019 12:19:41 +0000 (13:19 +0100)]
Remove more copy-paste

4 years agoRemove more copy-paste
Aleksey Kladov [Fri, 20 Dec 2019 12:11:01 +0000 (13:11 +0100)]
Remove more copy-paste

4 years agoMerge #2608
bors[bot] [Fri, 20 Dec 2019 11:43:19 +0000 (11:43 +0000)]
Merge #2608

2608: Support for nested traits r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoSupport for nested traits
Aleksey Kladov [Fri, 20 Dec 2019 11:29:25 +0000 (12:29 +0100)]
Support for nested traits

4 years agoSupport for nested statics, consts and type aliases
Aleksey Kladov [Fri, 20 Dec 2019 11:22:55 +0000 (12:22 +0100)]
Support for nested statics, consts and type aliases

4 years agoSupport for nested ADT
Aleksey Kladov [Fri, 20 Dec 2019 11:20:49 +0000 (12:20 +0100)]
Support for nested ADT

4 years agoIntroduce `ContainerId`
Aleksey Kladov [Fri, 20 Dec 2019 11:07:23 +0000 (12:07 +0100)]
Introduce `ContainerId`

4 years agoRename ContainerId -> AssocContainerId
Aleksey Kladov [Fri, 20 Dec 2019 10:59:50 +0000 (11:59 +0100)]
Rename ContainerId -> AssocContainerId

4 years agoMerge #2607
bors[bot] [Fri, 20 Dec 2019 10:56:59 +0000 (10:56 +0000)]
Merge #2607

2607: More ground work for local defs r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRebuild ra_lsp_server and nest helper function.
Aleksey Kladov [Fri, 20 Dec 2019 10:30:22 +0000 (11:30 +0100)]
Rebuild ra_lsp_server and nest helper function.

Completion now works again, so there's no need not to nest

4 years agoHandle nested declrations in from_source
Aleksey Kladov [Fri, 20 Dec 2019 10:24:23 +0000 (11:24 +0100)]
Handle nested declrations in from_source

4 years agoAdd local functions to bodies
Aleksey Kladov [Fri, 20 Dec 2019 10:19:09 +0000 (11:19 +0100)]
Add local functions to bodies

4 years agoUse fill instread of for loop
Edwin Cheng [Thu, 19 Dec 2019 19:04:55 +0000 (03:04 +0800)]
Use fill instread of for loop

4 years agoMerge #2601
bors[bot] [Thu, 19 Dec 2019 17:32:51 +0000 (17:32 +0000)]
Merge #2601

2601: :arrow_up: deps r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years ago:arrow_up: deps
Aleksey Kladov [Thu, 19 Dec 2019 17:28:57 +0000 (18:28 +0100)]
:arrow_up: deps

4 years ago:arrow_up: Rust
Aleksey Kladov [Thu, 19 Dec 2019 17:27:44 +0000 (18:27 +0100)]
:arrow_up: Rust

4 years agoMerge #2600
bors[bot] [Thu, 19 Dec 2019 17:22:40 +0000 (17:22 +0000)]
Merge #2600

2600: Plumbing for local items support r=matklad a=matklad

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoImplement ChildBySource for DefWithBody
Aleksey Kladov [Thu, 19 Dec 2019 17:21:26 +0000 (18:21 +0100)]
Implement ChildBySource for DefWithBody

4 years agoAdd body as a possible container for items
Aleksey Kladov [Thu, 19 Dec 2019 17:12:46 +0000 (18:12 +0100)]
Add body as a possible container for items

4 years agoAllow storing defs in bodies
Aleksey Kladov [Thu, 19 Dec 2019 16:30:28 +0000 (17:30 +0100)]
Allow storing defs in bodies

4 years agoMerge #2599
bors[bot] [Thu, 19 Dec 2019 17:08:12 +0000 (17:08 +0000)]
Merge #2599

2599: Drop dead code r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDrop dead code
Aleksey Kladov [Thu, 19 Dec 2019 17:07:39 +0000 (18:07 +0100)]
Drop dead code

4 years agoMerge #2598
bors[bot] [Thu, 19 Dec 2019 16:15:19 +0000 (16:15 +0000)]
Merge #2598

2598: Touch up TokenSet a bit r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoTouch up TokenSet a bit
Aleksey Kladov [Thu, 19 Dec 2019 16:13:08 +0000 (17:13 +0100)]
Touch up TokenSet a bit

4 years agoMerge #2597
bors[bot] [Thu, 19 Dec 2019 16:04:24 +0000 (16:04 +0000)]
Merge #2597

2597: Handle start imports in import groups r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoHandle start imports in import groups
Aleksey Kladov [Thu, 19 Dec 2019 15:57:22 +0000 (16:57 +0100)]
Handle start imports in import groups

4 years agoMerge #2594
bors[bot] [Thu, 19 Dec 2019 15:35:42 +0000 (15:35 +0000)]
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>
4 years agoMerge #2596
bors[bot] [Thu, 19 Dec 2019 15:27:45 +0000 (15:27 +0000)]
Merge #2596

2596: Refactor macro tests r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRefactor macro tests
Aleksey Kladov [Thu, 19 Dec 2019 15:17:22 +0000 (16:17 +0100)]
Refactor macro tests

4 years agoRemove the setting change reminder
Kirill Bulatov [Thu, 19 Dec 2019 15:11:07 +0000 (17:11 +0200)]
Remove the setting change reminder

4 years agoOmit default types for hover pop-ups
Kirill Bulatov [Thu, 19 Dec 2019 14:47:09 +0000 (16:47 +0200)]
Omit default types for hover pop-ups

4 years agoRemove TruncateOptions struct
Kirill Bulatov [Thu, 19 Dec 2019 14:43:41 +0000 (16:43 +0200)]
Remove TruncateOptions struct

4 years agoUse build_for_def
Edwin Cheng [Thu, 19 Dec 2019 14:28:52 +0000 (22:28 +0800)]
Use build_for_def

4 years agoDo not add any new configuration parameters
Kirill Bulatov [Thu, 19 Dec 2019 14:18:09 +0000 (16:18 +0200)]
Do not add any new configuration parameters

4 years agoMerge #2595
bors[bot] [Thu, 19 Dec 2019 13:45:10 +0000 (13:45 +0000)]
Merge #2595

2595: Fix parsing of interpolated expressions r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoFix parsing of interpolated expressions
Aleksey Kladov [Thu, 19 Dec 2019 13:43:19 +0000 (14:43 +0100)]
Fix parsing of interpolated expressions

4 years agoEnsure hover shows full type declaration
Kirill Bulatov [Thu, 19 Dec 2019 10:45:00 +0000 (12:45 +0200)]
Ensure hover shows full type declaration

4 years agoOmit default parameter types
Kirill Bulatov [Sat, 7 Dec 2019 22:54:18 +0000 (00:54 +0200)]
Omit default parameter types

4 years agoAdd std::ops::Index support for infering
Edwin Cheng [Thu, 19 Dec 2019 04:45:07 +0000 (12:45 +0800)]
Add std::ops::Index support for infering

4 years agoMerge #2589 #2591
bors[bot] [Wed, 18 Dec 2019 16:54:28 +0000 (16:54 +0000)]
Merge #2589 #2591

2589: Touch up docs r=matklad a=matklad

2591: Remove dead code r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRemove dead code
Aleksey Kladov [Wed, 18 Dec 2019 16:52:52 +0000 (17:52 +0100)]
Remove dead code

4 years agoMerge #2311
bors[bot] [Wed, 18 Dec 2019 16:44:35 +0000 (16:44 +0000)]
Merge #2311

2311: See through Macros for SignatureHelp r=matklad a=kjeremy

Note: we meed to skip the trivia filter to make sure that
`covers!(call_info_bad_offset)` succeeds otherwise we exit call_info
too early.

Also the test doesn't pass: `FnCallNode::with_node` always detects
a MacroCall which is obviously wrong.

Fixes #2310

Co-authored-by: kjeremy <kjeremy@gmail.com>
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4 years agoTouch up docs
Aleksey Kladov [Wed, 18 Dec 2019 16:42:49 +0000 (17:42 +0100)]
Touch up docs

4 years agoForbid <T>::foo syntax in mod paths
Aleksey Kladov [Wed, 18 Dec 2019 16:41:33 +0000 (17:41 +0100)]
Forbid <T>::foo syntax in mod paths

4 years agoMove PathKindUp
Aleksey Kladov [Wed, 18 Dec 2019 16:06:52 +0000 (17:06 +0100)]
Move PathKindUp

4 years agoTouch up docs
Aleksey Kladov [Wed, 18 Dec 2019 16:04:20 +0000 (17:04 +0100)]
Touch up docs

4 years agoMerge #2588
bors[bot] [Wed, 18 Dec 2019 15:47:58 +0000 (15:47 +0000)]
Merge #2588

2588: Don't bother with focus range for navigation to locals r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDon't bother with focus range for navigation to locals
Aleksey Kladov [Wed, 18 Dec 2019 15:25:15 +0000 (16:25 +0100)]
Don't bother with focus range for navigation to locals

4 years agoMerge #2587
bors[bot] [Wed, 18 Dec 2019 15:04:08 +0000 (15:04 +0000)]
Merge #2587

2587: Refactor goto tests to always specify texts r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRefactor goto tests to always specify texts
Aleksey Kladov [Wed, 18 Dec 2019 14:33:36 +0000 (15:33 +0100)]
Refactor goto tests to always specify texts

4 years agoAdd blank lines for readability
Aleksey Kladov [Wed, 18 Dec 2019 13:52:58 +0000 (14:52 +0100)]
Add blank lines for readability

4 years agoMerge #2586
bors[bot] [Wed, 18 Dec 2019 14:47:04 +0000 (14:47 +0000)]
Merge #2586

2586: Make reformat hook actually reformat files r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMake reformat hook actually reformat files
Aleksey Kladov [Wed, 18 Dec 2019 14:40:48 +0000 (15:40 +0100)]
Make reformat hook actually reformat files

4 years agocargo fmt
Jeremy Kolb [Wed, 18 Dec 2019 14:11:47 +0000 (09:11 -0500)]
cargo fmt

4 years agoPass test
Jeremy Kolb [Wed, 18 Dec 2019 13:58:48 +0000 (08:58 -0500)]
Pass test

4 years agoMerge #2585
bors[bot] [Wed, 18 Dec 2019 13:56:36 +0000 (13:56 +0000)]
Merge #2585

2585: Cleanup Vim and NeoVim instructions. Fix #2579 r=oblitum a=oblitum

I took some freedom to remove additional tips that I simply considered unnecessary as I view it as responsibility of plugin's own docs.

Co-authored-by: Francisco Lopes <francisco@oblita.com>
4 years agoWIP: See through Macros for SignatureHelp
kjeremy [Mon, 18 Nov 2019 23:08:39 +0000 (18:08 -0500)]
WIP: See through Macros for SignatureHelp

Note: we meed to skip the trivia filter to make sure that
`covers!(call_info_bad_offset)` succeeds otherwise we exit call_info
too early.

Also the test doesn't pass: `FnCallNode::with_node` always detects
a MacroCall.

4 years agoMerge #2545
bors[bot] [Wed, 18 Dec 2019 11:47:50 +0000 (11:47 +0000)]
Merge #2545

2545: Add Token id to all tt::TokenTree r=matklad a=edwin0cheng

This PR try to add token id to all `tt::Leaf` and `tt::Delimiter`.

~~Some tests are failed now because of #2544~~

~~Still blocked by a test in goto-definition : see https://github.com/rust-analyzer/rust-analyzer/pull/2544#issuecomment-565572553~~

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoRefactoring
Edwin Cheng [Wed, 18 Dec 2019 03:47:26 +0000 (11:47 +0800)]
Refactoring

4 years agoRename range to by_kind
Edwin Cheng [Wed, 18 Dec 2019 03:36:10 +0000 (11:36 +0800)]
Rename range to by_kind

4 years agoAdd test for token map
Edwin Cheng [Fri, 13 Dec 2019 19:39:15 +0000 (03:39 +0800)]
Add test for token map

4 years agoFix shift id for delim and other tokens
Edwin Cheng [Fri, 13 Dec 2019 19:37:04 +0000 (03:37 +0800)]
Fix shift id for delim and other tokens

4 years agoAdd TokenTextRange
Edwin Cheng [Fri, 13 Dec 2019 15:55:51 +0000 (23:55 +0800)]
Add TokenTextRange

4 years agoAdd token id to delims
Edwin Cheng [Thu, 12 Dec 2019 17:41:44 +0000 (01:41 +0800)]
Add token id to delims

4 years agoAdd token ids for all tt::Leaf
Edwin Cheng [Thu, 12 Dec 2019 13:47:54 +0000 (21:47 +0800)]
Add token ids for all tt::Leaf

4 years agoMerge #2575
bors[bot] [Wed, 18 Dec 2019 03:03:51 +0000 (03:03 +0000)]
Merge #2575

2575: [VS Code Extension] Remap error location if it extracted inside macros r=edwin0cheng a=edwin0cheng

It should fix for #2569

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoUse substr instead of endswith
Edwin Cheng [Tue, 17 Dec 2019 13:43:19 +0000 (21:43 +0800)]
Use substr instead of endswith

4 years agoAdd tests
Edwin Cheng [Tue, 17 Dec 2019 05:50:08 +0000 (13:50 +0800)]
Add tests

4 years agoAdd macro span handling
Edwin Cheng [Tue, 17 Dec 2019 05:50:00 +0000 (13:50 +0800)]
Add macro span handling

4 years agoCleanup Vim and NeoVim instructions. Fix #2579
Francisco Lopes [Tue, 17 Dec 2019 23:47:20 +0000 (20:47 -0300)]
Cleanup Vim and NeoVim instructions. Fix #2579

4 years agoMerge #2583
bors[bot] [Tue, 17 Dec 2019 21:12:18 +0000 (21:12 +0000)]
Merge #2583

2583: Use prettier settings in ts-lint r=matklad a=edwin0cheng

This PR add `tslint-plugin-prettier` extension in ts-lint, which "runs prettier rules as tslint rules." and remove  `quotemark` from ts-lint and let prettier to handle it.

And also fix #2515

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>