Commit Graph

12128 Commits

Author SHA1 Message Date
Lukas Wirth
dafbe6940e Wrap inlined closures in parens when inlined in an expression in inline_call 2021-07-05 15:42:11 +02:00
Lukas Wirth
2579dc6d82 Update inline_call assist doc example 2021-07-05 14:24:25 +02:00
bors[bot]
2bc4f9e371
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>
2021-07-05 11:50:18 +00:00
Lukas Wirth
ea02d27a1e Fixup emitted whitespace in most cases 2021-07-05 13:44:42 +02:00
bors[bot]
b52306ed37
Merge #9493
9493: minor: drop dummy authors field r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-07-05 11:20:21 +00:00
Aleksey Kladov
86720f2953 minor: drop dummy authors field 2021-07-05 14:19:41 +03:00
mahdi-frms
02d33c9856 eliminate find_use_path and show 'as' and 'use' 2021-07-05 02:15:31 +04:30
mahdi-frms
486bffc23e show imported trait on autocompletion of associated items 2021-07-05 02:13:49 +04:30
Aleksey Kladov
c4d2671767 minor: untangle complex condition 2021-07-04 17:32:59 +03:00
Aleksey Kladov
9b3292541c internal: improve feedback for relevance tests 2021-07-04 17:03:28 +03:00
Aleksey Kladov
fbb9d69758 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!
2021-07-04 16:50:02 +03:00
Aleksey Kladov
6e9780c005 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).
2021-07-04 15:44:03 +03:00
Aleksey Kladov
f34762abb7 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.
2021-07-04 14:08:33 +03:00
bors[bot]
108b56f354
Merge #9485
9485: minor: style r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-07-04 09:57:11 +00:00
Aleksey Kladov
3be9ebe2c3 minor: style 2021-07-04 12:48:29 +03:00
bors[bot]
775a85acb8
Merge #9484
9484: internal: make `xtask` lighter r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-07-04 09:48:28 +00:00
Aleksey Kladov
90e27d6289 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.
2021-07-04 12:47:56 +03:00
bors[bot]
27188d0b04
Merge #9483
9483: minor: fix lint completion sourcegen r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-07-04 08:31:26 +00:00
Aleksey Kladov
e9d52c23b3 minor: fix lint completion sourcegen 2021-07-04 11:30:56 +03:00
Aleksey Kladov
c2704bebc1 minor: better error message 2021-07-04 11:20:31 +03:00
Lukas Wirth
e41b5348b8 replace_qualified_name_with_use insert qualified import paths 2021-07-03 23:42:59 +02:00
bors[bot]
e73328f22a
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>
2021-07-03 20:13:14 +00:00
Lukas Wirth
05ec824ab7 Don't show an import per namespace in auto_import 2021-07-03 22:11:01 +02:00
Lukas Wirth
6181154d50 Add some more inline_call tests 2021-07-03 21:42:59 +02:00
bors[bot]
336194c09b
Merge #9476
9476: internal: overhaul codegen r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-07-03 19:26:04 +00:00
Aleksey Kladov
660930623e feat: regenrate lint completions 2021-07-03 22:24:36 +03:00
Aleksey Kladov
58d2ece88a 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).
2021-07-03 22:11:03 +03:00
Lukas Wirth
d308f17a21 Inline parameters in inline_call if possible 2021-07-03 20:05:54 +02:00
bors[bot]
888bb6c452
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>
2021-07-03 16:13:06 +00:00
Lukas Wirth
14e18bfa38 Merge the inline function/method assists into inline_call 2021-07-03 18:07:03 +02:00
Aleksey Kladov
f875b91fdb feat: join lines joins two ifs into else if 2021-07-03 18:40:23 +03:00
Lukas Wirth
9c923068fb Don't hide meta lines 2021-07-03 12:16:07 +02:00
Lukas Wirth
688398febc feat: Implement inline_method assist 2021-07-03 01:33:34 +02:00
Lukas Wirth
fbdcb49d48 Simplify 2021-07-03 01:31:41 +02:00
Lukas Wirth
26dd0c4e5b wrap_return_type_in_result works on the HIR 2021-07-02 23:19:32 +02:00
Lukas Wirth
eb3f90b301 Don't check sad pattern equality by text 2021-07-02 21:10:44 +02:00
Lukas Wirth
251f0c6090 replace_match_with_if_let works on more binary matches 2021-07-02 21:05:10 +02:00
Lukas Wirth
f1819525f5 Simplify 2021-07-02 19:50:37 +02:00
Lukas Wirth
a7d61ddba4 Add cov_mark 2021-07-02 19:34:49 +02:00
bors[bot]
dd69d4a97c
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>
2021-07-02 13:51:57 +00:00
Lukas Wirth
59eec29e1b Fix runnables using wrong file ids for module doctests 2021-07-02 15:43:47 +02:00
Jonas Schievink
3fa07b31c9 Remove incorrect std dep 2021-07-02 15:42:42 +02:00
Lukas Wirth
0b8e145641 Print runnable kind on assertion failure for better debuggability 2021-07-02 15:34:26 +02:00
Lukas Wirth
f640f2dbb4 Fix incorrect guard for NameRefClass attribute resolution 2021-07-02 15:17:21 +02:00
bors[bot]
16871f6f93
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>
2021-07-02 12:49:34 +00:00
bors[bot]
d18cfd4467
Merge #9458
9458: minor: Remove make::match_arm_with_guard r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-01 23:47:38 +00:00
Lukas Wirth
071ac48b6c Remove make::match_arm_with_guard 2021-07-02 01:44:54 +02:00
Jonas Schievink
be0f1d5ca6 sysroot: add proc_macro -> std dependency edge 2021-07-02 01:38:49 +02:00
bors[bot]
cd3d633850
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>
2021-07-01 23:00:50 +00:00
Lukas Wirth
8967856d78 Handle not let if expressions in replace_if_let_with_match 2021-07-02 00:58:56 +02:00