]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agofix: `replace_qualified_name_with_use` does not use full item path for replacements
Lukas Wirth [Wed, 5 Jan 2022 22:46:58 +0000 (23:46 +0100)]
fix: `replace_qualified_name_with_use` does not use full item path for replacements

2 years agoMerge #11157
bors[bot] [Tue, 4 Jan 2022 16:49:47 +0000 (16:49 +0000)]
Merge #11157

11157: internal: Remove `SemanticScope::speculative_resolve_as_mac` r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoMerge #11187
bors[bot] [Tue, 4 Jan 2022 16:10:56 +0000 (16:10 +0000)]
Merge #11187

11187: Rename and use the 1.55 ABI for 1.54 r=lnicola a=lnicola

It seems that what we used to call the 1.55 ABI was actually introduced in 1.54.

CC #10799

Thanks to `@danielframpton` for finding it.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoRename and use the 1.55 ABI for 1.54
Laurențiu Nicola [Tue, 4 Jan 2022 11:13:09 +0000 (13:13 +0200)]
Rename and use the 1.55 ABI for 1.54

2 years agoMerge #11184
bors[bot] [Tue, 4 Jan 2022 10:19:37 +0000 (10:19 +0000)]
Merge #11184

11184: Correctly pass through mutable parameter references when extracting a function r=Veykril a=Vannevelj

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

I have based this investigation based on my understanding of [the Borrowing chapter](https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html) but I wasn't able to debug the test runs or see it in action in an IDE. I'll try to figure out how to do that for future PRs but for now, the tests seem to confirm my understanding. I'll lay out my hypothesis below.

Here we define the parameters for the to-be-generated function:

https://github.com/rust-analyzer/rust-analyzer/blob/7409880a07803c34590ad162d7854061145c6eae/crates/ide_assists/src/handlers/extract_function.rs#L882

Three values in particular are important here: `requires_mut`, `is_copy` and `move_local`. These will in turn be used here to determine the kind of parameter:

https://github.com/rust-analyzer/rust-analyzer/blob/7409880a07803c34590ad162d7854061145c6eae/crates/ide_assists/src/handlers/extract_function.rs#L374-L381

and then here to determine what transformation is needed for the calling argument:

https://github.com/rust-analyzer/rust-analyzer/blob/7409880a07803c34590ad162d7854061145c6eae/crates/ide_assists/src/handlers/extract_function.rs#L383-L390

which then gets transformed here:

https://github.com/rust-analyzer/rust-analyzer/blob/7409880a07803c34590ad162d7854061145c6eae/crates/syntax/src/ast/make.rs#L381-L383

What I believe is happening is that
* `requires_mut` is `false` (it already is marked as mutable),
* `is_copy` is `false` (`Foo` does not implement `Copy`), and
* `move_local` is `false` (it has further usages)

According to the pattern matching in `fn kind()`, that would lead to `ParamKind::SharedRef` which in turn applies a transformation that prepends `&`.

However if I look at the chapter on borrowing then we only need to mark an argument as a reference if we actually own it. In this case the value is passed through as a reference parameter into the current function which means we never had ownership in the first place. By including the additional check for a reference parameter, `move_local` now becomes `true` and the resulting parameter is now `ParamKind::Value` which will avoid applying any transformations. This was further obscured by the fact that you need further usages of the variable or `move_local` would be considered `true` after all.

I didn't follow it in depth but it appears this idea applies for both the generated argument and the generated parameter.
There are existing tests that account for `&mut` values but they refer to local variables for which we do have ownership and as such they didn't expose this issue.

Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
2 years agoreduced the tests to their bare essence
Jeroen Vannevel [Tue, 4 Jan 2022 10:11:04 +0000 (10:11 +0000)]
reduced the tests to their bare essence

2 years agoMerge #11186
bors[bot] [Tue, 4 Jan 2022 09:57:22 +0000 (09:57 +0000)]
Merge #11186

11186: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agominor: Simplify
Lukas Wirth [Tue, 4 Jan 2022 09:56:17 +0000 (10:56 +0100)]
minor: Simplify

2 years agoadditional test without further usages
Jeroen Vannevel [Tue, 4 Jan 2022 02:12:53 +0000 (02:12 +0000)]
additional test without further usages

2 years agoCorrectly pass through mutable references when extracting a function
Jeroen Vannevel [Tue, 4 Jan 2022 01:48:08 +0000 (01:48 +0000)]
Correctly pass through mutable references when extracting a function

2 years agoMerge #11061
bors[bot] [Mon, 3 Jan 2022 17:59:00 +0000 (17:59 +0000)]
Merge #11061

11061: Support "move if to guard" for if else chains r=weirane a=weirane

The idea is to first parse the if else chain into a vector of `(Condition, BlockExpr)`s until we reach an iflet branch, an else branch, or the end (the tail). Then add the match arms with guard for the vector, and add the tail with no if guard.

Because the whole original match arm is replaced and the generated code doesn't have redundent commas, I removed redundent commas in some test cases.

Closes #11033.

Co-authored-by: Wang Ruochen <wrc@ruo-chen.wang>
2 years agoUpdate generated tests
Wang Ruochen [Mon, 3 Jan 2022 17:48:50 +0000 (09:48 -0800)]
Update generated tests

2 years agoDon't add pattern if there is a catch all afterwards
Wang Ruochen [Mon, 3 Jan 2022 17:37:29 +0000 (09:37 -0800)]
Don't add pattern if there is a catch all afterwards

2 years agoMerge #11115
bors[bot] [Mon, 3 Jan 2022 16:00:05 +0000 (16:00 +0000)]
Merge #11115

11115: internal: refactor: avoid separate traversal in replace filter map next with find map r=Veykril a=rainy-me

fix: #7428

Co-authored-by: rainy-me <github@yue.coffee>
2 years agogive `resolve_derive_ident` a more robust api
Lukas Wirth [Mon, 3 Jan 2022 15:00:45 +0000 (16:00 +0100)]
give `resolve_derive_ident` a more robust api

2 years agoMerge #11180
bors[bot] [Mon, 3 Jan 2022 14:22:37 +0000 (14:22 +0000)]
Merge #11180

11180: minor: add missing test r=matklad a=matklad

This test kills the following mutant:

diff --git a/crates/mbe/src/tt_iter.rs b/crates/mbe/src/tt_iter.rs
index 9d2b1da9a..055d9a733 100644
--- a/crates/mbe/src/tt_iter.rs
+++ b/crates/mbe/src/tt_iter.rs
`@@` -134,7 +134,7 `@@` impl<'a> TtIter<'a> {
         self.inner = self.inner.as_slice()[res.len()..].iter();
         let res = match res.len() {
             1 => Some(res[0].cloned()),
-            0 => None,
+            // 0 => None,
             _ => Some(tt::TokenTree::Subtree(tt::Subtree {
                 delimiter: None,
                 token_trees: res.into_iter().map(|it| it.cloned()).collect(),

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agominor: add missing test
Aleksey Kladov [Mon, 3 Jan 2022 14:21:18 +0000 (17:21 +0300)]
minor: add missing test

This test kills the following mutant:

diff --git a/crates/mbe/src/tt_iter.rs b/crates/mbe/src/tt_iter.rs
index 9d2b1da9a..055d9a733 100644
--- a/crates/mbe/src/tt_iter.rs
+++ b/crates/mbe/src/tt_iter.rs
@@ -134,7 +134,7 @@ impl<'a> TtIter<'a> {
         self.inner = self.inner.as_slice()[res.len()..].iter();
         let res = match res.len() {
             1 => Some(res[0].cloned()),
-            0 => None,
+            // 0 => None,
             _ => Some(tt::TokenTree::Subtree(tt::Subtree {
                 delimiter: None,
                 token_trees: res.into_iter().map(|it| it.cloned()).collect(),

2 years agoMerge #11179
bors[bot] [Mon, 3 Jan 2022 13:28:56 +0000 (13:28 +0000)]
Merge #11179

11179: minor: simplify mbe matcher r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agosimplify
Aleksey Kladov [Mon, 3 Jan 2022 13:27:16 +0000 (16:27 +0300)]
simplify

2 years agosimplify
Aleksey Kladov [Mon, 3 Jan 2022 13:22:41 +0000 (16:22 +0300)]
simplify

2 years agoMerge #11178
bors[bot] [Mon, 3 Jan 2022 13:09:15 +0000 (13:09 +0000)]
Merge #11178

11178: Fix replace_match_with_if_let removing unsafe blocks r=bugadani a=bugadani

If the assist encounters an unsafe block in one of the match arms, the assist generated intermediate code like the following:

```rust
if let Foo(_) = foo {
    <then branch>
} else unsafe { ... }
```

Which was then parsed back and the unsafe branch got completely removed, removing in invalid code output:

```rust
if let Foo(_) = foo {
    <then branch>
} else
```

This PR fixes this issue.

However, I'm sure there is a better, more general solution here, but I lack familiarity with rust-analyzer. `make::expr_if` looks like it expects a `BlockExpr` that, when printed, is wrapped in braces correctly, but I'm sure changing the display impl for an `unsafe` `BlockExpr` would have caused problems. I could have changed `make::expr_if` instead to special case unsafe blocks, but that would have meant some expressions getting wrapped by the caller (as previously), and some others by the function.

Co-authored-by: Dániel Buga <bugadani@gmail.com>
2 years agoFix replace_match_with_if_let removing blocks with modifiers
Dániel Buga [Mon, 3 Jan 2022 10:20:59 +0000 (11:20 +0100)]
Fix replace_match_with_if_let removing blocks with modifiers

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agoMerge #11177
bors[bot] [Mon, 3 Jan 2022 02:03:03 +0000 (02:03 +0000)]
Merge #11177

11177: internal: dont descend into comments r=Veykril a=jhgg

fixes #11176

Co-authored-by: Jake Heinz <jh@discordapp.com>
2 years agointernal: dont descend into comments
Jake Heinz [Mon, 3 Jan 2022 01:50:49 +0000 (01:50 +0000)]
internal: dont descend into comments

2 years agoMerge #11088
bors[bot] [Mon, 3 Jan 2022 00:51:08 +0000 (00:51 +0000)]
Merge #11088

11088: closes #10446 hide type inlay hints r=Veykril a=Heinenen

Passes tests as described in #10446
Works for all happy cases, there may be some cases that I forgot as I am not that familiar with Rust and r-a (yet).

Co-authored-by: Heinenen <th.m.heinen@gmail.com>
2 years agoMerge #11173
bors[bot] [Mon, 3 Jan 2022 00:40:30 +0000 (00:40 +0000)]
Merge #11173

11173: Allow adding partially resolved types r=Veykril a=SomeoneToIgnore

Sometimes when writing something like `let foo = Arc::new(Mutex::new(CrazyGenerics::new(HashMap::new())))`, I want/have to specify an explicit type for the expression.
Using turbofish isn't very readable and not always appreciated by guidelines, so `let foo: T` has to be filled.

To ease that, the PR enables the `add_explicit_type` assist on types that contain unknown types and some generics.
Fully unresolved types, arrays with unknown types and other known cases behave the same.

`_` placeholder was chosen to replace an unknown type:

```rust
let foo = HashMap::new();
// after assist usage, turns into
let foo: HashMap<_, _> = HashMap::new();
```

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2 years agoMerge #11175
bors[bot] [Mon, 3 Jan 2022 00:32:31 +0000 (00:32 +0000)]
Merge #11175

11175: fix: Fix highlighting hack for self-params r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Fix highlighting hack for self-params
Lukas Wirth [Mon, 3 Jan 2022 00:32:03 +0000 (01:32 +0100)]
fix: Fix highlighting hack for self-params

2 years agoAllow adding partially resolved types
Kirill Bulatov [Sun, 2 Jan 2022 23:34:33 +0000 (01:34 +0200)]
Allow adding partially resolved types

2 years agocleanup
Lukas Wirth [Sun, 2 Jan 2022 16:34:28 +0000 (17:34 +0100)]
cleanup

2 years agoImplement ToDef for ast::Attr
Lukas Wirth [Sun, 2 Jan 2022 15:58:21 +0000 (16:58 +0100)]
Implement ToDef for ast::Attr

2 years agointernal: Record unresolved derive invocations in hir
Lukas Wirth [Sat, 1 Jan 2022 19:31:04 +0000 (20:31 +0100)]
internal: Record unresolved derive invocations in hir

2 years agoMerge #11171
bors[bot] [Sun, 2 Jan 2022 22:15:30 +0000 (22:15 +0000)]
Merge #11171

11171: fix: Fix tool module classification not working correctly r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoFix tool module classification not working correctly
Lukas Wirth [Sun, 2 Jan 2022 22:14:18 +0000 (23:14 +0100)]
Fix tool module classification not working correctly

2 years agoMerge #11170
bors[bot] [Sun, 2 Jan 2022 21:24:07 +0000 (21:24 +0000)]
Merge #11170

11170: minor: Cleanup syntax highlighting r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agominor: Cleanup syntax highlighting
Lukas Wirth [Sun, 2 Jan 2022 21:22:13 +0000 (22:22 +0100)]
minor: Cleanup syntax highlighting

2 years agoMerge #11169
bors[bot] [Sun, 2 Jan 2022 18:27:16 +0000 (18:27 +0000)]
Merge #11169

11169: internal: Handle macro calls better in highlighting r=Veykril a=Veykril

Introduces a new semantic highlighting tag for the `!` character of macro calls.

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix NameRefClass misclassifying proc-macros
Lukas Wirth [Sun, 2 Jan 2022 18:20:10 +0000 (19:20 +0100)]
fix NameRefClass misclassifying proc-macros

2 years agofix syntactic highlighting for macros
Lukas Wirth [Sun, 2 Jan 2022 18:06:19 +0000 (19:06 +0100)]
fix syntactic highlighting for macros

2 years agointernal: Handle macro calls better in highlighting
Lukas Wirth [Sun, 2 Jan 2022 18:10:10 +0000 (19:10 +0100)]
internal: Handle macro calls better in highlighting

2 years agoMerge #11166
bors[bot] [Sun, 2 Jan 2022 16:49:40 +0000 (16:49 +0000)]
Merge #11166

11166: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agominor: Simplify
Lukas Wirth [Sun, 2 Jan 2022 15:35:58 +0000 (16:35 +0100)]
minor: Simplify

2 years agoMerge #11168
bors[bot] [Sun, 2 Jan 2022 16:08:23 +0000 (16:08 +0000)]
Merge #11168

11168: minor: drop dead code r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agominor: replace panics with types
Aleksey Kladov [Sun, 2 Jan 2022 16:05:37 +0000 (19:05 +0300)]
minor: replace panics with types

2 years agominor: drop dead code
Aleksey Kladov [Sun, 2 Jan 2022 16:03:38 +0000 (19:03 +0300)]
minor: drop dead code

2 years agoMerge #11167
bors[bot] [Sun, 2 Jan 2022 15:50:57 +0000 (15:50 +0000)]
Merge #11167

11167: internal: check top level entry point invariants r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agoadd empty input tests
Aleksey Kladov [Sun, 2 Jan 2022 15:50:32 +0000 (18:50 +0300)]
add empty input tests

2 years agomore intuitive order
Aleksey Kladov [Sun, 2 Jan 2022 15:46:01 +0000 (18:46 +0300)]
more intuitive order

2 years agocheck top level entry point invariants
Aleksey Kladov [Sun, 2 Jan 2022 15:41:32 +0000 (18:41 +0300)]
check top level entry point invariants

2 years agoadd top-level tests for expressions
Aleksey Kladov [Sun, 2 Jan 2022 14:52:05 +0000 (17:52 +0300)]
add top-level tests for expressions

2 years agoMerge #11165
bors[bot] [Sun, 2 Jan 2022 14:46:05 +0000 (14:46 +0000)]
Merge #11165

11165: internal: start enforcing invariants for top-level entry points r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agoadd top level tests for types
Aleksey Kladov [Sun, 2 Jan 2022 14:45:18 +0000 (17:45 +0300)]
add top level tests for types

2 years agoenforce parsing invariant for patterns
Aleksey Kladov [Sun, 2 Jan 2022 14:32:15 +0000 (17:32 +0300)]
enforce parsing invariant for patterns

2 years agoMerge #11164
bors[bot] [Sun, 2 Jan 2022 14:19:07 +0000 (14:19 +0000)]
Merge #11164

11164: internal: more macro tests r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: more macro tests
Aleksey Kladov [Sun, 2 Jan 2022 14:18:21 +0000 (17:18 +0300)]
internal: more macro tests

2 years agoadd test for macro items
Aleksey Kladov [Sun, 2 Jan 2022 13:48:10 +0000 (16:48 +0300)]
add test for macro items

2 years agoMerge #11163
bors[bot] [Sun, 2 Jan 2022 12:19:25 +0000 (12:19 +0000)]
Merge #11163

11163: internal: start tests for top-level parser entry points r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agosplit prefix/top tests
Aleksey Kladov [Sun, 2 Jan 2022 12:18:34 +0000 (15:18 +0300)]
split prefix/top tests

2 years agoadd tests for macro statements
Aleksey Kladov [Sun, 2 Jan 2022 12:17:32 +0000 (15:17 +0300)]
add tests for macro statements

2 years agostart top-level entry point tests
Aleksey Kladov [Sun, 2 Jan 2022 12:15:04 +0000 (15:15 +0300)]
start top-level entry point tests

2 years agominor: generalize
Aleksey Kladov [Sun, 2 Jan 2022 12:01:20 +0000 (15:01 +0300)]
minor: generalize

2 years agoMerge #11162
bors[bot] [Sun, 2 Jan 2022 11:41:54 +0000 (11:41 +0000)]
Merge #11162

11162: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agominor: Simplify
Lukas Wirth [Sun, 2 Jan 2022 11:40:46 +0000 (12:40 +0100)]
minor: Simplify

2 years agoMerge #11161
bors[bot] [Sun, 2 Jan 2022 10:08:10 +0000 (10:08 +0000)]
Merge #11161

11161: minor: style nits r=lnicola a=lnicola

 - avoid `fold` with a `Vec` seed which could have been a `for_each`
 - we can't drop the dependency, but avoid `Itertools::collect_vec`

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoAvoid collect_vec from itertools
Laurențiu Nicola [Sun, 2 Jan 2022 10:05:31 +0000 (12:05 +0200)]
Avoid collect_vec from itertools

2 years agoReplace folds with for loops
Laurențiu Nicola [Sun, 2 Jan 2022 10:03:34 +0000 (12:03 +0200)]
Replace folds with for loops

2 years agoMerge #11160
bors[bot] [Sun, 2 Jan 2022 03:48:38 +0000 (03:48 +0000)]
Merge #11160

11160: internal: Use basic `NonEmptyVec` in mbe::syntax_bridge r=Veykril a=Veykril

There are some places in the ide crates where this can be used as well if memory serves right.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: Use basic NonEmptyVec in mbe::syntax_bridge
Lukas Wirth [Sun, 2 Jan 2022 02:25:47 +0000 (03:25 +0100)]
internal: Use basic NonEmptyVec in mbe::syntax_bridge

2 years agoMerge #11159
bors[bot] [Sun, 2 Jan 2022 01:39:53 +0000 (01:39 +0000)]
Merge #11159

11159: minor: Simplify r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoSimplify
Lukas Wirth [Sun, 2 Jan 2022 01:39:14 +0000 (02:39 +0100)]
Simplify

2 years agoMerge #11158
bors[bot] [Sat, 1 Jan 2022 21:20:55 +0000 (21:20 +0000)]
Merge #11158

11158: fix: Enable completions for `<_>::$0` r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agofix: Enable completions for `<_>::$0`
Lukas Wirth [Sat, 1 Jan 2022 21:20:03 +0000 (22:20 +0100)]
fix: Enable completions for `<_>::$0`

2 years agoMerge #11156
bors[bot] [Sat, 1 Jan 2022 19:44:16 +0000 (19:44 +0000)]
Merge #11156

11156: internal: Record unresolved derive invocations in hir r=Veykril a=Veykril

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agointernal: Record unresolved derive invocations in hir
Lukas Wirth [Sat, 1 Jan 2022 19:31:04 +0000 (20:31 +0100)]
internal: Record unresolved derive invocations in hir

2 years agoMerge #11153
bors[bot] [Sat, 1 Jan 2022 17:04:29 +0000 (17:04 +0000)]
Merge #11153

11153: internal: add more prefix entry point tests r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agointernal: add more prefix entry point tests
Aleksey Kladov [Sat, 1 Jan 2022 16:51:13 +0000 (19:51 +0300)]
internal: add more prefix entry point tests

2 years agoMerge #11136
bors[bot] [Sat, 1 Jan 2022 16:42:22 +0000 (16:42 +0000)]
Merge #11136

11136: Turbo fish assist supports multiple type arguments r=matklad a=Vannevelj

This fixes #11135 (changelog: bug).

I've only started using Rust a few days ago but saw this issue on the top of the list when I looked at this repo. I based myself on [this blog post](https://techblog.tonsser.com/posts/what-is-rusts-turbofish) to understand what a "turbo fish" is so let me know if I missed anything.

Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
2 years agoMerge #11151
bors[bot] [Sat, 1 Jan 2022 16:17:39 +0000 (16:17 +0000)]
Merge #11151

11151: feat: correctly fallback to notify if the clinet-side file watching is not supported r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agotest: force client-side watching
Aleksey Kladov [Sat, 1 Jan 2022 16:10:34 +0000 (19:10 +0300)]
test: force client-side watching

The direct reason for this is to fix CI on windows, which seems to fail
for some reason after we fixed the watcher-selection logic which (I
think) changed the tests behavior to use notify rather than client.

But this patch seems to make sense in general -- file watching is
notoriously finicky, so controlling it explicitly leads to less fragile
tests.

2 years agoMerge #11152
bors[bot] [Sat, 1 Jan 2022 16:03:24 +0000 (16:03 +0000)]
Merge #11152

11152: internal: add more tests for entry points r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agoadd path tests
Aleksey Kladov [Sat, 1 Jan 2022 16:02:47 +0000 (19:02 +0300)]
add path tests

2 years agoadd expr tests
Aleksey Kladov [Thu, 30 Dec 2021 12:09:37 +0000 (15:09 +0300)]
add expr tests

2 years agotests for ty
Aleksey Kladov [Thu, 30 Dec 2021 11:26:59 +0000 (14:26 +0300)]
tests for ty

2 years agointernal: add tests for patterns
Aleksey Kladov [Thu, 30 Dec 2021 11:20:35 +0000 (14:20 +0300)]
internal: add tests for patterns

2 years agobetter error message
Aleksey Kladov [Sat, 1 Jan 2022 14:43:02 +0000 (17:43 +0300)]
better error message

2 years agofeat: correctly fallback to notify if the clinet-side file watching is not supported
Aleksey Kladov [Sat, 1 Jan 2022 14:26:54 +0000 (17:26 +0300)]
feat: correctly fallback to notify if the clinet-side file watching is not supported

2 years agoMerge #11144
bors[bot] [Thu, 30 Dec 2021 12:52:05 +0000 (12:52 +0000)]
Merge #11144

11144: fix: Fix server path on NixOS r=lnicola a=lnicola

See https://github.com/rust-analyzer/rust-analyzer/commit/c0d0ceefb29111732cacf39dbb57fe9f3ce25ee8#commitcomment-62688259.

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoFix server path on NixOS
Laurențiu Nicola [Thu, 30 Dec 2021 12:50:54 +0000 (14:50 +0200)]
Fix server path on NixOS

2 years agoMerge #11141
bors[bot] [Thu, 30 Dec 2021 10:30:28 +0000 (10:30 +0000)]
Merge #11141

11141: internal: add tests for extra parser entry points r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agoMerge #10692
bors[bot] [Thu, 30 Dec 2021 08:41:10 +0000 (08:41 +0000)]
Merge #10692

10692: Migrate to new rowan r=lnicola a=azdavis

Since https://github.com/rust-analyzer/rowan/pull/122 was merged into rowan, this could be how rust-analyzer migrates.

Co-authored-by: Ariel Davis <ariel.z.davis@icloud.com>
2 years agoMigrate to SyntaxNodePtr in new rowan
Ariel Davis [Thu, 30 Dec 2021 07:48:53 +0000 (23:48 -0800)]
Migrate to SyntaxNodePtr in new rowan

2 years agorestore invariatns
Aleksey Kladov [Wed, 29 Dec 2021 17:37:08 +0000 (20:37 +0300)]
restore invariatns

2 years agoparse empty statemet as statemetn
Aleksey Kladov [Wed, 29 Dec 2021 17:04:36 +0000 (20:04 +0300)]
parse empty statemet as statemetn

2 years agoAdd test
Aleksey Kladov [Wed, 29 Dec 2021 16:37:35 +0000 (19:37 +0300)]
Add test

2 years agorename
Aleksey Kladov [Wed, 29 Dec 2021 16:18:34 +0000 (19:18 +0300)]
rename

2 years agocompress
Aleksey Kladov [Wed, 29 Dec 2021 15:51:05 +0000 (18:51 +0300)]
compress

2 years agoadd automated semicolon insertion test
Aleksey Kladov [Wed, 29 Dec 2021 15:37:06 +0000 (18:37 +0300)]
add automated semicolon insertion test

2 years agointernal: add tests for extra parser entry points
Aleksey Kladov [Wed, 29 Dec 2021 15:23:34 +0000 (18:23 +0300)]
internal: add tests for extra parser entry points

2 years agoformatting
Jeroen Vannevel [Tue, 28 Dec 2021 18:52:12 +0000 (18:52 +0000)]
formatting

2 years agoturbo fish supports multiple type arguments
Jeroen Vannevel [Tue, 28 Dec 2021 18:41:34 +0000 (18:41 +0000)]
turbo fish supports multiple type arguments