]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMerge #11461
bors[bot] [Tue, 22 Feb 2022 18:46:12 +0000 (18:46 +0000)]
Merge #11461

11461: Extract struct from enum variant filters generics r=jo-goro a=jo-goro

Fixes #11452.

This PR updates extract_struct_from_enum_variant. Extracting a struct `A` form an enum like
```rust
enum X<'a, 'b> {
    A { a: &'a () },
    B { b: &'b () },
}
```
will now be correctly generated as
```rust
struct A<'a> { a: &'a () }

enum X<'a, 'b> {
    A(A<'a>),
    B { b: &'b () },
}
```
instead of the previous
```rust
struct A<'a, 'b>{ a: &'a () } // <- should not have 'b

enum X<'a, 'b> {
    A(A<'a, 'b>),
    B { b: &'b () },
}
```

This also works for generic type parameters and const generics.

Bounds are also copied, however I have not yet implemented a filter for unneeded bounds. Extracting `B` from the following enum
```rust
enum X<'a, 'b: 'a> {
    A { a: &'a () },
    B { b: &'b () },
}
```
will be generated as
```rust
struct B<'b: 'a> { b: &'b () } // <- should be `struct B<'b> { b: &'b () }`

enum X<'a, 'b: 'a> {
    A { a: &'a () },
    B(B<'b>),
}
```

Extracting bounds with where clauses is also still not implemented.

Co-authored-by: Jonas Goronczy <goronczy.jonas@gmail.com>
2 years agoReplaced fold with for loop
Jonas Goronczy [Tue, 22 Feb 2022 18:38:34 +0000 (19:38 +0100)]
Replaced fold with for loop

2 years agoMerge #11472
bors[bot] [Tue, 22 Feb 2022 18:12:27 +0000 (18:12 +0000)]
Merge #11472

11472: fix: visibility in impl items and pub(crate) to pub in extract_module r=feniljain a=feniljain

Should fix #11007 and #11443

Makes following changes:

- Removes visiblity modifiers from trait items
- Respect user given visibility
- Updated tests for the same

Co-authored-by: vi_mi <fkjainco@gmail.com>
Co-authored-by: vi_mi <49019259+feniljain@users.noreply.github.com>
2 years agochore: reposition comment
vi_mi [Tue, 22 Feb 2022 14:16:50 +0000 (19:46 +0530)]
chore: reposition comment

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: visibility in impl items and pub(crate) to pub in extract_module
vi_mi [Tue, 22 Feb 2022 13:02:36 +0000 (18:32 +0530)]
fix: visibility in impl items and pub(crate) to pub in extract_module

2 years agoMerge #11530
bors[bot] [Tue, 22 Feb 2022 11:33:32 +0000 (11:33 +0000)]
Merge #11530

11530: fix: Fix expand_macro always expanding the first listed derive r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix expand_macro always expanding the first listed derive
Lukas Wirth [Tue, 22 Feb 2022 11:32:15 +0000 (12:32 +0100)]
fix: Fix expand_macro always expanding the first listed derive

2 years agoMerge #11513
bors[bot] [Tue, 22 Feb 2022 10:12:30 +0000 (10:12 +0000)]
Merge #11513

11513: internal: Expand the derive attribute into a pseudo expansion r=Veykril a=Veykril

Quoting my comment:

> We generate a very specific expansion here, as we do not actually expand the `#[derive]` attribute
> itself in name res, but we do want to expand it to something for the IDE layer, so that the input
> derive attributes can be downmapped, and resolved as proper paths.
> This is basically a hack, that simplifies the hacks we need in a lot of ide layer places to
> somewhat inconsistently resolve derive attributes.
>
> As such, we expand `#[derive(Foo, bar::Bar)]` into
> ```
>  #[Foo]
>  #[bar::Bar]
>  ();
> ```
> which allows fallback path resolution in hir::Semantics to properly identify our derives.
> Since we do not expand the attribute in nameres though, we keep the original item.
>
> The ideal expansion here would be for the `#[derive]` to re-emit the annotated item and somehow
> use the input paths in its output as well.
> But that would bring two problems with it, for one every derive would duplicate the item token tree
> wasting a lot of memory, and it would also require some way to use a path in a way that makes it
> always resolve as a derive without nameres recollecting them.
> So this hacky approach is a lot more friendly for us, though it does require a bit of support in
> [`hir::Semantics`] to make this work.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoupdate references::derive test output
Lukas Wirth [Tue, 22 Feb 2022 09:52:35 +0000 (10:52 +0100)]
update references::derive test output

2 years agosimplify and document
Lukas Wirth [Tue, 22 Feb 2022 09:45:29 +0000 (10:45 +0100)]
simplify and document

2 years agoSimplify
Lukas Wirth [Mon, 21 Feb 2022 12:34:05 +0000 (13:34 +0100)]
Simplify

2 years agoFix syntax highlighting not highlighting derives anymore
Lukas Wirth [Mon, 21 Feb 2022 12:21:25 +0000 (13:21 +0100)]
Fix syntax highlighting not highlighting derives anymore

2 years agoMake replace_derive_with_manual_impl work again
Lukas Wirth [Mon, 21 Feb 2022 11:57:57 +0000 (12:57 +0100)]
Make replace_derive_with_manual_impl work again

2 years agoFix `expand_macro` not working for derive attributes
Lukas Wirth [Mon, 21 Feb 2022 10:51:53 +0000 (11:51 +0100)]
Fix `expand_macro` not working for derive attributes

2 years agointernal: Expand the derive attribute into a pseudo expansion
Lukas Wirth [Mon, 21 Feb 2022 01:42:58 +0000 (02:42 +0100)]
internal: Expand the derive attribute into a pseudo expansion

2 years agoMerge #11527
bors[bot] [Tue, 22 Feb 2022 09:08:22 +0000 (09:08 +0000)]
Merge #11527

11527: internal: Split unresolve proc-macro error out of mbe r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: Split unresolve proc-macro error out of mbe
Lukas Wirth [Mon, 21 Feb 2022 18:14:06 +0000 (19:14 +0100)]
internal: Split unresolve proc-macro error out of mbe

2 years agoMerge #11525
bors[bot] [Tue, 22 Feb 2022 08:56:34 +0000 (08:56 +0000)]
Merge #11525

11525: fix(assist): Drop generic args in path before insert use in `replace_qualified_name_with_use` r=Veykril a=tysg

Fixes #11505. also removed an unnecessary `clone_for_update` call.

Co-authored-by: Tianyi Song <42670338+tysg@users.noreply.github.com>
2 years agoMerge #11524
bors[bot] [Tue, 22 Feb 2022 08:38:57 +0000 (08:38 +0000)]
Merge #11524

11524: doc: state that only the latest stable toolchain is supported r=lnicola a=jtroo

This closes #11226. The content seemed to make more sense in the
installation section as opposed to the Troubleshooting section.

Co-authored-by: Jan Tache <j.andreitabs@gmail.com>
2 years agoDrop generic args in path before insert use
Tianyi Song [Fri, 28 Jan 2022 08:15:23 +0000 (16:15 +0800)]
Drop generic args in path before insert use

2 years agoChange Rust Analyzer->rust-analyzer to match style
Jan Tache [Tue, 22 Feb 2022 07:01:05 +0000 (23:01 -0800)]
Change Rust Analyzer->rust-analyzer to match style

2 years agodoc: state that only the latest stable toolchain is supported
Jan Tache [Tue, 22 Feb 2022 06:37:19 +0000 (22:37 -0800)]
doc: state that only the latest stable toolchain is supported

This closes #11226. The content seemed to make more sense in the
installation section as opposed to the Troubleshooting section.

2 years agoRemoves ExtractedGenerics struct
Jonas Goronczy [Mon, 21 Feb 2022 22:00:16 +0000 (23:00 +0100)]
Removes ExtractedGenerics struct

2 years agoMerge #11490
bors[bot] [Mon, 21 Feb 2022 21:57:44 +0000 (21:57 +0000)]
Merge #11490

11490: Correctly fix formatting doc tests with generics r=Veykril a=KarlWithK

Before the doc_test would be outputted like this:
```zsh
"Foo<T, U>::t"
```
However, this would cause problems with shell redirection. I've changed it
so when generics are involved we simply wrap the expression under quotes as so:
```zsh
"\"Foo<T, U>::t\""
```

Note:
At the cost of adding this, I had to allocate a new string via
`format!{}`. However, I argue this is alright as this for just for
outputting the name of the doc test.

The following tests have been changed:
```
runnables::tests::doc_test_type_params
runnables::tests::test_doc_runnables_impl_mod
runnables::tests::test_runnables_doc_test_in_impl
```

Closes  https://github.com/rust-analyzer/rust-analyzer/issues/11489

Co-authored-by: KarlWithK <jocelinc60@outlook.com>
Co-authored-by: SeniorMars <jocelinc60@outlook.com>
2 years agoUpdate crates/ide/src/runnables.rs
SeniorMars [Mon, 21 Feb 2022 21:23:09 +0000 (15:23 -0600)]
Update crates/ide/src/runnables.rs

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoCleanup
Jonas Goronczy [Mon, 21 Feb 2022 18:51:09 +0000 (19:51 +0100)]
Cleanup

2 years agoMerge #11522
bors[bot] [Mon, 21 Feb 2022 17:08:19 +0000 (17:08 +0000)]
Merge #11522

11522: fix: Make code lenses work on attributed items r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11213
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Make code lenses work on attributed items
Lukas Wirth [Mon, 21 Feb 2022 17:07:47 +0000 (18:07 +0100)]
fix: Make code lenses work on attributed items

2 years agoMerge #11455
bors[bot] [Mon, 21 Feb 2022 16:56:37 +0000 (16:56 +0000)]
Merge #11455

11455: Handle proc-macro functions as the proc-macro they resolve to r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMove fn to proc-macro conversion to name classification
Lukas Wirth [Mon, 21 Feb 2022 16:56:11 +0000 (17:56 +0100)]
Move fn to proc-macro conversion to name classification

2 years agoMerge #11481
bors[bot] [Mon, 21 Feb 2022 13:08:31 +0000 (13:08 +0000)]
Merge #11481

11481: Display parameter names when hovering over a function pointer r=Veykril a=Vannevelj

Implements #11474

The idea is pretty straightforward: previously we constructed the hover based on just the parameter types, now we pass in the parameter names as well. I went for a quick-hit approach here but I expect someone will be able to point me to a better way of resolving the identifier.

I haven't figured out yet how to actually run my rust-analyzer locally so I can see it in action but the unit test indicates it should work.

Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
2 years agoMerge #11517
bors[bot] [Mon, 21 Feb 2022 12:52:11 +0000 (12:52 +0000)]
Merge #11517

11517: fix: Fix qualfiied record literal completion triggering too eagerly r=Veykril a=Veykril

Supercedes https://github.com/rust-analyzer/rust-analyzer/pull/10909
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10889
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix qualfiied record literal completion triggering too eagerly
Lukas Wirth [Mon, 21 Feb 2022 12:50:16 +0000 (13:50 +0100)]
fix: Fix qualfiied record literal completion triggering too eagerly

2 years agoMerge #11516
bors[bot] [Mon, 21 Feb 2022 12:44:10 +0000 (12:44 +0000)]
Merge #11516

11516: fix: Don't count commas when looking for the derive attribute in diagnostics r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Don't count commas when looking for the derive attribute in diagnostics
Lukas Wirth [Mon, 21 Feb 2022 12:43:42 +0000 (13:43 +0100)]
fix: Don't count commas when looking for the derive attribute in diagnostics

2 years agoparameters.split_last()
Jeroen Vannevel [Mon, 21 Feb 2022 10:29:38 +0000 (10:29 +0000)]
parameters.split_last()

2 years agoMerge #11142
bors[bot] [Mon, 21 Feb 2022 10:29:16 +0000 (10:29 +0000)]
Merge #11142

11142: Updated the Sublime Text section r=Veykril a=AmjadHD

rust-analyzer/rust-analyzer.github.io#160

Co-authored-by: Amjad Ben Hedhili <amjadhedhili@outlook.com>
2 years agoMerge #11424
bors[bot] [Mon, 21 Feb 2022 10:21:39 +0000 (10:21 +0000)]
Merge #11424

11424: Pass required features to cargo when using run action r=Veykril a=WaffleLapkin

When using `F1`->`Rust Analyzer: Run` action on an `example`, pass its `required-features` to `cargo run`. This allows to run examples that were otherwise impossible to run with RA.

Co-authored-by: Maybe Waffle <waffle.lapkin@gmail.com>
2 years agoMerge #11375
bors[bot] [Mon, 21 Feb 2022 09:31:38 +0000 (09:31 +0000)]
Merge #11375

11375: feat: Support if- and while- let chains r=Veykril a=ChayimFriedman2

Closes #11320.

Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
2 years agoMerge #11514
bors[bot] [Mon, 21 Feb 2022 09:23:20 +0000 (09:23 +0000)]
Merge #11514

11514: chore(manual): update coc-rust-analyzer manual r=Veykril a=fannheyward

Semantic tokens highlighting is added in coc.nvim now.

Co-authored-by: Heyward Fann <fannheyward@users.noreply.github.com>
2 years agoChange `single_let()` and `is_pattern_cond()` to free functions
Chayim Refael Friedman [Mon, 21 Feb 2022 06:15:21 +0000 (08:15 +0200)]
Change `single_let()` and `is_pattern_cond()` to free functions

2 years agoUpgrade ungrammar to 1.15.0
Chayim Refael Friedman [Tue, 1 Feb 2022 09:35:36 +0000 (11:35 +0200)]
Upgrade ungrammar to 1.15.0

2 years agoValidate `let` expressions
Chayim Refael Friedman [Sun, 30 Jan 2022 10:23:36 +0000 (12:23 +0200)]
Validate `let` expressions

Emit an error if they're found in an invalid position.

2 years agoUpdate tests
Chayim Refael Friedman [Mon, 24 Jan 2022 02:50:07 +0000 (04:50 +0200)]
Update tests

Unfortunately, we lost some recovery for expressions.

2 years agoFix various IDE features
Chayim Refael Friedman [Sun, 23 Jan 2022 22:37:59 +0000 (00:37 +0200)]
Fix various IDE features

As a side benefit, we got `let` guard support for `move_guard` for free.

2 years agoType-inference for `let` expressions
Chayim Refael Friedman [Sun, 23 Jan 2022 03:59:35 +0000 (05:59 +0200)]
Type-inference for `let` expressions

2 years agoLower `let` expressions
Chayim Refael Friedman [Sun, 23 Jan 2022 03:39:26 +0000 (05:39 +0200)]
Lower `let` expressions

2 years agoParse `let` expressions in order to support `let` chains
Chayim Refael Friedman [Sun, 23 Jan 2022 02:21:09 +0000 (04:21 +0200)]
Parse `let` expressions in order to support `let` chains

We still need to reject freestanding `let` expressions: see https://github.com/rust-analyzer/rust-analyzer/issues/11320#issuecomment-1018212465.

2 years agochore(manual): update coc-rust-analyzer manual
Heyward Fann [Mon, 21 Feb 2022 03:04:39 +0000 (11:04 +0800)]
chore(manual): update coc-rust-analyzer manual

Semantic tokens highlighting is added now

2 years agoMerge #11512
bors[bot] [Sun, 20 Feb 2022 23:16:59 +0000 (23:16 +0000)]
Merge #11512

11512: internal: Remove `name` fields from `MacroCallKind` r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: Remove name fields from MacroCallKind
Lukas Wirth [Sun, 20 Feb 2022 23:02:10 +0000 (00:02 +0100)]
internal: Remove name fields from MacroCallKind

2 years agoMerge #11511
bors[bot] [Sun, 20 Feb 2022 21:54:12 +0000 (21:54 +0000)]
Merge #11511

11511: internal: Wrap MacroCallKind::Attr attr_args field in an Arc r=Veykril a=Veykril

This is stored in `MacroCallLoc` which is returned from a query, so cloning should be made cheap.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: Wrap MacroCallKind::Attr attr_args field in an Arc
Lukas Wirth [Sun, 20 Feb 2022 21:53:04 +0000 (22:53 +0100)]
internal: Wrap MacroCallKind::Attr attr_args field in an Arc

2 years agoMerge #11504
bors[bot] [Sat, 19 Feb 2022 10:09:22 +0000 (10:09 +0000)]
Merge #11504

11504: Fix a typo in server_capabilities.experimental r=lnicola a=nemethf

Commit 27c4be6b4f68 wasn't really complex, but I still managed to make a mistake there, which this PR fixes.  Sorry.

Co-authored-by: Felicián Németh <felician.nemeth@gmail.com>
2 years agoFix a typo in server_capabilities.experimental
Felicián Németh [Sat, 19 Feb 2022 09:58:10 +0000 (10:58 +0100)]
Fix a typo in server_capabilities.experimental

2 years agoMerge #11498
bors[bot] [Fri, 18 Feb 2022 17:32:36 +0000 (17:32 +0000)]
Merge #11498

11498: minor: Update issue template r=lnicola a=lnicola

 - remove fixed #11098
 - ask about settings and environment variables

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoUpdate issue template
Laurențiu Nicola [Fri, 18 Feb 2022 17:30:15 +0000 (19:30 +0200)]
Update issue template

2 years agore-added FIXME
Jeroen Vannevel [Fri, 18 Feb 2022 09:12:52 +0000 (09:12 +0000)]
re-added FIXME

2 years agoCorrectly fix formatting doc tests with generics
KarlWithK [Fri, 18 Feb 2022 02:27:37 +0000 (20:27 -0600)]
Correctly fix formatting doc tests with generics

Before the doc_test would be outputted like this:
"Foo<T, U>::t"
However, this would cause shells with shell redirection. I've changed it
so when generics are involved we simply wrap the expression under escape
chanters as so:
"\"Foo<T, U>::t\""

Note:
At the cost of adding this, I had to allocate a new string via
format!{}. However, I argue this is alright as this for just for
outputting the name of the doc test.

The following tests have been changed:
runnables::tests::doc_test_type_params
runnables::tests::test_doc_runnables_impl_mod
runnables::tests::test_runnables_doc_test_in_impl

2 years agoMerge #11484
bors[bot] [Wed, 16 Feb 2022 15:13:54 +0000 (15:13 +0000)]
Merge #11484

11484: Infer the array size for slice patterns r=flodiebold a=ChayimFriedman2

Fixes #11478 (feat or fix?),

I don't know much about the type-checking in RA, so maybe I did some obvious mistake.

Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
2 years agoInfer the array size for slice patterns
Chayim Refael Friedman [Wed, 16 Feb 2022 11:21:21 +0000 (11:21 +0000)]
Infer the array size for slice patterns

2 years agoremoved double map
Jeroen Vannevel [Tue, 15 Feb 2022 19:37:24 +0000 (19:37 +0000)]
removed double map

2 years agosimplified write
Jeroen Vannevel [Tue, 15 Feb 2022 19:27:56 +0000 (19:27 +0000)]
simplified write

2 years agotest names
Jeroen Vannevel [Tue, 15 Feb 2022 19:22:36 +0000 (19:22 +0000)]
test names

2 years agoadd test for function pointer without identifier
Jeroen Vannevel [Tue, 15 Feb 2022 19:20:50 +0000 (19:20 +0000)]
add test for function pointer without identifier

2 years agouse Name instead of String
Jeroen Vannevel [Tue, 15 Feb 2022 19:12:23 +0000 (19:12 +0000)]
use Name instead of String

2 years agoremoved unwrap
Jeroen Vannevel [Tue, 15 Feb 2022 14:58:06 +0000 (14:58 +0000)]
removed unwrap

2 years agocleaning
Jeroen Vannevel [Tue, 15 Feb 2022 14:55:21 +0000 (14:55 +0000)]
cleaning

2 years agofmt
Jeroen Vannevel [Tue, 15 Feb 2022 14:47:51 +0000 (14:47 +0000)]
fmt

2 years agocleanup
Jeroen Vannevel [Tue, 15 Feb 2022 14:47:23 +0000 (14:47 +0000)]
cleanup

2 years agorough, but appears to work
Jeroen Vannevel [Tue, 15 Feb 2022 14:39:22 +0000 (14:39 +0000)]
rough, but appears to work

2 years agoMerge #11475
bors[bot] [Tue, 15 Feb 2022 09:36:22 +0000 (09:36 +0000)]
Merge #11475

11475: Impr mbe: remove unecessary temporary vec r=bellau a=bellau

It's a micro optimization. I don't know if it's really necessary (less alloc is always better).

Co-authored-by: bellau <laurent.belmonte@gmail.com>
2 years agoMerge #11480
bors[bot] [Tue, 15 Feb 2022 09:29:28 +0000 (09:29 +0000)]
Merge #11480

11480: fix: keyword hover works on non-keyword tokens if expanded to keyword r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoImpr mbe: remove unecessary temporary vec
bellau [Mon, 14 Feb 2022 20:06:13 +0000 (21:06 +0100)]
Impr mbe: remove unecessary temporary vec

2 years agofix: keyword hover works on non-keyword tokens if expanded to keyword
Lukas Wirth [Tue, 15 Feb 2022 09:09:19 +0000 (10:09 +0100)]
fix: keyword hover works on non-keyword tokens if expanded to keyword

2 years agoMerge #11477
bors[bot] [Tue, 15 Feb 2022 01:50:25 +0000 (01:50 +0000)]
Merge #11477

11477: fix: Fix cases where `Merge Imports` would drop imports. r=DropDemBits a=DropDemBits

Fixes #11466

Co-authored-by: DropDemBits <r3usrlnd@gmail.com>
2 years agoApply review fixes
DropDemBits [Tue, 15 Feb 2022 01:41:01 +0000 (20:41 -0500)]
Apply review fixes

2 years agofix: Don't drop glob with nested self
DropDemBits [Tue, 15 Feb 2022 00:41:49 +0000 (19:41 -0500)]
fix: Don't drop glob with nested self

2 years agofix: Don't drop tree when the other has `self`
DropDemBits [Mon, 14 Feb 2022 23:46:16 +0000 (18:46 -0500)]
fix: Don't drop tree when the other has `self`

2 years agoMerge #11369
bors[bot] [Mon, 14 Feb 2022 21:07:41 +0000 (21:07 +0000)]
Merge #11369

11369: feat: Add type hint for keyword expression hovers r=Veykril a=danii

Adds the return type of keywords to tool-tips where it makes sense. This applies to: `if`, `else`, `match`, `loop`, `unsafe` and `await`. Thanks to `@Veykril` for sharing the idea of putting return type highlighting on other keywords!
![image](https://user-images.githubusercontent.com/39541871/151611737-12325c23-a1f9-4fca-ae48-279b374bdcdf.png)

Closes #11359

Co-authored-by: Daniel Conley <himself@danii.dev>
2 years agoHide Keyword Expression Hover For Units `()`
Daniel Conley [Mon, 14 Feb 2022 20:26:40 +0000 (15:26 -0500)]
Hide Keyword Expression Hover For Units `()`

Cleaned up the code for keyword expression hovers.

Added a check to hide units `()` in keyword expression hovers.

2 years agoMerge #11458
bors[bot] [Mon, 14 Feb 2022 17:35:12 +0000 (17:35 +0000)]
Merge #11458

11458: Fix  Immovable generator syntax (static ||) not recognized #11448 r=Veykril a=bellau

Co-authored-by: bellau <laurent.belmonte@gmail.com>
2 years agoMerge #11470
bors[bot] [Mon, 14 Feb 2022 12:05:21 +0000 (12:05 +0000)]
Merge #11470

11470: correct the description of Struct GlobalState r=lnicola a=doki23

Fixes #11469

The description of GlobalState should be 'more than one impl'

Co-authored-by: doki <11144133+doki23@users.noreply.github.com>
2 years agocorrect the description of Struct GlobalState
doki [Mon, 14 Feb 2022 11:30:21 +0000 (19:30 +0800)]
correct the description of Struct GlobalState

2 years agoFix style
bellau [Mon, 14 Feb 2022 06:41:50 +0000 (07:41 +0100)]
Fix style

2 years agoMerge #11464
bors[bot] [Sun, 13 Feb 2022 16:15:37 +0000 (16:15 +0000)]
Merge #11464

11464: minor: Bump deps r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoBump deps
Laurențiu Nicola [Sat, 12 Feb 2022 07:25:26 +0000 (09:25 +0200)]
Bump deps

2 years agoMerge #11442 #11460
bors[bot] [Sun, 13 Feb 2022 12:43:16 +0000 (12:43 +0000)]
Merge #11442 #11460

11442: fix(rename): Use text range of a mod name after macro expansion r=Veykril a=tysg

Fixes #11417.

11460: fix: documentation of SsrParams r=Veykril a=nemethf

Fix #11429 by extending the documentation of SsrParms with the
mandatory field 'selections'.  Copy its description from lsp_ext.rs.

Co-authored-by: Tianyi Song <42670338+tysg@users.noreply.github.com>
Co-authored-by: Felicián Németh <felician.nemeth@gmail.com>
2 years agoMerge #11459
bors[bot] [Sun, 13 Feb 2022 12:35:11 +0000 (12:35 +0000)]
Merge #11459

11459: fix: add missing experimental capabilities r=Veykril a=nemethf

Fix #11389 by extending server_capabilities.experimental with
matchingBrace, externalDocs, moveItems.  Also, sort entries
alphabetically.

Co-authored-by: Felicián Németh <felician.nemeth@gmail.com>
2 years agoAddress PR comments
Tianyi Song [Sun, 13 Feb 2022 10:14:39 +0000 (18:14 +0800)]
Address PR comments

2 years agooops, remove println
bellau [Sun, 13 Feb 2022 08:11:35 +0000 (09:11 +0100)]
oops, remove println

2 years agofix handle static async and static async move
bellau [Sun, 13 Feb 2022 08:09:44 +0000 (09:09 +0100)]
fix handle static async and static async move

2 years agoExtract struct from enum variant filters generics
Jonas Goronczy [Sat, 12 Feb 2022 22:21:41 +0000 (23:21 +0100)]
Extract struct from enum variant filters generics

Extracting a struct from an enum variant now filters out only the
generic parameters necessary for the new struct.
Bounds will be copied to the new struct, but unneeded ones are not
filtered out.
Extracting bounds in a where clause are still not implemented.

2 years agoFix style
bellau [Sat, 12 Feb 2022 16:31:17 +0000 (17:31 +0100)]
Fix style

2 years agosupport static move too
bellau [Sat, 12 Feb 2022 15:07:58 +0000 (16:07 +0100)]
support static move too

2 years agofix: documentation of SsrParams
Felicián Németh [Sat, 12 Feb 2022 14:47:54 +0000 (15:47 +0100)]
fix: documentation of SsrParams

Fix #11429 by extending the documentation of SsrParms with the
mandatory field 'selections'.  Copy its description from lsp_ext.rs.

2 years agofix: add missing experimental capabilities
Felicián Németh [Sat, 12 Feb 2022 14:32:43 +0000 (15:32 +0100)]
fix: add missing experimental capabilities

Fix #11389 by extending server_capabilities.experimental with
matchingBrace, externalDocs, moveItems.  Also, sort entries
alphabetically.

2 years agoFix styles
bellau [Sat, 12 Feb 2022 14:35:06 +0000 (15:35 +0100)]
Fix styles

2 years agoFix Immovable generator syntax (static ||) not recognized #11448
bellau [Sat, 12 Feb 2022 14:17:10 +0000 (15:17 +0100)]
Fix  Immovable generator syntax (static ||) not recognized #11448

2 years agoMerge #11444
bors[bot] [Sat, 12 Feb 2022 12:48:46 +0000 (12:48 +0000)]
Merge #11444

11444: feat: Fix up syntax errors in attribute macro inputs to make completion work more often r=flodiebold a=flodiebold

This implements the "fix up syntax nodes" workaround mentioned in #11014. It isn't much more than a proof of concept; I have only implemented a few cases, but it already helps quite a bit.

Some notes:
 - I'm not super happy about how much the fixup procedure needs to interact with the syntax node -> token tree conversion code (e.g. needing to share the token map). This could maybe be simplified with some refactoring of that code.
 - It would maybe be nice to have the fixup procedure reuse or share information with the parser, though I'm not really sure how much that would actually help.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>