]> git.lizzy.rs Git - rust.git/log
rust.git
3 years agoAdd ConstParams to the HIR
Lukas Wirth [Fri, 1 Jan 2021 09:06:42 +0000 (10:06 +0100)]
Add ConstParams to the HIR

3 years agoMerge #7060
bors[bot] [Mon, 28 Dec 2020 12:34:19 +0000 (12:34 +0000)]
Merge #7060

7060: Fix mbe fail to pass expr with attr r=edwin0cheng a=edwin0cheng

bors r+

Fixes #5896

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoMerge #7059
bors[bot] [Mon, 28 Dec 2020 12:26:55 +0000 (12:26 +0000)]
Merge #7059

7059: Special case $_ in meta var instead of treat it as ident in mbe  r=lnicola a=edwin0cheng

In #6929, we treat '_' as an ident but rustc is only allow it in some special places (e.g. meta var in mbe , type, pat etc).

This PR rollback that and we only make '$_' works in meta var matching.

Fixes #7056

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoFixed old failed test due to new fixes
Edwin Cheng [Mon, 28 Dec 2020 12:08:50 +0000 (20:08 +0800)]
Fixed old failed test due to new fixes

3 years agoFix mbe fail to pass expr with attr
Edwin Cheng [Mon, 28 Dec 2020 11:53:00 +0000 (19:53 +0800)]
Fix mbe fail to pass expr with attr

3 years agoSpecial case underscore in mbe meta op
Edwin Cheng [Mon, 28 Dec 2020 10:51:43 +0000 (18:51 +0800)]
Special case underscore in mbe meta op

3 years agoRollback 6929
Edwin Cheng [Mon, 28 Dec 2020 10:47:00 +0000 (18:47 +0800)]
Rollback 6929

3 years agoMerge #7058
bors[bot] [Mon, 28 Dec 2020 10:44:38 +0000 (10:44 +0000)]
Merge #7058

7058: Improve commit message style r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoImprove commit message style
Aleksey Kladov [Mon, 28 Dec 2020 10:43:07 +0000 (13:43 +0300)]
Improve commit message style

3 years agoMerge #7050
bors[bot] [Sun, 27 Dec 2020 16:42:01 +0000 (16:42 +0000)]
Merge #7050

7050: Ignore third punct when matching for 2-composite punct in mbe r=jonas-schievink a=edwin0cheng

Fixes #6692

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoIgnore third punct in 2-composite punct
Edwin Cheng [Sun, 27 Dec 2020 15:51:00 +0000 (23:51 +0800)]
Ignore third punct in 2-composite punct

3 years agoMerge #6820
bors[bot] [Sun, 27 Dec 2020 14:39:05 +0000 (14:39 +0000)]
Merge #6820

6820: Pass the crate environment to proc macros r=jonas-schievink a=jonas-schievink

In theory, fixes https://github.com/rust-analyzer/rust-analyzer/issues/6696.

This seems to result in these obscure crashes for some reason:

```
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/scoped_cell.rs:75:51
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/std/src/panicking.rs:483
   1: core::panicking::panic_fmt
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:85
   2: core::panicking::panic
             at /rustc/7eac88abb2e57e752f3302f02be5f3ce3d7adfb4/library/core/src/panicking.rs:50
   3: core::option::Option<T>::unwrap
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:383
   4: proc_macro::bridge::scoped_cell::ScopedCell<T>::replace
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/scoped_cell.rs:75
   5: proc_macro::bridge::client::BridgeState::with::{{closure}}
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:291
   6: std::thread::local::LocalKey<T>::try_with
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:272
   7: std::thread::local::LocalKey<T>::with
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:248
   8: proc_macro::bridge::client::BridgeState::with
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:290
   9: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:329
  10: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:375
  11: proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}}
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/scoped_cell.rs:80
  12: proc_macro::bridge::scoped_cell::ScopedCell<T>::replace
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/scoped_cell.rs:75
  13: proc_macro::bridge::scoped_cell::ScopedCell<T>::set
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/scoped_cell.rs:80
  14: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:325
  15: std::thread::local::LocalKey<T>::try_with
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:272
  16: std::thread::local::LocalKey<T>::with
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:248
  17: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:325
  18: proc_macro::bridge::client::run_client::{{closure}}
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:370
  19: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:308
  20: std::panicking::try::do_call
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:381
  21: __rust_try
  22: std::panicking::try
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs:345
  23: std::panic::catch_unwind
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs:382
  24: proc_macro::bridge::client::run_client
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:369
  25: proc_macro::bridge::client::Client<fn(proc_macro::TokenStream) .> proc_macro::TokenStream>::expand1::run
             at /home/jonas/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:410
  26: proc_macro_srv::proc_macro::bridge::server::run_server
  27: proc_macro_srv::dylib::Expander::expand
  28: proc_macro_srv::ProcMacroSrv::expand
  29: proc_macro_srv::cli::run
  30: rust_analyzer::main
```

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoPass crate environment to proc macros
Jonas Schievink [Fri, 11 Dec 2020 13:57:50 +0000 (14:57 +0100)]
Pass crate environment to proc macros

3 years agoMove TokenExpander to base_db and rename it
Jonas Schievink [Fri, 11 Dec 2020 13:24:02 +0000 (14:24 +0100)]
Move TokenExpander to base_db and rename it

It's only used to break the dependency to proc_macro_api

3 years agoMerge #7047
bors[bot] [Sun, 27 Dec 2020 13:30:06 +0000 (13:30 +0000)]
Merge #7047

7047: Add force_show_panics flag for proc-macro bridge r=jonas-schievink a=edwin0cheng

https://github.com/rust-lang/rust/pull/75082 and https://github.com/rust-lang/rust/pull/76292 added a new flag in `proc_macro::Bridge` such that the ABI was changed. These ABI changing are the reason of some weird panics which caused #6880 and maybe related to the panic mentioned in #6820.

These changes are landed on rust stable 1.48 so I think it is okay to apply it now.

fixes #6880

r @jonas-schievink

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoAdd force_show_panics flag
Edwin Cheng [Sun, 27 Dec 2020 10:00:59 +0000 (18:00 +0800)]
Add force_show_panics flag

3 years agoMerge #7043
bors[bot] [Sat, 26 Dec 2020 11:14:19 +0000 (11:14 +0000)]
Merge #7043

7043: Simplify assists resolution API r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoSimplify assists resolution API
Aleksey Kladov [Sat, 26 Dec 2020 11:11:42 +0000 (14:11 +0300)]
Simplify assists resolution API

Assist vs UnresolvedAssist split doesn't really pull its weight. This
is especially bad if we want to include `Assist` as a field of
diagnostics, where we'd have to make the thing generic.

3 years agoMerge #7038
bors[bot] [Fri, 25 Dec 2020 17:17:14 +0000 (17:17 +0000)]
Merge #7038

7038: Fix type typo in add_missing_impl_members doc r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoFix type typo in add_missing_impl_members doc
Lukas Wirth [Fri, 25 Dec 2020 17:15:31 +0000 (18:15 +0100)]
Fix type typo in add_missing_impl_members doc

3 years agoMerge #7036
bors[bot] [Fri, 25 Dec 2020 10:25:58 +0000 (10:25 +0000)]
Merge #7036

7036: Don't split path separators apart in doctest runnables r=Veykril a=Veykril

Fixes #7035

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't split path separators apart in doctest runnables
Lukas Wirth [Fri, 25 Dec 2020 10:22:11 +0000 (11:22 +0100)]
Don't split path separators apart in doctest runnables

3 years agoMerge #7032
bors[bot] [Thu, 24 Dec 2020 16:38:10 +0000 (16:38 +0000)]
Merge #7032

7032: Simplify more r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoSimplify more
Aleksey Kladov [Thu, 24 Dec 2020 16:36:13 +0000 (19:36 +0300)]
Simplify more

3 years agoMerge #7031
bors[bot] [Thu, 24 Dec 2020 15:06:38 +0000 (15:06 +0000)]
Merge #7031

7031: Simplify r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoSimplify
Aleksey Kladov [Thu, 24 Dec 2020 14:54:44 +0000 (17:54 +0300)]
Simplify

3 years agoMerge #7030
bors[bot] [Thu, 24 Dec 2020 14:46:41 +0000 (14:46 +0000)]
Merge #7030

7030: Support labels in reference search r=matklad a=Veykril

Implements general navigation for labels, goto def, rename and gives labels their own semantic highlighting class.

Fixes #6966

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoSupport labels in reference search
Lukas Wirth [Wed, 23 Dec 2020 16:15:01 +0000 (17:15 +0100)]
Support labels in reference search

3 years agoMerge #7029
bors[bot] [Thu, 24 Dec 2020 13:40:29 +0000 (13:40 +0000)]
Merge #7029

7029: Flush stdout when clearing the progress bar r=lnicola a=lnicola

To prevent this from happening:

```
Database loaded 496.24ms, 288mi
Crates in this dir: 1
Total modules found: 14
Total declarations: 159
Total functions: 122
Item Collection: 6.02s, 61846mi
122/122 100% processing: archive::sizeTotal expressions: 6592
Expressions of unknown type: 4 (0%)
Expressions of partially unknown type: 104 (1%)
Type mismatches: 3
Inference: 1.03s, 8622mi
Total: 7.05s, 70468mi
```

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoFlush stdout when clearing the progress bar
Laurențiu Nicola [Thu, 24 Dec 2020 13:38:40 +0000 (15:38 +0200)]
Flush stdout when clearing the progress bar

3 years agoMerge #7028
bors[bot] [Thu, 24 Dec 2020 12:50:30 +0000 (12:50 +0000)]
Merge #7028

7028: pit-of-success API for unresolved code actions r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agopit-of-success API for unresolved code actions
Aleksey Kladov [Thu, 24 Dec 2020 12:32:29 +0000 (15:32 +0300)]
pit-of-success API for unresolved code actions

3 years agoMerge #7021
bors[bot] [Thu, 24 Dec 2020 12:04:28 +0000 (12:04 +0000)]
Merge #7021

7021: Track labels in the HIR r=matklad a=Veykril

Groundwork for #6966

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoTrack labels in the HIR
Lukas Wirth [Wed, 23 Dec 2020 15:34:30 +0000 (16:34 +0100)]
Track labels in the HIR

3 years agoMerge #7027
bors[bot] [Thu, 24 Dec 2020 08:44:52 +0000 (08:44 +0000)]
Merge #7027

7027: Fix macro_rules not accepting brackets or parentheses r=matklad,lnicola a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoFix macro_rules not accepting brackets or parentheses
Lukas Wirth [Thu, 24 Dec 2020 08:26:03 +0000 (09:26 +0100)]
Fix macro_rules not accepting brackets or parentheses

3 years agoMerge #7026
bors[bot] [Thu, 24 Dec 2020 06:29:02 +0000 (06:29 +0000)]
Merge #7026

7026: chore: update coc-rust-analyzer inlay hints support r=lnicola a=fannheyward

coc-rust-analyzer now supports inlay hints for variables and method chaining.

Co-authored-by: Heyward Fann <fannheyward@users.noreply.github.com>
3 years agoUpdate manual.adoc
Heyward Fann [Thu, 24 Dec 2020 03:38:01 +0000 (11:38 +0800)]
Update manual.adoc

3 years agoMerge #7020
bors[bot] [Wed, 23 Dec 2020 19:50:04 +0000 (19:50 +0000)]
Merge #7020

7020: Implement const pat and expr inference r=flodiebold a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #7022
bors[bot] [Wed, 23 Dec 2020 19:44:27 +0000 (19:44 +0000)]
Merge #7022

7022: Prevent multiple incorrect case diagnostics in functions r=lnicola a=unexge

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6970

Co-authored-by: unexge <unexge@gmail.com>
3 years agoPrevent multiple incorrect case diagnostics in functions
unexge [Wed, 23 Dec 2020 19:18:31 +0000 (22:18 +0300)]
Prevent multiple incorrect case diagnostics in functions

3 years agoMerge #7009
bors[bot] [Wed, 23 Dec 2020 12:55:25 +0000 (12:55 +0000)]
Merge #7009

7009: Implement workspace/willRenameFiles for single-level file moves r=matklad a=kjeremy

Automatically rename modules during file rename if they're in the same directory.

Fixes #6780

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
3 years agoImplement workspace/willRenameFiles for single-level file moves
Jeremy Kolb [Tue, 22 Dec 2020 19:19:51 +0000 (14:19 -0500)]
Implement workspace/willRenameFiles for single-level file moves

Renames modules during file rename if they're in the same directory.

3 years agoMerge #7019
bors[bot] [Wed, 23 Dec 2020 12:04:32 +0000 (12:04 +0000)]
Merge #7019

7019: Try serde_path_to_error for LSP InitializeParams r=matklad a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoImplement const block inference
Lukas Wirth [Wed, 23 Dec 2020 11:24:24 +0000 (12:24 +0100)]
Implement const block inference

3 years agoTry serde_path_to_error for LSP InitializeParams
Laurențiu Nicola [Wed, 23 Dec 2020 11:21:58 +0000 (13:21 +0200)]
Try serde_path_to_error for LSP InitializeParams

3 years agoImplement const pat inference
Lukas Wirth [Wed, 23 Dec 2020 11:15:38 +0000 (12:15 +0100)]
Implement const pat inference

3 years agoMerge #7016
bors[bot] [Wed, 23 Dec 2020 11:04:07 +0000 (11:04 +0000)]
Merge #7016

7016: Bump deps r=flodiebold a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoBump deps
Laurențiu Nicola [Wed, 23 Dec 2020 09:46:36 +0000 (11:46 +0200)]
Bump deps

3 years agoBump chalk
Laurențiu Nicola [Wed, 23 Dec 2020 09:41:03 +0000 (11:41 +0200)]
Bump chalk

3 years agoMerge #7018
bors[bot] [Wed, 23 Dec 2020 10:51:56 +0000 (10:51 +0000)]
Merge #7018

7018: Cleanup handle_code_action r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMake code more direct
Aleksey Kladov [Wed, 23 Dec 2020 10:36:57 +0000 (13:36 +0300)]
Make code more direct

* Push control flow outwards, as per
  https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/dev/style.md#preconditions

* Don't re-do the work, pass-in the arguments

3 years agoMerge #7010
bors[bot] [Wed, 23 Dec 2020 10:37:30 +0000 (10:37 +0000)]
Merge #7010

7010: Update ungrammar for const block patterns r=matklad a=Veykril

Fixes #6848

Adds const blocks and const block patterns to the AST and parses them.

Blocked on https://github.com/rust-analyzer/ungrammar/pull/17/, will merge that PR there once this one gets the OK so I can remove the local ungrammar dependency path and fix the Cargo.lock.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoRemove local ungrammar dependency
Lukas Wirth [Wed, 23 Dec 2020 10:22:36 +0000 (11:22 +0100)]
Remove local ungrammar dependency

3 years agoMake code more understandable
Aleksey Kladov [Wed, 23 Dec 2020 10:16:24 +0000 (13:16 +0300)]
Make code more understandable

Avoid mutation of snapshot's config -- that's spooky action at a
distance. Instead, copy it over to a local variable.

This points out a minor architecture problem, which we won't fix right
away.

Various `ide`-level config structs, like `AssistConfig`, are geared
towards one-shot use when calling a specific methods. On the other
hand, the large `Config` struct in `rust-analyzer` is a long-term
config store.

The fact that `Config` stores `AssistConfig` is accidental -- a better
design would probably be to just store `ConfigData` inside `Config`
and create various `Config`s on the fly out of it.

3 years agoRename for clarity
Aleksey Kladov [Wed, 23 Dec 2020 09:58:49 +0000 (12:58 +0300)]
Rename for clarity

3 years agoMerge #7017
bors[bot] [Wed, 23 Dec 2020 10:02:11 +0000 (10:02 +0000)]
Merge #7017

7017: Document `make` module design r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoDocument `make` module design
Aleksey Kladov [Wed, 23 Dec 2020 10:01:27 +0000 (13:01 +0300)]
Document `make` module design

3 years agoMerge #6960
bors[bot] [Wed, 23 Dec 2020 09:48:04 +0000 (09:48 +0000)]
Merge #6960

6960: Show enum variant on Self qualified paths r=matklad a=Veykril

Fixes first part of #6549
Fixes #6550

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoBump rustc_lexer
Laurențiu Nicola [Wed, 23 Dec 2020 09:24:52 +0000 (11:24 +0200)]
Bump rustc_lexer

3 years agoMerge #7015
bors[bot] [Wed, 23 Dec 2020 08:49:36 +0000 (08:49 +0000)]
Merge #7015

7015: Disable the unaligned feature of the object crate r=lnicola a=lnicola

We `mmap` the files so they should be reasonably aligned.

Let's see what https://github.com/rust-analyzer/rust-analyzer/pull/6817#issuecomment-744866239 is about.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoDisable unaligned feature for the object crate
Laurențiu Nicola [Wed, 23 Dec 2020 08:40:12 +0000 (10:40 +0200)]
Disable unaligned feature for the object crate

3 years agoMerge #7014
bors[bot] [Wed, 23 Dec 2020 08:38:29 +0000 (08:38 +0000)]
Merge #7014

7014: Set RA_TARGET at job level r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoSet RA_TARGET at job level
Laurențiu Nicola [Wed, 23 Dec 2020 08:13:19 +0000 (10:13 +0200)]
Set RA_TARGET at job level

3 years agoMerge #7013
bors[bot] [Wed, 23 Dec 2020 08:04:35 +0000 (08:04 +0000)]
Merge #7013

7013: Don't think that /submod.rs is /mod.rs r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoDon't think that /submod.rs is /mod.rs
Aleksey Kladov [Tue, 22 Dec 2020 16:18:45 +0000 (19:18 +0300)]
Don't think that /submod.rs is /mod.rs

3 years agoMerge #7012
bors[bot] [Wed, 23 Dec 2020 07:47:40 +0000 (07:47 +0000)]
Merge #7012

7012: Document, how to view config in effect r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoDocument, how to view config in effect
Aleksey Kladov [Wed, 23 Dec 2020 07:47:05 +0000 (10:47 +0300)]
Document, how to view config in effect

3 years agoMerge #7011
bors[bot] [Wed, 23 Dec 2020 07:03:43 +0000 (07:03 +0000)]
Merge #7011

7011: Don't release uncompressed binaries under the new naming scheme r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoDon't release uncompressed binaries under the new naming scheme
Laurențiu Nicola [Wed, 23 Dec 2020 06:34:10 +0000 (08:34 +0200)]
Don't release uncompressed binaries under the new naming scheme

3 years agoMerge #7000
bors[bot] [Wed, 23 Dec 2020 06:22:28 +0000 (06:22 +0000)]
Merge #7000

7000: Store invocation site for eager macros r=edwin0cheng a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6992

r? @edwin0cheng

I'm not sure if this is totally correct, it looks like we create **two** `EagerCallLoc`s per macro invocation, one for the arguments (?), and one for the actual macro call. I gave both the same `AstId`, hopefully that's correct.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoParse const effect block
Lukas Wirth [Wed, 23 Dec 2020 01:15:30 +0000 (02:15 +0100)]
Parse const effect block

3 years agoParse ConstBlockPat
Lukas Wirth [Wed, 23 Dec 2020 00:49:43 +0000 (01:49 +0100)]
Parse ConstBlockPat

3 years agoUpdate ungrammar for const block patterns
Lukas Wirth [Wed, 23 Dec 2020 00:26:31 +0000 (01:26 +0100)]
Update ungrammar for const block patterns

3 years agoMerge #6964
bors[bot] [Tue, 22 Dec 2020 18:03:51 +0000 (18:03 +0000)]
Merge #6964

6964: Add full pattern completions for Struct and Variant patterns r=matklad a=Veykril

Just gonna call it full pattern completion as pattern completion is already implemented in a sense by showing idents in pattern position. What this does is basically complete struct and variant patterns where applicable(function params, let statements and refutable pattern locations).

This does not replace just completing the corresponding idents of the structs and variants, instead two completions are shown for these, a completion for the ident itself and a completion for the pattern(if the pattern make sense to be used that is). I figured in some cases one would rather type out the pattern manually if it has a lot of fields but you only care about one since this completion would cause one more work in the end since you would have to delete all the extra matched fields again.

These completions are tagged as `CompletionKind::Snippet`, not sure if that is the right one here.
<details>
  <summary>some gifs</summary>

![dx2lxgzhj3](https://user-images.githubusercontent.com/3757771/102719967-6987ef80-42f1-11eb-8ae0-8aff53777860.gif)
![EP2E7sJLkB](https://user-images.githubusercontent.com/3757771/102785777-c7264580-439e-11eb-8a64-f142e19fb65b.gif)
![JMNHHWknr9](https://user-images.githubusercontent.com/3757771/102785796-d1e0da80-439e-11eb-934b-218ada31b51c.gif)
</details>

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoReduce some more code duplication
Lukas Wirth [Tue, 22 Dec 2020 18:00:38 +0000 (19:00 +0100)]
Reduce some more code duplication

3 years agoMerge #7001
bors[bot] [Tue, 22 Dec 2020 16:38:12 +0000 (16:38 +0000)]
Merge #7001

7001: Add support for downloading aarch64-apple-darwin binaries r=matklad a=lnicola

There's also a slight behavior change here: we no longer download our 64-binaries on 32-bit Darwin and Linux. We still do that on Windows, as I don't know how to detect 32-bit Node on 64 Windows.

But some people install the 32-bit Code by mistake, I doubt 32-bit Windows is that popular in the Rust crowd.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoMerge #7005
bors[bot] [Tue, 22 Dec 2020 16:15:20 +0000 (16:15 +0000)]
Merge #7005

7005: Improve extract_module_to_file assist r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoImprove extract_module_to_file assist
Aleksey Kladov [Tue, 22 Dec 2020 16:13:53 +0000 (19:13 +0300)]
Improve extract_module_to_file assist

* simplify code
* correctly handle crate roots and mod.rs files (nested inline modules
  are still mishandled)
* make sure that new text contains a trailing newline

3 years agoMerge #7002
bors[bot] [Tue, 22 Dec 2020 15:23:36 +0000 (15:23 +0000)]
Merge #7002

7002: Extension conflict check detects more combinations r=extremegf a=extremegf

This will also detect conflicts with kalitaalexey.vscode-rust and work correctly after RA is integrated with rust-lang.rust extension.

Co-authored-by: Przemyslaw Horban <p.horban@invinets.com>
Co-authored-by: P. Horban <extremegf@gmail.com>
3 years agoFix grammar nit
P. Horban [Tue, 22 Dec 2020 15:22:33 +0000 (16:22 +0100)]
Fix grammar nit

Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
3 years agoMerge #6993
bors[bot] [Tue, 22 Dec 2020 15:07:36 +0000 (15:07 +0000)]
Merge #6993

6993: Clean up descriptions for settings r=matklad a=rherrmann

Use two consecutive newlines (`\n\n`) to actually continue text on a
new line.

Use proper markup to reference related settings.

Consistently format references to files, command line arguments, etc.
as `code`. Format mentions of UI elements in _italic_.

Fix typos, add missing full-stops, add missing default values.

Co-authored-by: RĂĽdiger Herrmann <ruediger.herrmann@gmx.de>
3 years agoExtension conflict check detests more combinations
Przemyslaw Horban [Tue, 22 Dec 2020 14:52:41 +0000 (15:52 +0100)]
Extension conflict check detests more combinations

3 years agoAdd support for downloading aarch64-apple-darwin binaries, change naming convention
Laurențiu Nicola [Tue, 22 Dec 2020 14:46:01 +0000 (16:46 +0200)]
Add support for downloading aarch64-apple-darwin binaries, change naming convention

3 years agoStore invocation site for eager macros
Jonas Schievink [Tue, 22 Dec 2020 13:42:28 +0000 (14:42 +0100)]
Store invocation site for eager macros

3 years agoClean up descriptions for settings
RĂĽdiger Herrmann [Tue, 22 Dec 2020 00:15:50 +0000 (01:15 +0100)]
Clean up descriptions for settings

Use two consecutive newlines (`\n\n`) to actually continue text on a
new line.

Use proper markup to reference related settings.

Consistently format references to files, editor commands, command line
arguments, files, etc. as `code`.

Fix typos, add missing full-stops, add missing default values.

3 years agoMerge #6999
bors[bot] [Tue, 22 Dec 2020 13:19:27 +0000 (13:19 +0000)]
Merge #6999

6999: Build aarch64-apple-darwin binaries on CI (take 2) r=matklad a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoBuild aarch64-apple-darwin binaries on CI
Laurențiu Nicola [Mon, 21 Dec 2020 19:06:46 +0000 (21:06 +0200)]
Build aarch64-apple-darwin binaries on CI

3 years agoMerge #6989
bors[bot] [Tue, 22 Dec 2020 13:12:22 +0000 (13:12 +0000)]
Merge #6989

6989: Build aarch64-apple-darwin binaries on CI r=matklad a=lnicola

This splits the `dist` matrix job into four and tries to make `xtask dist` more principled about target and artifact naming.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoBuild aarch64-apple-darwin binaries on CI
Laurențiu Nicola [Mon, 21 Dec 2020 19:06:46 +0000 (21:06 +0200)]
Build aarch64-apple-darwin binaries on CI

3 years agoMerge #6746
bors[bot] [Tue, 22 Dec 2020 10:04:24 +0000 (10:04 +0000)]
Merge #6746

6746: Feature/add assist extract module to file r=matklad a=sasurau4

Fix #6522

## Screenshot

<img src="https://user-images.githubusercontent.com/13580199/102748269-33a44300-43a5-11eb-9e37-f5fcb8e62f73.gif" width=600 />

## TODO

- [x] Remove all TODO comment
- [x] Pass the doc test

Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
3 years agoMerge #6984
bors[bot] [Tue, 22 Dec 2020 04:02:28 +0000 (04:02 +0000)]
Merge #6984

6984: Remove TextMate grammar r=dustypomerleau a=lnicola

Closes #6267

This is now included upstream in VS Code.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoMerge #6991
bors[bot] [Mon, 21 Dec 2020 19:40:38 +0000 (19:40 +0000)]
Merge #6991

6991: Don't download x64 binaries on non-Mac arm64 r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoDon't download x64 binaries on non-Mac arm64
Laurențiu Nicola [Mon, 21 Dec 2020 19:40:01 +0000 (21:40 +0200)]
Don't download x64 binaries on non-Mac arm64

3 years agoMerge #6990
bors[bot] [Mon, 21 Dec 2020 19:28:37 +0000 (19:28 +0000)]
Merge #6990

6990: Allow code extension to download binary in apple arm r=lnicola a=phungleson

Apple chip has a new `arch`. It subsequently downloads Intel version of `rust-analyzer` but it works regardless.

Co-authored-by: Son <leson.phung@gmail.com>
3 years agoAllow code extension to download binary in apple arm
Son [Mon, 21 Dec 2020 19:23:50 +0000 (06:23 +1100)]
Allow code extension to download binary in apple arm

3 years agoMerge #6988
bors[bot] [Mon, 21 Dec 2020 18:37:37 +0000 (18:37 +0000)]
Merge #6988

6988: Remove outdated FIXME r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoRemove outdated FIXME
Laurențiu Nicola [Mon, 21 Dec 2020 18:36:58 +0000 (20:36 +0200)]
Remove outdated FIXME

3 years agoMerge #6985
bors[bot] [Mon, 21 Dec 2020 18:21:49 +0000 (18:21 +0000)]
Merge #6985

6985: Use /etc/os-release to check for NixOS r=matklad a=lnicola

Closes #5641

The motivation in #5641 isn't too strong, but /etc/os-release exists on pretty much every Linux distro, while /etc/nixos sounds like an implementation detail.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoMerge #6987
bors[bot] [Mon, 21 Dec 2020 18:15:17 +0000 (18:15 +0000)]
Merge #6987

6987: Delete related whitespace when removing unused param r=matklad a=rherrmann

Include adjacent whitespace in the text edits to remove the
parameter declaration and its occurences in calling code.

https://github.com/rust-analyzer/rust-analyzer/issues/6663

Co-authored-by: RĂĽdiger Herrmann <ruediger.herrmann@gmx.de>