]> git.lizzy.rs Git - rust.git/log
rust.git
3 years ago7708: Added the logic to check is default impl is already present.
Chetan Khilosiya [Thu, 4 Mar 2021 18:26:18 +0000 (23:56 +0530)]
7708: Added the logic to check is default impl is already present.

Also added test cases for code present within module.

3 years ago7708: Updated generate default fn logic.
Chetan Khilosiya [Mon, 1 Mar 2021 20:04:18 +0000 (01:34 +0530)]
7708: Updated generate default fn logic.

3 years ago7708: Added the work for review comments.
Chetan Khilosiya [Mon, 1 Mar 2021 19:19:19 +0000 (00:49 +0530)]
7708: Added the work for review comments.

Also added 1 test case to test multiple struct blocks are present.

3 years ago7708: Fixed many documentaion example issues.
Chetan Khilosiya [Sat, 27 Feb 2021 21:00:19 +0000 (02:30 +0530)]
7708: Fixed many documentaion example issues.

3 years ago7708: Format code through rust-analyzer formatter.
Chetan Khilosiya [Sat, 27 Feb 2021 20:29:19 +0000 (01:59 +0530)]
7708: Format code through rust-analyzer formatter.

3 years ago7708: Initial implementation of generate Default assist.
Chetan Khilosiya [Sat, 27 Feb 2021 20:18:51 +0000 (01:48 +0530)]
7708: Initial implementation of generate Default assist.

The Generate Default impl from new function.

3 years agoMerge #7894
bors[bot] [Sat, 6 Mar 2021 18:44:34 +0000 (18:44 +0000)]
Merge #7894

7894: generate_function assist: convert arg names to lower snake case r=Veykril a=JoshMcguigan

This PR fixes one of the points listed by @TimoFreiberg in #3639. Specifically that all generated argument names should be converted to lower snake case.

```rust
struct BazBaz;

fn foo() {
    bar$0(BazBaz);
    // ^ when triggering the assist here, you get the output below
}

// BEFORE
fn bar(BazBaz: BazBaz) ${0:-> ()} {
    todo!()
}

// AFTER
fn bar(baz_baz: BazBaz) ${0:-> ()} {
    todo!()
}
```

Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
3 years agogenerate function assist convert arg names to lower snake case
Josh Mcguigan [Sat, 6 Mar 2021 17:53:21 +0000 (09:53 -0800)]
generate function assist convert arg names to lower snake case

3 years agoMerge #7888
bors[bot] [Sat, 6 Mar 2021 10:38:57 +0000 (10:38 +0000)]
Merge #7888

7888: Add a line about code action commands to the CoC section of the docs r=lnicola a=flodiebold

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
3 years agoAdd a line about code action commands to the CoC section of the docs
Florian Diebold [Sat, 6 Mar 2021 10:35:04 +0000 (11:35 +0100)]
Add a line about code action commands to the CoC section of the docs

3 years agoMerge #7887
bors[bot] [Fri, 5 Mar 2021 20:59:31 +0000 (20:59 +0000)]
Merge #7887

7887: Fix fail to parse :: for meta in mbe r=edwin0cheng a=edwin0cheng

fixes #7886

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoFix fail to parse :: for meta in mbe
Edwin Cheng [Fri, 5 Mar 2021 20:57:34 +0000 (04:57 +0800)]
Fix fail to parse :: for meta in mbe

3 years agoMerge #7884
bors[bot] [Fri, 5 Mar 2021 20:00:04 +0000 (20:00 +0000)]
Merge #7884

7884: Simplify TokenStream FromStr r=edwin0cheng a=edwin0cheng

Make sure `FromStr` ignore all `TokenMap` in all cases.

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoMerge #7869
bors[bot] [Fri, 5 Mar 2021 19:52:15 +0000 (19:52 +0000)]
Merge #7869

7869: Add support for deref assignments to "pull assignment up" assist. r=Veykril a=Jesse-Bakker

Fixes #7867

Co-authored-by: Jesse Bakker <github@jessebakker.com>
3 years agoAdd support for deref assignments to "pull assignment up" assist.
Jesse Bakker [Thu, 4 Mar 2021 13:43:52 +0000 (14:43 +0100)]
Add support for deref assignments to "pull assignment up" assist.

Fixes #7867

3 years agoFix test
Edwin Cheng [Fri, 5 Mar 2021 19:30:22 +0000 (03:30 +0800)]
Fix test

3 years agoSimplify TokenStream FromStr
Edwin Cheng [Fri, 5 Mar 2021 19:17:36 +0000 (03:17 +0800)]
Simplify TokenStream FromStr

3 years agoMerge #7883
bors[bot] [Fri, 5 Mar 2021 18:49:29 +0000 (18:49 +0000)]
Merge #7883

7883: Make two calls virtual r=matklad a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoMake two calls virtual
Laurențiu Nicola [Fri, 5 Mar 2021 18:25:24 +0000 (20:25 +0200)]
Make two calls virtual

3 years agoMerge #7882
bors[bot] [Fri, 5 Mar 2021 18:15:10 +0000 (18:15 +0000)]
Merge #7882

7882: cargo update r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agocargo update
kjeremy [Fri, 5 Mar 2021 18:14:29 +0000 (13:14 -0500)]
cargo update

3 years agoMerge #7881
bors[bot] [Fri, 5 Mar 2021 17:43:23 +0000 (17:43 +0000)]
Merge #7881

7881: Underengineer `cargo xtask install --client` r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoUnderengineer `cargo xtask install --client`
Aleksey Kladov [Fri, 5 Mar 2021 17:42:41 +0000 (20:42 +0300)]
Underengineer `cargo xtask install --client`

3 years agoMerge #7880
bors[bot] [Fri, 5 Mar 2021 16:24:32 +0000 (16:24 +0000)]
Merge #7880

7880: Honor snippet capability when using the extract function assist r=lnicola a=Arthamys

This fixes issue #7793

Co-authored-by: san <san@alien.parts>
3 years agoHonor snippet capability in extract function assist
san [Fri, 5 Mar 2021 12:21:31 +0000 (13:21 +0100)]
Honor snippet capability in extract function assist

3 years agoMerge #7870
bors[bot] [Fri, 5 Mar 2021 16:04:49 +0000 (16:04 +0000)]
Merge #7870

7870: Use chalk_ir::AdtId r=Veykril a=Veykril

It's a bit unfortunate that we got two AdtId's now(technically 3 with the alias in the chalk module but that one won't allow pattern matching), one from hir_def and one from chalk_ir(hir_ty). But the hir_ty/chalk one doesn't leave hir so it shouldn't be that bad I suppose. Though if I see this right this will happen for almost all IDs.

I imagine most of the intermediate changes to using chalk ids will turn out not too nice until the refactor is over.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #7879
bors[bot] [Fri, 5 Mar 2021 14:12:19 +0000 (14:12 +0000)]
Merge #7879

7879: Fix some warnings r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoFix some warnings
Laurențiu Nicola [Fri, 5 Mar 2021 13:59:50 +0000 (15:59 +0200)]
Fix some warnings

3 years agoMerge #7876
bors[bot] [Fri, 5 Mar 2021 08:52:07 +0000 (08:52 +0000)]
Merge #7876

7876: Cleanup install command r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoCleanup install command
Aleksey Kladov [Fri, 5 Mar 2021 08:51:32 +0000 (11:51 +0300)]
Cleanup install command

3 years agoFix regression where the client was not installed
Aleksey Kladov [Fri, 5 Mar 2021 08:12:40 +0000 (11:12 +0300)]
Fix regression where the client was not installed

3 years agoUse chalk_ir::AdtId
Lukas Wirth [Mon, 1 Mar 2021 20:57:39 +0000 (21:57 +0100)]
Use chalk_ir::AdtId

3 years agoMerge #7868
bors[bot] [Thu, 4 Mar 2021 12:39:36 +0000 (12:39 +0000)]
Merge #7868

7868: Migrate to user-centric config name for `cargo check` stuff r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoMigrate to user-centric config name for `cargo check` stuff
Aleksey Kladov [Thu, 4 Mar 2021 11:52:36 +0000 (14:52 +0300)]
Migrate to user-centric config name for `cargo check` stuff

3 years agoMerge #7866
bors[bot] [Wed, 3 Mar 2021 22:05:38 +0000 (22:05 +0000)]
Merge #7866

7866: Complete `while let` r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoComplete `while let`
Lukas Wirth [Wed, 3 Mar 2021 20:59:41 +0000 (21:59 +0100)]
Complete `while let`

3 years agoDon't complete `super` unless its valid in paths
Lukas Wirth [Wed, 3 Mar 2021 20:58:48 +0000 (21:58 +0100)]
Don't complete `super` unless its valid in paths

3 years agoMerge #7863
bors[bot] [Wed, 3 Mar 2021 18:49:43 +0000 (18:49 +0000)]
Merge #7863

7863: Prevent renaming SelfType and BuiltinType r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoPrevent renaming SelfType and BuiltinType
Lukas Wirth [Wed, 3 Mar 2021 18:48:53 +0000 (19:48 +0100)]
Prevent renaming SelfType and BuiltinType

3 years agoReorder functions in rename.rs
Lukas Wirth [Wed, 3 Mar 2021 17:23:38 +0000 (18:23 +0100)]
Reorder functions in rename.rs

3 years agoMerge #7862
bors[bot] [Wed, 3 Mar 2021 18:11:56 +0000 (18:11 +0000)]
Merge #7862

7862: Remove incorrect broken test r=jonas-schievink a=jonas-schievink

`Struct` cannot be named at all in that position, since `super` doesn't
resolve to the block scope

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoRemove incorrect broken test
Jonas Schievink [Wed, 3 Mar 2021 18:10:56 +0000 (19:10 +0100)]
Remove incorrect broken test

`Struct` cannot be named at all in that position, since `super` doesn't
resolve to the block scope

3 years agoMerge #7861
bors[bot] [Wed, 3 Mar 2021 13:29:56 +0000 (13:29 +0000)]
Merge #7861

7861: Special-case parenthesized and negated expressions in demorgan assist r=lnicola a=Jesse-Bakker

Fixes #7831

Co-authored-by: Jesse Bakker <github@jessebakker.com>
3 years agoSpecial-case parenthesized and negated expressions in demorgan assist
Jesse Bakker [Wed, 3 Mar 2021 12:12:00 +0000 (13:12 +0100)]
Special-case parenthesized and negated expressions in demorgan assist

3 years agoMerge #7858
bors[bot] [Wed, 3 Mar 2021 08:23:38 +0000 (08:23 +0000)]
Merge #7858

7858: Clarify comparison rule r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoClarify comparison rule
Aleksey Kladov [Wed, 3 Mar 2021 08:23:05 +0000 (11:23 +0300)]
Clarify comparison rule

3 years agoMerge #7853
bors[bot] [Tue, 2 Mar 2021 20:34:24 +0000 (20:34 +0000)]
Merge #7853

7853: Update lexer r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agoUpdate lexer
kjeremy [Tue, 2 Mar 2021 20:33:22 +0000 (15:33 -0500)]
Update lexer

3 years agoMerge #7852
bors[bot] [Tue, 2 Mar 2021 17:42:20 +0000 (17:42 +0000)]
Merge #7852

7852: bump once_cell r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
3 years agobump once_cell
kjeremy [Tue, 2 Mar 2021 17:41:20 +0000 (12:41 -0500)]
bump once_cell

3 years agoMerge #7851
bors[bot] [Tue, 2 Mar 2021 15:46:02 +0000 (15:46 +0000)]
Merge #7851

7851: Compress tests r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoCompress tests
Aleksey Kladov [Tue, 2 Mar 2021 13:38:51 +0000 (16:38 +0300)]
Compress tests

3 years agoMerge #7824
bors[bot] [Tue, 2 Mar 2021 15:28:41 +0000 (15:28 +0000)]
Merge #7824

7824: feat: add type ascription r=matklad a=conradludgate

Based on this conversation: https://twitter.com/rust_analyzer/status/1366092401278922757
Built off of `add_turbo_fish`, finds the current `let` statement, checks if it has type/turbofish already and checks if the rhs function is generic.

There's one case I couldn't figure out how to implement that would be nice:

```rust
#[test]
fn add_type_ascription_function_result() {
    check_assist(
        add_type_ascription,
        r#"
fn make<T>() -> Result<T, &'static str> {}
fn main() {
    let x = make()$0;
}
"#,
        r#"
fn make<T>() -> Result<T, &'static str> {}
fn main() {
    let x: Result<${0:_}, &'static str> = make();
}
"#,
    );
}
```

The `Function::ret_type` fn wasn't returning anything much useful so I'm not sure how to identity such scenarios just yet

Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
3 years agochore: remove redundant tests
Conrad Ludgate [Tue, 2 Mar 2021 15:26:36 +0000 (15:26 +0000)]
chore: remove redundant tests

3 years agochore: remove deleted file path
Conrad Ludgate [Tue, 2 Mar 2021 15:02:47 +0000 (15:02 +0000)]
chore: remove deleted file path

3 years agochore: codegen
Conrad Ludgate [Tue, 2 Mar 2021 14:55:37 +0000 (14:55 +0000)]
chore: codegen

3 years agorefactor: re-use add_turbo_fish function
Conrad Ludgate [Tue, 2 Mar 2021 14:28:53 +0000 (14:28 +0000)]
refactor: re-use add_turbo_fish function

3 years agochore: fmt + docs
Conrad Ludgate [Mon, 1 Mar 2021 11:51:52 +0000 (11:51 +0000)]
chore: fmt + docs

3 years agochore: rename var
Conrad Ludgate [Mon, 1 Mar 2021 11:21:02 +0000 (11:21 +0000)]
chore: rename var

3 years agofeat: add type ascription assist
Conrad Ludgate [Mon, 1 Mar 2021 10:51:47 +0000 (10:51 +0000)]
feat: add type ascription assist

3 years agoMerge #7850
bors[bot] [Tue, 2 Mar 2021 14:19:45 +0000 (14:19 +0000)]
Merge #7850

7850: Don't add space when joining line to opening quote r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoDon't add space when joining line to opening quote
Aleksey Kladov [Tue, 2 Mar 2021 13:48:54 +0000 (16:48 +0300)]
Don't add space when joining line to opening quote

3 years agoMerge #7849
bors[bot] [Tue, 2 Mar 2021 13:54:56 +0000 (13:54 +0000)]
Merge #7849

7849: Fix xflags fallout r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoFix xflags fallout
Aleksey Kladov [Tue, 2 Mar 2021 13:50:03 +0000 (16:50 +0300)]
Fix xflags fallout

https://github.com/rust-analyzer/rust-analyzer/pull/7847#issuecomment-788920830

3 years agoMerge #7795
bors[bot] [Tue, 2 Mar 2021 13:46:50 +0000 (13:46 +0000)]
Merge #7795

7795: Show docs on hover for keywords and primitives r=matklad a=Veykril

![lAWFadkziX](https://user-images.githubusercontent.com/3757771/109369534-eeb4f500-789c-11eb-8f2b-2f9c4e129de3.gif)

It's a bit annoying that this requires the `SyntaxNode` and `Semantics` to be pulled through `hover_for_definition` just so we can get the `std` crate but I couldn't think of a better way.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoShow docs on hover for keywords and primitives
Lukas Wirth [Tue, 2 Mar 2021 13:41:01 +0000 (14:41 +0100)]
Show docs on hover for keywords and primitives

3 years agoMerge #7335 #7691
bors[bot] [Tue, 2 Mar 2021 13:32:06 +0000 (13:32 +0000)]
Merge #7335 #7691

7335: added region folding r=matklad a=LucianoBestia

Regions of code that you'd like to be folded can be wrapped with  `// #region` and `// #endregion` line comments.
This is called "Region Folding". It is originally available for many languages in VSCode. But Rust-analyzer has its own folding function and this is missing.
With this Pull Request I am suggesting a simple solution.
The regions are a special kind of comments, so I added a bit of code in the comment folding function.
The regex to match are: `^\s*//\s*#?region\b` and `^\s*//\s*#?endregion\b`.
The number of space characters is not important. There is an optional # character. The line can end with a name of the region.
Example:
```rust
// 1. some normal comment
// region: test
// 2. some normal comment
calling_function(x,y);
// endregion: test
```
I added a test for this new functionality in `folding_ranges.rs`.
Please, take a look and comment.
I found that these exact regexes are already present in the file `language-configuration.json`, but I don't find a way to read this configuration. So my regex is hardcoded in the code.

7691: Suggest name in extract variable r=matklad a=cpud36

Generate better default name in extract variable assist as was mentioned in issue #1587

# Currently supported
(in order of declining precedence)
1. Expr is argument to a function; use corresponding parameter name
2. Expr is result of a function or method call; use this function/method's name
3. Use expr type name (if possible)
4. Fallback to `var_name` otherwise

# Showcase

![generate_derive_variable_name_from_method](https://user-images.githubusercontent.com/4218373/108013304-72105400-701c-11eb-9f13-eec52e74d0cc.gif)
![generate_derive_variable_name_from_param](https://user-images.githubusercontent.com/4218373/108013305-72a8ea80-701c-11eb-957e-2214f7f005de.gif)

# Questions

* Should we more aggressively strip known types? E.g. we already strip `&T -> T`; should we strip `Option<T> -> T`, `Result<T, E> -> T`, and others?
* Integers and floats use `var_name` by default. Should we introduce a name, like `i`, `f` etc?
* Can we return a list and suggest a name when renaming(like IntelliJ does)?
* Should we add counters to remove duplicate variables? E.g. `type`, `type1`, type2`, etc.

Co-authored-by: Luciano Bestia <LucianoBestia@gmail.com>
Co-authored-by: Luciano <31509965+LucianoBestia@users.noreply.github.com>
Co-authored-by: Vladyslav Katasonov <cpud47@gmail.com>
3 years agostrip useless methods, and unary ops in suggest_name
Vladyslav Katasonov [Tue, 16 Feb 2021 21:42:58 +0000 (00:42 +0300)]
strip useless methods, and unary ops in suggest_name

3 years agopull out suggest_name::* to utils; enchance heuristics
Vladyslav Katasonov [Tue, 16 Feb 2021 20:48:15 +0000 (23:48 +0300)]
pull out suggest_name::* to utils; enchance heuristics

3 years agosuggest parameter name before function name
Vladyslav Katasonov [Tue, 16 Feb 2021 02:55:47 +0000 (05:55 +0300)]
suggest parameter name before function name

3 years agotry to suggest name when extracting variable
Vladyslav Katasonov [Tue, 16 Feb 2021 01:43:32 +0000 (04:43 +0300)]
try to suggest name when extracting variable

3 years agoMerge #7513
bors[bot] [Tue, 2 Mar 2021 13:20:47 +0000 (13:20 +0000)]
Merge #7513

7513: NFA parser for mbe matcher r=matklad a=edwin0cheng

Almost straight porting from rustc one, but a little bit slow :(

```
rust-analyzer analysis-stats -q .
```

From:
```log
Database loaded:     636.11ms, 277minstr
  crates: 36, mods: 594, decls: 11527, fns: 9017
Item Collection:     10.99s, 60ginstr
  exprs: 249618, ??ty: 2699 (1%), ?ty: 2101 (0%), !ty: 932
Inference:           28.94s, 123ginstr
Total:               39.93s, 184ginstr
```

To:
```log
Database loaded:     630.90ms, 277minstr
  crates: 36, mods: 594, decls: 11528, fns: 9018
Item Collection:     13.70s, 77ginstr
  exprs: 249482, ??ty: 2699 (1%), ?ty: 2101 (0%), !ty: 932
Inference:           30.27s, 133ginstr
Total:               43.97s, 211ginstr
```

Fixes #4777

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoMerge #7848
bors[bot] [Tue, 2 Mar 2021 12:31:15 +0000 (12:31 +0000)]
Merge #7848

7848: Bump cargo_metadata r=matklad a=lnicola

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoBump cargo_metadata
Laurențiu Nicola [Tue, 2 Mar 2021 12:27:29 +0000 (14:27 +0200)]
Bump cargo_metadata

3 years agoMerge #7837
bors[bot] [Tue, 2 Mar 2021 12:19:50 +0000 (12:19 +0000)]
Merge #7837

7837: Add more information to VSCode extenstion README r=matklad a=IceSentry

A lot of these are duplicated from the documentation or main README. While it's unfortunate to have duplicated information, the current VSCode page is very barebones and doesn't offer much confidence.

This updated README offers a few more links and follows a structure similar to the official rust extension and other popular vscode extensions. The additions are, as much as possible specific to the vscode extension and not rust-analyzer as a LSP.

The note about not using the official extension is also right there at the top because that's a common issue people have when trying it out.

I added the sponsor section since it's common in other extensions README, but I'm not sure if it's necessary

Co-authored-by: Charles Giguere <IceSentry@users.noreply.github.com>
Co-authored-by: cgiguere <c.giguere42@gmail.com>
3 years agoMerge #7847
bors[bot] [Tue, 2 Mar 2021 12:09:51 +0000 (12:09 +0000)]
Merge #7847

7847: Switch from pico-args to xflags r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoSwitch from pico-args to xflags
Aleksey Kladov [Tue, 2 Mar 2021 12:01:48 +0000 (15:01 +0300)]
Switch from pico-args to xflags

3 years agoMerge #7836
bors[bot] [Tue, 2 Mar 2021 08:38:25 +0000 (08:38 +0000)]
Merge #7836

7836: Check for path dev-dependencies with a version number r=lnicola a=lnicola

Closes https://github.com/rust-analyzer/rust-analyzer/pull/7828#issuecomment-788174522.

This looks a bit ugly, but at least fixes an issues where we missed target-specific dependencies.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoMerge #7777
bors[bot] [Tue, 2 Mar 2021 08:04:38 +0000 (08:04 +0000)]
Merge #7777

7777: Implement line<->block comment assist r=Veykril a=djrenren

Fixes: https://github.com/rust-analyzer/rust-analyzer/issues/6515
Co-authored-by: John Renner <john@jrenner.net>
3 years agoMerge #7844
bors[bot] [Tue, 2 Mar 2021 05:20:32 +0000 (05:20 +0000)]
Merge #7844

7844: Fix ProcMacroClient dropped too early in cli r=edwin0cheng a=edwin0cheng

Fix #7843

bors r+

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
3 years agoFix ProcMacroClient dropped too early in cli
Edwin Cheng [Tue, 2 Mar 2021 05:14:05 +0000 (13:14 +0800)]
Fix ProcMacroClient dropped too early in cli

3 years agoMerge #7827
bors[bot] [Tue, 2 Mar 2021 00:01:14 +0000 (00:01 +0000)]
Merge #7827

7827: Fix proc macro TokenStream::from_str token ids r=vlad20012 a=vlad20012

To be honest, I don't know what it changes from a user perspective.

Internally, this fixes spans (token ids) of a `TokenStream` parsed from a string:

```rust
#[proc_macro_derive(FooDerive)]
pub fn foo_derive(item: TokenStream) -> TokenStream {
    "fn foo() {}".parse().unwrap()
}
```

Previously, `TokenStream` was constructed from tokens with incremental ids (that conflicted with call-site tokens). Now they are `-1`.

Co-authored-by: vlad20012 <beskvlad@gmail.com>
3 years agoclean uo rustup link
cgiguere [Mon, 1 Mar 2021 20:19:30 +0000 (15:19 -0500)]
clean uo rustup link

3 years agoadd sponsor links
cgiguere [Mon, 1 Mar 2021 20:07:36 +0000 (15:07 -0500)]
add sponsor links

3 years agoMerge #7835
bors[bot] [Mon, 1 Mar 2021 19:57:25 +0000 (19:57 +0000)]
Merge #7835

7835: Use cli parser with auto-generated help r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoAdd more information to VSCode extenstion README
Charles Giguere [Mon, 1 Mar 2021 19:47:54 +0000 (14:47 -0500)]
Add more information to VSCode extenstion README

A lot of these are duplicated from the documentation or main README. While it's unfortunate to have duplicated information, the current VSCode page is very barebones and doesn't offer much confidence.

This updated README offers a few more links and follows a structure similar to the official rust extension and other popular vscode extensions. The additions are, as much as possible specific to the vscode extension and not rust-analyzer as a LSP.

The note about not using the official extension is also right there at the top because that's a common issue people have when trying it out.

I added the sponsor section since it's common in other extensions README, but I'm not sure if it's necessary

3 years agoApply edits
John Renner [Mon, 1 Mar 2021 19:41:22 +0000 (11:41 -0800)]
Apply edits

3 years agoMerge #7829 #7833
bors[bot] [Mon, 1 Mar 2021 19:31:01 +0000 (19:31 +0000)]
Merge #7829 #7833

7829: Bump deps r=matklad a=lnicola

Unfortunately, this brings a bunch of proc macros dep because `cargo-metadata` went full-in on `derive-builder`. I'm not sure what we can do here..

7833: Use chalk_ir::Mutability r=Veykril a=Veykril

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoUpdate xtask/src/flags.rs
Aleksey Kladov [Mon, 1 Mar 2021 19:29:17 +0000 (22:29 +0300)]
Update xtask/src/flags.rs

Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
3 years agoCheck for path dev-dependencies with a version number
Laurențiu Nicola [Mon, 1 Mar 2021 19:13:16 +0000 (21:13 +0200)]
Check for path dev-dependencies with a version number

3 years agoUse cli parser with auto-generated help
Aleksey Kladov [Mon, 1 Mar 2021 18:12:44 +0000 (21:12 +0300)]
Use cli parser with auto-generated help

3 years agoUse chalk_ir::Mutability
Lukas Wirth [Mon, 1 Mar 2021 18:30:34 +0000 (19:30 +0100)]
Use chalk_ir::Mutability

3 years agoMerge #7834
bors[bot] [Mon, 1 Mar 2021 18:52:39 +0000 (18:52 +0000)]
Merge #7834

7834: Fix `find_path` when inner items are present r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/7750 (but adds a bunch of FIXMEs, because a lot of this code is still wrong in the presence of inner items)

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoFix `find_path` when inner items are present
Jonas Schievink [Mon, 1 Mar 2021 18:36:34 +0000 (19:36 +0100)]
Fix `find_path` when inner items are present

3 years agoMerge #7832
bors[bot] [Mon, 1 Mar 2021 18:30:46 +0000 (18:30 +0000)]
Merge #7832

7832: Axe pre-commit r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoAxe pre-commit
Aleksey Kladov [Mon, 1 Mar 2021 18:29:40 +0000 (21:29 +0300)]
Axe pre-commit

3 years agoMerge #7830
bors[bot] [Mon, 1 Mar 2021 17:51:35 +0000 (17:51 +0000)]
Merge #7830

7830: Simplify xtask r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agoSimplify xtask
Aleksey Kladov [Mon, 1 Mar 2021 17:16:23 +0000 (20:16 +0300)]
Simplify xtask

lib/bin/test separation isn't really needed.

3 years agoFix proc macro TokenStream::from_str token ids
vlad20012 [Mon, 1 Mar 2021 13:31:03 +0000 (16:31 +0300)]
Fix proc macro TokenStream::from_str token ids

3 years agoMerge #7828
bors[bot] [Mon, 1 Mar 2021 16:18:08 +0000 (16:18 +0000)]
Merge #7828

7828: Use an unversioned profile dependency in mbe r=edwin0cheng a=lnicola

Apparently, dev dependencies shouldn't be versioned. This hopefully fixes publishing to crates.io.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>