Commit graph

18231 commits

Author SHA1 Message Date
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
bors[bot] e5c1c8cf2f
Merge #9490
9490: minor: untangle complex condition r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-07-04 14:35:00 +00:00
Aleksey Kladov c4d2671767 minor: untangle complex condition 2021-07-04 17:32:59 +03:00
bors[bot] 13161ab738
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>
2021-07-04 14:04:01 +00: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
bors[bot] 030217d573
Merge #9488
9488: internal: make CompletionItem and SourceChange consistent r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-07-04 12:44:39 +00: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
bors[bot] 2ce88b504c
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>
2021-07-04 11:15:22 +00: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
bors[bot] 2885c89bfd
Merge #9482
9482: minor: better error message r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-07-04 08:21:11 +00:00
Aleksey Kladov c2704bebc1 minor: better error message 2021-07-04 11:20:31 +03:00
bors[bot] 266636450d
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>
2021-07-03 21:45:13 +00: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
bors[bot] 8d0fa9cd02
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>
2021-07-03 15:41:13 +00:00
Aleksey Kladov f875b91fdb feat: join lines joins two ifs into else if 2021-07-03 18:40:23 +03:00
bors[bot] 668d061245
Merge #9471
9471: minor: Don't hide meta lines r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-07-03 10:38:17 +00:00
Lukas Wirth 9c923068fb Don't hide meta lines 2021-07-03 12:16:07 +02:00
Daiki Ihara 78eeec54e9 Update ISSUE_TEMPLATE 2021-07-03 12:43:38 +09:00
Daiki Ihara 36bd194da9 Update bug_repord template 2021-07-03 12:43:38 +09:00
Lukas Wirth 688398febc feat: Implement inline_method assist 2021-07-03 01:33:34 +02:00
bors[bot] 96074f627b
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>
2021-07-02 23:32:12 +00: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
bors[bot] 3770fce086
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>
2021-07-02 19:11:08 +00: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
bors[bot] a8563c5942
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>
2021-07-02 13:43:40 +00:00
Jonas Schievink 3fa07b31c9 Remove incorrect std dep 2021-07-02 15:42:42 +02:00
bors[bot] 021f6772e4
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>
2021-07-02 13:35:13 +00:00