]>
git.lizzy.rs Git - rust.git/log
Aleksey Kladov [Mon, 5 Jul 2021 20:31:44 +0000 (23:31 +0300)]
feat: make join lines behavior configurable
closes #9492
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>
mahdi-frms [Mon, 5 Jul 2021 16:22:34 +0000 (20:52 +0430)]
refactor logger flushing
mahdi-frms [Mon, 5 Jul 2021 15:16:09 +0000 (19:46 +0430)]
make the logs line buffered
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>
Jonas Schievink [Mon, 5 Jul 2021 15:06:16 +0000 (17:06 +0200)]
Add a coverage mark
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>
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>
Jonas Schievink [Mon, 5 Jul 2021 14:06:50 +0000 (16:06 +0200)]
Fix visibility computation with modules from the same block
Lukas Wirth [Mon, 5 Jul 2021 13:47:55 +0000 (15:47 +0200)]
Yeet `replace_unwrap_with_match` in favor of `inline_call`
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>
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`
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>
Lukas Wirth [Mon, 5 Jul 2021 12:24:25 +0000 (14:24 +0200)]
Update `inline_call` assist doc example
mahdi-frms [Mon, 5 Jul 2021 12:14:44 +0000 (16:44 +0430)]
show 'as' or 'use' before label traits
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>
Lukas Wirth [Mon, 5 Jul 2021 11:37:40 +0000 (13:37 +0200)]
Fixup emitted whitespace in most cases
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>
Aleksey Kladov [Mon, 5 Jul 2021 11:19:41 +0000 (14:19 +0300)]
minor: drop dummy authors field
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>
mahdi-frms [Sun, 4 Jul 2021 16:27:45 +0000 (20:57 +0430)]
eliminate find_use_path and show 'as' and 'use'
mahdi-frms [Sat, 3 Jul 2021 20:29:47 +0000 (00:59 +0430)]
show imported trait on autocompletion of associated items
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>
Aleksey Kladov [Sun, 4 Jul 2021 14:32:59 +0000 (17:32 +0300)]
minor: untangle complex condition
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>
Aleksey Kladov [Sun, 4 Jul 2021 13:54:30 +0000 (16:54 +0300)]
internal: improve feedback for relevance tests
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!
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>
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).
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>
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.
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>
Aleksey Kladov [Sun, 4 Jul 2021 08:12:41 +0000 (11:12 +0300)]
minor: style
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>
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.
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>
Aleksey Kladov [Sun, 4 Jul 2021 08:26:03 +0000 (11:26 +0300)]
minor: fix lint completion sourcegen
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>
Aleksey Kladov [Sun, 4 Jul 2021 08:20:31 +0000 (11:20 +0300)]
minor: better error message
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>
Lukas Wirth [Sat, 3 Jul 2021 21:42:59 +0000 (23:42 +0200)]
`replace_qualified_name_with_use` insert qualified import paths
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>
Lukas Wirth [Sat, 3 Jul 2021 20:11:01 +0000 (22:11 +0200)]
Don't show an import per namespace in auto_import
Lukas Wirth [Sat, 3 Jul 2021 19:42:59 +0000 (21:42 +0200)]
Add some more `inline_call` tests
bors[bot] [Sat, 3 Jul 2021 19:26:04 +0000 (19:26 +0000)]
Merge #9476
9476: internal: overhaul codegen r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 3 Jul 2021 19:24:36 +0000 (22:24 +0300)]
feat: regenrate lint completions
Aleksey Kladov [Sat, 3 Jul 2021 19:11:03 +0000 (22:11 +0300)]
internal: overhaul code generation
* Keep codegen adjacent to the relevant crates.
* Remove codgen deps from xtask, speeding-up from-source installation.
This regresses the release process a bit, as it now needs to run the
tests (and, by extension, compile the code).
Lukas Wirth [Sat, 3 Jul 2021 18:05:00 +0000 (20:05 +0200)]
Inline parameters in `inline_call` if possible
bors[bot] [Sat, 3 Jul 2021 16:13:06 +0000 (16:13 +0000)]
Merge #9468
9468: feat: Make `inline_function` work on methods r=Veykril a=Veykril
Now called `inline_call`.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sat, 3 Jul 2021 15:13:56 +0000 (17:13 +0200)]
Merge the inline function/method assists into `inline_call`
bors[bot] [Sat, 3 Jul 2021 15:41:13 +0000 (15:41 +0000)]
Merge #9473
9473: feat: join lines joins two ifs into `else if` r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 3 Jul 2021 15:36:08 +0000 (18:36 +0300)]
feat: join lines joins two ifs into `else if`
bors[bot] [Sat, 3 Jul 2021 10:38:17 +0000 (10:38 +0000)]
Merge #9471
9471: minor: Don't hide meta lines r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sat, 3 Jul 2021 10:16:07 +0000 (12:16 +0200)]
Don't hide meta lines
Lukas Wirth [Fri, 2 Jul 2021 23:33:34 +0000 (01:33 +0200)]
feat: Implement `inline_method` assist
bors[bot] [Fri, 2 Jul 2021 23:32:12 +0000 (23:32 +0000)]
Merge #9467
9467: internal: wrap_return_type_in_result works on the HIR r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 2 Jul 2021 21:52:43 +0000 (23:52 +0200)]
Simplify
Lukas Wirth [Fri, 2 Jul 2021 21:19:32 +0000 (23:19 +0200)]
wrap_return_type_in_result works on the HIR
bors[bot] [Fri, 2 Jul 2021 19:11:08 +0000 (19:11 +0000)]
Merge #9465
9465: feat: `replace_match_with_if_let` works on more 2-arm matches r=Veykril a=Veykril
Now it works on pretty much on all 2-arm matches where only up to 1 arm binds a name instead of requiring either a sad or wildcard pattern to be present.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 2 Jul 2021 19:10:38 +0000 (21:10 +0200)]
Don't check sad pattern equality by text
Lukas Wirth [Fri, 2 Jul 2021 19:05:10 +0000 (21:05 +0200)]
`replace_match_with_if_let` works on more binary matches
Lukas Wirth [Fri, 2 Jul 2021 17:50:37 +0000 (19:50 +0200)]
Simplify
Lukas Wirth [Fri, 2 Jul 2021 17:34:49 +0000 (19:34 +0200)]
Add cov_mark
bors[bot] [Fri, 2 Jul 2021 13:51:57 +0000 (13:51 +0000)]
Merge #9464
9464: fix: Fix runnables using wrong file ids for module doctests r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 2 Jul 2021 13:43:47 +0000 (15:43 +0200)]
Fix runnables using wrong file ids for module doctests
bors[bot] [Fri, 2 Jul 2021 13:43:40 +0000 (13:43 +0000)]
Merge #9463
9463: fix: Remove incorrect std dep r=jonas-schievink a=jonas-schievink
libstd doesn't actually depend on `proc_macro`. cc https://github.com/rust-analyzer/rust-analyzer/pull/9456#issuecomment-
873005974
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Fri, 2 Jul 2021 13:42:42 +0000 (15:42 +0200)]
Remove incorrect std dep
bors[bot] [Fri, 2 Jul 2021 13:35:13 +0000 (13:35 +0000)]
Merge #9462
9462: minor: Print runnable kind on assertion failure for better debuggability r=Veykril a=Veykril
We are somehow hitting this when looking at `crates\ide_db\src\lib.rs` and I don't see how.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 2 Jul 2021 13:28:38 +0000 (15:28 +0200)]
Print runnable kind on assertion failure for better debuggability
bors[bot] [Fri, 2 Jul 2021 13:19:12 +0000 (13:19 +0000)]
Merge #9461
9461: fix: Fix incorrect guard for NameRefClass attribute resolution r=Veykril a=Veykril
This is what happens when you forget to write a test
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 2 Jul 2021 13:17:21 +0000 (15:17 +0200)]
Fix incorrect guard for NameRefClass attribute resolution
bors[bot] [Fri, 2 Jul 2021 12:49:34 +0000 (12:49 +0000)]
Merge #9428
9428: fix: Fix deduction of `dyn Fn` closure parameter types r=flodiebold a=jonas-schievink
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
bors[bot] [Thu, 1 Jul 2021 23:47:38 +0000 (23:47 +0000)]
Merge #9458
9458: minor: Remove make::match_arm_with_guard r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Thu, 1 Jul 2021 23:44:54 +0000 (01:44 +0200)]
Remove make::match_arm_with_guard
bors[bot] [Thu, 1 Jul 2021 23:39:59 +0000 (23:39 +0000)]
Merge #9456
9456: fix: sysroot: add proc_macro -> std dependency edge r=jonas-schievink a=jonas-schievink
This fixes missing trait implementation on the proc_macro types.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 1 Jul 2021 23:38:49 +0000 (01:38 +0200)]
sysroot: add proc_macro -> std dependency edge
bors[bot] [Thu, 1 Jul 2021 23:00:50 +0000 (23:00 +0000)]
Merge #9455
9455: feat: Handle not let if expressions in replace_if_let_with_match r=Veykril a=Veykril
Transforms bare `if cond {}` into `_ if cond` guard patterns in the match as long as at least one `if let` is in the if chain, otherwise the assist wont be applicable.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Thu, 1 Jul 2021 22:58:56 +0000 (00:58 +0200)]
Handle not let if expressions in replace_if_let_with_match
bors[bot] [Thu, 1 Jul 2021 22:24:17 +0000 (22:24 +0000)]
Merge #9454
9454: feat: Empower `replace_if_let_with_match` r=Veykril a=Veykril
Now instead of only working on `if let ... {} else {}` if expressions it now works on all of them where the condition expression is the same text-wise.
This includes if let expressions without an else block, in which case a simple `_ => ()` will be generated in the resulting match but also in more complex cases where multiple `if let` expressions are chained.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Thu, 1 Jul 2021 22:20:27 +0000 (00:20 +0200)]
Empower `replace_if_let_with_match`
Jonas Schievink [Thu, 1 Jul 2021 22:16:36 +0000 (00:16 +0200)]
Substitute self type instead of fusing binders
bors[bot] [Thu, 1 Jul 2021 22:12:53 +0000 (22:12 +0000)]
Merge #9452
9452: feat: Add "View Crate Graph (Full)" r=jonas-schievink a=jonas-schievink
Works like "View Crate Graph", but also includes crates.io and sysroot dependencies. The resulting graph might be enormous.
Closes https://github.com/rust-analyzer/rust-analyzer/issues/8867
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 1 Jul 2021 22:08:05 +0000 (00:08 +0200)]
Add "View Crate Graph (Full)"
bors[bot] [Thu, 1 Jul 2021 19:52:14 +0000 (19:52 +0000)]
Merge #9451
9451: minor: Add `goto_type_action` for field hovers r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Thu, 1 Jul 2021 19:51:26 +0000 (21:51 +0200)]
Add `goto_type_action` for field hovers
bors[bot] [Thu, 1 Jul 2021 19:33:53 +0000 (19:33 +0000)]
Merge #9450
9450: internal: Add ModuleOrItem guess to import granularity guessing r=Veykril a=Veykril
I think this should be the last fix needed for this(🤞)
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Thu, 1 Jul 2021 19:32:35 +0000 (21:32 +0200)]
Add ModuleOrItem guess to import granularity guessing
Lukas Wirth [Thu, 1 Jul 2021 19:10:45 +0000 (21:10 +0200)]
Simplify
Jonas Schievink [Thu, 1 Jul 2021 18:54:25 +0000 (20:54 +0200)]
Bind the right number of variables in the `FnPointer`
Jonas Schievink [Thu, 1 Jul 2021 18:45:47 +0000 (20:45 +0200)]
Use `as_tuple()`
bors[bot] [Thu, 1 Jul 2021 18:25:06 +0000 (18:25 +0000)]
Merge #9431
9431: internal: Implement TypeRef::ForLifetime r=flodiebold a=Veykril
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
bors[bot] [Thu, 1 Jul 2021 17:58:40 +0000 (17:58 +0000)]
Merge #9447
9447: fix: Make unlinked_file diagnostic a hint again r=jonas-schievink a=jonas-schievink
#9255 accidentally turned it into an error
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 1 Jul 2021 17:57:50 +0000 (19:57 +0200)]
Make unlinked_file diagnostic a hint again
bors[bot] [Thu, 1 Jul 2021 17:21:34 +0000 (17:21 +0000)]
Merge #9445
9445: fix: Fix nested macro in block defining items r=jonas-schievink a=jonas-schievink
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8930
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 1 Jul 2021 17:20:42 +0000 (19:20 +0200)]
Fix nested macro in block defining items
bors[bot] [Thu, 1 Jul 2021 15:29:28 +0000 (15:29 +0000)]
Merge #9443
9443: internal: Add a simpler legacy macro scoping test r=jonas-schievink a=jonas-schievink
This is a lot simpler to understand and debug than the `plain_macros_are_legacy_textual_scoped` test.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Thu, 1 Jul 2021 15:28:42 +0000 (17:28 +0200)]
Add a simpler legacy macro scoping test
bors[bot] [Thu, 1 Jul 2021 12:05:46 +0000 (12:05 +0000)]
Merge #9440
9440: Don't implement `Eq` for `CrateGraph` r=kjeremy a=lnicola
This currently seems [incorrect](https://github.com/rust-analyzer/rust-analyzer/pull/8363/files) and doesn't seem that useful, so maybe we can remove it?
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Thu, 1 Jul 2021 11:10:57 +0000 (14:10 +0300)]
Don't implement Eq for CrateGraph
bors[bot] [Wed, 30 Jun 2021 19:52:03 +0000 (19:52 +0000)]
Merge #9437
9437: fix: Don't classify paths inside attribute TokenTrees r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>