]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMerge #9552
bors[bot] [Sat, 10 Jul 2021 16:25:58 +0000 (16:25 +0000)]
Merge #9552

9552: internal: `add_explicit_type` respects coercions r=Veykril a=Veykril

or so I'd like to say but there is one odd case here where it doesn't work(see [review](https://github.com/rust-analyzer/rust-analyzer/pull/9552#discussion_r667351856))

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years ago`add_explicit_type` respects coercions
Lukas Wirth [Sat, 10 Jul 2021 16:19:46 +0000 (18:19 +0200)]
`add_explicit_type` respects coercions

2 years agoResolve type adjustments
Lukas Wirth [Sat, 10 Jul 2021 16:19:23 +0000 (18:19 +0200)]
Resolve type adjustments

2 years agoMerge #9553
bors[bot] [Sat, 10 Jul 2021 16:07:01 +0000 (16:07 +0000)]
Merge #9553

9553: minor: Disambiguate replace with if let assist labels r=Veykril a=Veykril

Turns out we have two assists for replacing something with `if let` constructs, so having the cursor on a `let` keyword inside a match gave you two identical assist labels which is rather confusing.
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoDisambiguate replace with if let assist labels
Lukas Wirth [Sat, 10 Jul 2021 15:41:25 +0000 (17:41 +0200)]
Disambiguate replace with if let assist labels

2 years agoMerge #9555 #9556
bors[bot] [Sat, 10 Jul 2021 15:59:26 +0000 (15:59 +0000)]
Merge #9555 #9556

9555: feat: Enable `auto_import` on ident patterns r=Veykril a=Veykril

Helpful for when you want to import a type in a pattern right before destructuring it.

9556: Bump deps r=lnicola a=lnicola

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoBump chalk
Laurențiu Nicola [Sat, 10 Jul 2021 15:56:56 +0000 (18:56 +0300)]
Bump chalk

2 years agoBump rustc_lexer a little
Laurențiu Nicola [Sat, 10 Jul 2021 15:51:35 +0000 (18:51 +0300)]
Bump rustc_lexer a little

2 years agoEnable `auto_import` on ident patterns
Lukas Wirth [Sat, 10 Jul 2021 15:57:33 +0000 (17:57 +0200)]
Enable `auto_import` on ident patterns

2 years agoBump deps
Laurențiu Nicola [Sat, 10 Jul 2021 15:38:41 +0000 (18:38 +0300)]
Bump deps

2 years agoMerge #9551
bors[bot] [Sat, 10 Jul 2021 15:04:15 +0000 (15:04 +0000)]
Merge #9551

9551: fix: `replace_qualified_name_with_use` keeps qualifier for import r=Veykril a=Veykril

Fixes #9537, #9540
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years ago`replace_qualified_name_with_use` keeps qualifier for import
Lukas Wirth [Sat, 10 Jul 2021 15:03:24 +0000 (17:03 +0200)]
`replace_qualified_name_with_use` keeps qualifier for import

2 years agoMerge #9548
bors[bot] [Sat, 10 Jul 2021 11:39:13 +0000 (11:39 +0000)]
Merge #9548

9548: add: Adding self keyword completion in complete_fn_param r=lnicola a=feniljain

Solves #9522

I haven't added Arc<self> for now as there were some conflicting opinions on it

Co-authored-by: vi_mi <fenil.jain2018@vitstudent.ac.in>
2 years agoadd: Adding self keyword completion in complete_fn_param
vi_mi [Sat, 10 Jul 2021 09:42:16 +0000 (15:12 +0530)]
add: Adding self keyword completion in complete_fn_param

2 years agoMerge #9545
bors[bot] [Sat, 10 Jul 2021 10:27:16 +0000 (10:27 +0000)]
Merge #9545

9545: Record autoderef adjustments r=flodiebold a=Veykril

cc #9475

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoRecord autoderef adjustments
Lukas Wirth [Fri, 9 Jul 2021 17:12:56 +0000 (19:12 +0200)]
Record autoderef adjustments

2 years agoMerge #9542
bors[bot] [Fri, 9 Jul 2021 15:09:44 +0000 (15:09 +0000)]
Merge #9542

9542: cargo_metadata 0.14 r=matklad a=kjeremy

Removes the following dependent crates:
* semver-parser
* pest
* ucd-trie

Removes project_model's dependency on itertools

Co-authored-by: kjeremy <kjeremy@gmail.com>
2 years agocargo_metadata 0.14
kjeremy [Fri, 9 Jul 2021 15:01:55 +0000 (11:01 -0400)]
cargo_metadata 0.14

Removes the following dependent crates:
* semver-parser
* pest
* ucd-trie

Removes project_model's dependency on itertools

2 years agoMerge #9541
bors[bot] [Fri, 9 Jul 2021 14:42:39 +0000 (14:42 +0000)]
Merge #9541

9541: Adding async keyword when await is present in generate_function assist r=feniljain a=feniljain

Solves #9394

Co-authored-by: vi_mi <fenil.jain2018@vitstudent.ac.in>
2 years agofix: Adding async keyword when await is present in generate_function assist
vi_mi [Fri, 9 Jul 2021 13:48:22 +0000 (19:18 +0530)]
fix: Adding async keyword when await is present in generate_function assist

2 years agoMerge #9512
bors[bot] [Fri, 9 Jul 2021 14:07:23 +0000 (14:07 +0000)]
Merge #9512

9512: Record coercion adjustments r=Veykril a=Veykril

cc https://github.com/rust-analyzer/rust-analyzer/issues/9475

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoUse `CoerceMany` in `BreakableContext`
Lukas Wirth [Fri, 9 Jul 2021 12:56:49 +0000 (14:56 +0200)]
Use `CoerceMany` in `BreakableContext`

2 years agoMerge #9536
bors[bot] [Thu, 8 Jul 2021 19:41:03 +0000 (19:41 +0000)]
Merge #9536

9536: Represent opaque types with TyKind::OpaqueType r=flodiebold a=flodiebold

... instead of using `AliasTy`. Chalk turns the alias type into the
placeholder during unification anyway, which confuses our method
resolution logic.

Fixes #9530.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2 years agoRepresent opaque types with TyKind::OpaqueType
Florian Diebold [Thu, 8 Jul 2021 19:19:53 +0000 (21:19 +0200)]
Represent opaque types with TyKind::OpaqueType

... instead of using `AliasTy`. Chalk turns the alias type into the
placeholder during unification anyway, which confuses our method
resolution logic.

Fixes #9530.

2 years agoMerge #9534
bors[bot] [Thu, 8 Jul 2021 14:19:06 +0000 (14:19 +0000)]
Merge #9534

9534: minor: one more usless type r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 years agominor: one more usless type
Aleksey Kladov [Thu, 8 Jul 2021 14:18:44 +0000 (17:18 +0300)]
minor: one more usless type

2 years agoMerge #9533
bors[bot] [Thu, 8 Jul 2021 13:51:27 +0000 (13:51 +0000)]
Merge #9533

9533: minor: Update list of safe intrinsics r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2 years agoUpdate list of safe intrinsics
Lukas Wirth [Thu, 8 Jul 2021 13:49:39 +0000 (15:49 +0200)]
Update list of safe intrinsics

2 years agoMerge #9532
bors[bot] [Thu, 8 Jul 2021 13:05:54 +0000 (13:05 +0000)]
Merge #9532

9532: Shorten thread names r=lnicola a=weirdsmiley

Threads on Linux have an upper limit of 16 characters, hence dropping `Thread` from their names.

Co-authored-by: Manas <manas18244@iiitd.ac.in>
2 years agoAdd some more adjustment test annotations
Lukas Wirth [Thu, 8 Jul 2021 13:03:57 +0000 (15:03 +0200)]
Add some more adjustment test annotations

2 years agoThis patch shortens the spawned threads' names, as threads on Linux
Manas [Thu, 8 Jul 2021 12:39:41 +0000 (18:09 +0530)]
This patch shortens the spawned threads' names, as threads on Linux
have an upper limit of 16 characters for their names.

2 years agoCopy some comments from rustc
Lukas Wirth [Thu, 8 Jul 2021 12:31:16 +0000 (14:31 +0200)]
Copy some comments from rustc

2 years agoMinor cleanup
Lukas Wirth [Thu, 8 Jul 2021 12:27:54 +0000 (14:27 +0200)]
Minor cleanup

2 years agoImplement `CoerceMany`
Lukas Wirth [Thu, 8 Jul 2021 12:16:23 +0000 (14:16 +0200)]
Implement `CoerceMany`

2 years agoRecord coercion adjustments
Lukas Wirth [Tue, 6 Jul 2021 16:05:40 +0000 (18:05 +0200)]
Record coercion adjustments

2 years agoMerge #9529
bors[bot] [Thu, 8 Jul 2021 09:55:27 +0000 (09:55 +0000)]
Merge #9529

9529: fix: Don't unify arrays with their elements r=flodiebold a=lnicola

Addresses https://github.com/rust-analyzer/rust-analyzer/pull/9526#issuecomment-876206100.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2 years agoDon't unify array elements with their arrays
Laurențiu Nicola [Thu, 8 Jul 2021 08:22:29 +0000 (11:22 +0300)]
Don't unify array elements with their arrays

2 years agoMerge #9526
bors[bot] [Wed, 7 Jul 2021 22:13:35 +0000 (22:13 +0000)]
Merge #9526

9526: fix: coerce array elements to a common type r=flodiebold a=jonas-schievink

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2 years agoImplement LUB coercion of array elements
Jonas Schievink [Wed, 7 Jul 2021 20:50:20 +0000 (22:50 +0200)]
Implement LUB coercion of array elements

2 years agoMerge #9519
bors[bot] [Wed, 7 Jul 2021 20:10:20 +0000 (20:10 +0000)]
Merge #9519

9519: Explicitly name all spawned threads r=weirdsmiley a=weirdsmiley

Fixes: [#9385](https://github.com/rust-analyzer/rust-analyzer/issues/9385)
The thread name is shown in debugger as well as panic messages and this
patch makes it easier to follow a thread instead of looking through
full backtrace, by naming all spawned threads according to their
functioning.

Co-authored-by: Manas <manas18244@iiitd.ac.in>
2 years agoExplicitly name all spawned threads
Manas [Wed, 7 Jul 2021 16:48:36 +0000 (22:18 +0530)]
Explicitly name all spawned threads

The thread name is shown in debugger as well as panic messages and this
patch makes it easier to follow a thread instead of looking through
full backtrace, by naming all spawned threads according to their
functioning.

3 years agoMerge #9524
bors[bot] [Wed, 7 Jul 2021 17:55:58 +0000 (17:55 +0000)]
Merge #9524

9524: minor: Add test for trait completion label edit r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoAdd test for trait completion label edit
Lukas Wirth [Wed, 7 Jul 2021 17:54:58 +0000 (19:54 +0200)]
Add test for trait completion label edit

3 years agoMerge #9523
bors[bot] [Wed, 7 Jul 2021 17:42:55 +0000 (17:42 +0000)]
Merge #9523

9523: fix: Don't add the trait name to the insert text in completions r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't add the trait name to the insert text in completions
Lukas Wirth [Wed, 7 Jul 2021 17:42:09 +0000 (19:42 +0200)]
Don't add the trait name to the insert text in completions

3 years agoMerge #9520
bors[bot] [Wed, 7 Jul 2021 17:09:54 +0000 (17:09 +0000)]
Merge #9520

9520: internal: Complete `crate`, `super` and `self` in non-UseTree paths r=Veykril a=Veykril

Fixes #9311
bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoComplete `crate`, `super` and `self` in non-usetree paths
Lukas Wirth [Wed, 7 Jul 2021 17:08:37 +0000 (19:08 +0200)]
Complete `crate`, `super` and `self` in non-usetree paths

3 years agoMerge #9517
bors[bot] [Wed, 7 Jul 2021 15:07:33 +0000 (15:07 +0000)]
Merge #9517

9517: minor: Add nightly proc macro issue to the bug report template r=lnicola a=lnicola

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
3 years agoAdd nightly proc macro issue to the bug report template
Laurențiu Nicola [Wed, 7 Jul 2021 15:05:00 +0000 (18:05 +0300)]
Add nightly proc macro issue to the bug report template

3 years agoMerge #9417
bors[bot] [Wed, 7 Jul 2021 14:54:01 +0000 (14:54 +0000)]
Merge #9417

9417: Update bug_report template r=flodiebold a=sasurau4

Fix #9386

Remove all resolved issues

Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
3 years agoMerge #9514
bors[bot] [Tue, 6 Jul 2021 18:31:51 +0000 (18:31 +0000)]
Merge #9514

9514: internal: Invert boolean literals in assist negation logic r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoInvert boolean literals in assist negation logic
Lukas Wirth [Tue, 6 Jul 2021 18:30:26 +0000 (20:30 +0200)]
Invert boolean literals in assist negation logic

3 years agoMerge #9500
bors[bot] [Tue, 6 Jul 2021 16:20:54 +0000 (16:20 +0000)]
Merge #9500

9500: internal: Only inline closure, literal and local arguments when used once r=Veykril a=Veykril

See https://github.com/rust-analyzer/rust-analyzer/pull/9474#discussion_r663881507 for reasoning.

This still inlines single use closures and literals as naming these is usually not as useful. Prime examples being the Option/Result consuming functions like `map_or` etc.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #9505
bors[bot] [Mon, 5 Jul 2021 21:02:42 +0000 (21:02 +0000)]
Merge #9505

9505: internal: ensure consistent passing for config params r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: ensure consistent passing for config params
Aleksey Kladov [Mon, 5 Jul 2021 21:00:39 +0000 (00:00 +0300)]
internal: ensure consistent passing for config params

We pass "context" parametes first, so configs should be on the left.
"Bigger" context wins, so configs goes after db.

3 years agoMerge #9503
bors[bot] [Mon, 5 Jul 2021 20:48:10 +0000 (20:48 +0000)]
Merge #9503

9503: feat: make join lines behavior configurable r=matklad a=matklad

![join_config](https://user-images.githubusercontent.com/1711539/124515923-4504e800-dde9-11eb-8d58-d97945a1a785.gif)

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agofeat: make join lines behavior configurable
Aleksey Kladov [Mon, 5 Jul 2021 20:31:44 +0000 (23:31 +0300)]
feat: make join lines behavior configurable

closes #9492

3 years agoMerge #9496
bors[bot] [Mon, 5 Jul 2021 17:11:09 +0000 (17:11 +0000)]
Merge #9496

9496: fix: make the logs line buffered r=lnicola a=mahdi-frms

fixes #9432
Not quite sure if that's what you want, but storing the log message in buffers eliminated the tiny write syscalls for me.
I just changed the Logger struct.

Co-authored-by: mahdi-frms <mahdif1380@outlook.com>
3 years agorefactor logger flushing
mahdi-frms [Mon, 5 Jul 2021 16:22:34 +0000 (20:52 +0430)]
refactor logger flushing

3 years agomake the logs line buffered
mahdi-frms [Mon, 5 Jul 2021 15:16:09 +0000 (19:46 +0430)]
make the logs line buffered

3 years agoMerge #9501
bors[bot] [Mon, 5 Jul 2021 15:06:55 +0000 (15:06 +0000)]
Merge #9501

9501: internal: Add a coverage mark r=jonas-schievink a=jonas-schievink

https://github.com/rust-analyzer/rust-analyzer/pull/9499#discussion_r663966671

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoAdd a coverage mark
Jonas Schievink [Mon, 5 Jul 2021 15:06:16 +0000 (17:06 +0200)]
Add a coverage mark

3 years agoOnly inline closure, literal and local arguments when used once
Lukas Wirth [Mon, 5 Jul 2021 14:33:45 +0000 (16:33 +0200)]
Only inline closure, literal and local arguments when used once

3 years agoMerge #9498
bors[bot] [Mon, 5 Jul 2021 14:24:41 +0000 (14:24 +0000)]
Merge #9498

9498: feat: Yeet `replace_unwrap_with_match` in favor of `inline_call` r=Veykril a=Veykril

`inline_call` can basically do this job now and more.
![r92csxeBQW](https://user-images.githubusercontent.com/3757771/124482574-b58c1480-dda9-11eb-940d-bc6a2fe4050b.gif)

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoMerge #9499
bors[bot] [Mon, 5 Jul 2021 14:08:54 +0000 (14:08 +0000)]
Merge #9499

9499: fix: Fix cycle in visibility computation with modules from the same block r=jonas-schievink a=jonas-schievink

fixes https://github.com/rust-analyzer/rust-analyzer/issues/9481

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
3 years agoFix visibility computation with modules from the same block
Jonas Schievink [Mon, 5 Jul 2021 14:06:50 +0000 (16:06 +0200)]
Fix visibility computation with modules from the same block

3 years agoYeet `replace_unwrap_with_match` in favor of `inline_call`
Lukas Wirth [Mon, 5 Jul 2021 13:47:55 +0000 (15:47 +0200)]
Yeet `replace_unwrap_with_match` in favor of `inline_call`

3 years agoMerge #9497
bors[bot] [Mon, 5 Jul 2021 13:42:37 +0000 (13:42 +0000)]
Merge #9497

9497: Wrap inlined closures in parens when inlined in an expression in `inline_call` r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoWrap inlined closures in parens when inlined in an expression in `inline_call`
Lukas Wirth [Mon, 5 Jul 2021 13:34:01 +0000 (15:34 +0200)]
Wrap inlined closures in parens when inlined in an expression in `inline_call`

3 years agoMerge #9494
bors[bot] [Mon, 5 Jul 2021 12:40:02 +0000 (12:40 +0000)]
Merge #9494

9494: feat: show 'as' or 'use' before label traits r=matklad a=mahdi-frms

based on #9478 discussions: showing 'as' before already imported traits and 'use' on auto-import cased

![Screenshot from 2021-07-05 16-54-59](https://user-images.githubusercontent.com/62165556/124471905-b5dcdd80-ddb2-11eb-8852-1d703ef6023f.png)

![Screenshot from 2021-07-05 16-55-20](https://user-images.githubusercontent.com/62165556/124471923-bffedc00-ddb2-11eb-9571-31b8b95499f1.png)

Co-authored-by: mahdi-frms <mahdif1380@outlook.com>
3 years agoUpdate `inline_call` assist doc example
Lukas Wirth [Mon, 5 Jul 2021 12:24:25 +0000 (14:24 +0200)]
Update `inline_call` assist doc example

3 years agoshow 'as' or 'use' before label traits
mahdi-frms [Mon, 5 Jul 2021 12:14:44 +0000 (16:44 +0430)]
show 'as' or 'use' before label traits

3 years agoMerge #9474
bors[bot] [Mon, 5 Jul 2021 11:50:18 +0000 (11:50 +0000)]
Merge #9474

9474: fix: Inline parameters in `inline_call` if possible r=Veykril a=Veykril

Fixes #9491

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoFixup emitted whitespace in most cases
Lukas Wirth [Mon, 5 Jul 2021 11:37:40 +0000 (13:37 +0200)]
Fixup emitted whitespace in most cases

3 years agoMerge #9493
bors[bot] [Mon, 5 Jul 2021 11:20:21 +0000 (11:20 +0000)]
Merge #9493

9493: minor: drop dummy authors field r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agominor: drop dummy authors field
Aleksey Kladov [Mon, 5 Jul 2021 11:19:41 +0000 (14:19 +0300)]
minor: drop dummy authors field

3 years agoMerge #9478
bors[bot] [Mon, 5 Jul 2021 11:13:07 +0000 (11:13 +0000)]
Merge #9478

9478: show imported trait on autocompletion of associated items r=matklad a=mahdi-frms

Fixes: #7456
The thing is however, due to the trait being already imported, the path to the trait is just the name of the trait itself.
I also updated the test concerning the labels.

Co-authored-by: mahdi-frms <mahdif1380@outlook.com>
3 years agoeliminate find_use_path and show 'as' and 'use'
mahdi-frms [Sun, 4 Jul 2021 16:27:45 +0000 (20:57 +0430)]
eliminate find_use_path and show 'as' and 'use'

3 years agoshow imported trait on autocompletion of associated items
mahdi-frms [Sat, 3 Jul 2021 20:29:47 +0000 (00:59 +0430)]
show imported trait on autocompletion of associated items

3 years agoMerge #9490
bors[bot] [Sun, 4 Jul 2021 14:35:00 +0000 (14:35 +0000)]
Merge #9490

9490: minor: untangle complex condition r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agominor: untangle complex condition
Aleksey Kladov [Sun, 4 Jul 2021 14:32:59 +0000 (17:32 +0300)]
minor: untangle complex condition

3 years agoMerge #9489
bors[bot] [Sun, 4 Jul 2021 14:04:01 +0000 (14:04 +0000)]
Merge #9489

9489: feat: always prefer postfix snippets if there's exact textual match r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: improve feedback for relevance tests
Aleksey Kladov [Sun, 4 Jul 2021 13:54:30 +0000 (16:54 +0300)]
internal: improve feedback for relevance tests

3 years agofeat: always prefer postfix snippets if there's exact textual match
Aleksey Kladov [Sun, 4 Jul 2021 13:50:02 +0000 (16:50 +0300)]
feat: always prefer postfix snippets if there's exact textual match

Note that, while we don't currently have a fuzzy-matching score, it
makes sense to special-case postfix templates -- it's very annoying when
`.not()` gets sorted before `.not`. We might want to move this infra to
fuzzy matching, once we have that!

3 years agoMerge #9488
bors[bot] [Sun, 4 Jul 2021 12:44:39 +0000 (12:44 +0000)]
Merge #9488

9488: internal: make CompletionItem and SourceChange consistent r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: make CompletionItem and SourceChange consistent
Aleksey Kladov [Sun, 4 Jul 2021 12:41:28 +0000 (15:41 +0300)]
internal: make CompletionItem and SourceChange consistent

Before this PR, SourceChange used a bool and CompletionItem used an enum
to signify if edit is a snippet. It makes sense to use the same pattern
in both cases. `bool` feels simpler, as there's only one consumer of
this API, and all producers are encapsulated anyway (we check the
capability at the production site).

3 years agoMerge #9487
bors[bot] [Sun, 4 Jul 2021 11:15:22 +0000 (11:15 +0000)]
Merge #9487

9487: internal: better factoring for to_proto::completion r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: better factoring for to_proto::completion
Aleksey Kladov [Sun, 4 Jul 2021 11:08:33 +0000 (14:08 +0300)]
internal: better factoring for to_proto::completion

One source completion can produce up to two lsp completions.
Additionally, `preselct` and `sort_text` are global properties of the
whole set of completions, so the right granularity here is to convert
many completions.

As a side-benefit, we no loger allocate intermediate vec.

3 years agoMerge #9485
bors[bot] [Sun, 4 Jul 2021 09:57:11 +0000 (09:57 +0000)]
Merge #9485

9485: minor: style r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agominor: style
Aleksey Kladov [Sun, 4 Jul 2021 08:12:41 +0000 (11:12 +0300)]
minor: style

3 years agoMerge #9484
bors[bot] [Sun, 4 Jul 2021 09:48:28 +0000 (09:48 +0000)]
Merge #9484

9484: internal: make `xtask` lighter r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agointernal: make `xtask` lighter
Aleksey Kladov [Sun, 4 Jul 2021 09:42:35 +0000 (12:42 +0300)]
internal: make `xtask` lighter

Moving tests to `rust-analyzer` crate allows removing walkdir dependency
from `xtask`. It does seem more reasonable to keep tidy tests outside of
the "build system" and closer to other integration tests.

3 years agoMerge #9483
bors[bot] [Sun, 4 Jul 2021 08:31:26 +0000 (08:31 +0000)]
Merge #9483

9483: minor: fix lint completion sourcegen r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agominor: fix lint completion sourcegen
Aleksey Kladov [Sun, 4 Jul 2021 08:26:03 +0000 (11:26 +0300)]
minor: fix lint completion sourcegen

3 years agoMerge #9482
bors[bot] [Sun, 4 Jul 2021 08:21:11 +0000 (08:21 +0000)]
Merge #9482

9482: minor: better error message r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
3 years agominor: better error message
Aleksey Kladov [Sun, 4 Jul 2021 08:20:31 +0000 (11:20 +0300)]
minor: better error message

3 years agoMerge #9479
bors[bot] [Sat, 3 Jul 2021 21:45:13 +0000 (21:45 +0000)]
Merge #9479

9479: `replace_qualified_name_with_use` insert qualified import paths r=Veykril a=Veykril

Also prevents the assist from triggering on associated items.

Fixes #9472.

This PR gets rid of a lot of tests that only really test the `insert_use` infra which already has its own tests, so these tests are of no use.

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years ago`replace_qualified_name_with_use` insert qualified import paths
Lukas Wirth [Sat, 3 Jul 2021 21:42:59 +0000 (23:42 +0200)]
`replace_qualified_name_with_use` insert qualified import paths

3 years agoMerge #9477
bors[bot] [Sat, 3 Jul 2021 20:13:14 +0000 (20:13 +0000)]
Merge #9477

9477: fix: Don't show an import per namespace in auto_import r=Veykril a=Veykril

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

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
3 years agoDon't show an import per namespace in auto_import
Lukas Wirth [Sat, 3 Jul 2021 20:11:01 +0000 (22:11 +0200)]
Don't show an import per namespace in auto_import