Commit Graph

17926 Commits

Author SHA1 Message Date
bors[bot]
70e347332d
Merge #9081
9081: minor: expand docs a tiny bit r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-31 14:28:03 +00:00
Aleksey Kladov
5e577a6373 minor: expand docs a tiny bit 2021-05-31 17:27:27 +03:00
bors[bot]
c460baeaf3
Merge #9079
9079: Don't take the parent kind of trailing attributes in attr completion r=Veykril a=Veykril

bors r+
fixes https://github.com/rust-analyzer/rust-analyzer/issues/9076

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-31 13:38:32 +00:00
Lukas Wirth
741b2f531f Don't take the parent kind of trailing attributes in attr completion 2021-05-31 15:35:22 +02:00
bors[bot]
e6ec860363
Merge #9039
9039: feat: Complete fields and methods with `self.` prefixed when inside methods r=matklad a=Veykril


![w65NbjkZiG](https://user-images.githubusercontent.com/3757771/119984385-a0111700-bfc1-11eb-9dbf-52fdaa4d72b5.gif)
Closes #7173

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-31 13:21:31 +00:00
Lukas Wirth
fb7105a580 Add config setting for self-on-the-fly 2021-05-31 15:14:56 +02:00
Lukas Wirth
4507382f2e Move unprefixed field/method completion to dot 2021-05-31 15:10:20 +02:00
Lukas Wirth
d346f5bf75 Less strings, more hir::Names 2021-05-31 14:55:16 +02:00
Lukas Wirth
ca49fbe0a1 Complete self. prefixed fields and methods inside methods 2021-05-31 14:52:55 +02:00
bors[bot]
e9a797748d
Merge #8866
8866: Update salsa r=matklad a=jonas-schievink

This updates salsa to include https://github.com/salsa-rs/salsa/pull/265, and removes all cancellation-related code from rust-analyzer

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-31 12:42:32 +00:00
bors[bot]
b8d269990c
Merge #9060
9060: feat: Diagnose unimplemented built-in macros r=matklad a=jonas-schievink

A number of built-in attribute macros are unsupported, I thought it might be useful to put a diagnostic on their definition in libcore. Not sure.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-31 12:34:01 +00:00
bors[bot]
d7cbb49057
Merge #9077
9077: internal: Use `Name`s instead of Strings in the completion rendering api r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-31 12:16:44 +00:00
Lukas Wirth
971b0836ef Use Names instead of Strings in the completion rendering api 2021-05-31 14:15:15 +02:00
bors[bot]
3cb3f1d17b
Merge #9025
9025: internal: Display unknown types in `analysis-stats` r=flodiebold a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-05-31 08:20:28 +00:00
bors[bot]
c7ae418296
Merge #9072
9072: minor: reenable incremental test builds r=lnicola a=iDawer



Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2021-05-31 07:20:18 +00:00
Dawer
9899bb450a minor: reenable incremental test builds 2021-05-31 12:15:40 +05:00
bors[bot]
f438398124
Merge #9071
9071: minor: reenable incremental release builds r=jonas-schievink a=jonas-schievink

forgot to turn this back on in https://github.com/rust-analyzer/rust-analyzer/pull/9069

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-30 23:52:53 +00:00
Jonas Schievink
c9ba634627 reenable incremental release builds 2021-05-31 01:12:11 +02:00
bors[bot]
d6490c69fb
Merge #9069
9069: minor: Don't force-disable incremental r=jonas-schievink a=jonas-schievink

1.52.1 turns incremental off regardless of this setting, so this is unnecessary. Removing this allow manually overriding Cargo to enable incremental.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-30 21:48:43 +00:00
Jonas Schievink
b12d8dcb82 Don't force-disable incremental 2021-05-30 23:46:39 +02:00
bors[bot]
92b9e5ef3c
Merge #9068
9068: Move more `CompletinoContext` fields to `ImmediateLocation` r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-30 19:37:29 +00:00
Lukas Wirth
5660408f0a Move more fields to ImmediateLocation 2021-05-30 21:35:01 +02:00
bors[bot]
088b670796
Merge #9065
9065: hir_ty: don't pass where clauses of associated types down to chalk r=cynecx a=cynecx

See #9052.

Co-authored-by: cynecx <me@cynecx.net>
2021-05-30 17:28:52 +00:00
cynecx
51cbcc5346 hir_ty: don't pass where clauses of associated types down to chalk (temp. fix #9052) 2021-05-30 19:21:08 +02:00
bors[bot]
f1d163ba51
Merge #9064
9064: Fix incorrect prefer_inner calls on some attribute completions r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-30 15:13:29 +00:00
Lukas Wirth
c5cd25d755 Fix incorrect prefer_inner calls on some attribute completions 2021-05-30 17:13:00 +02:00
bors[bot]
f41b68637a
Merge #9062
9062: internal: Bump deps r=lnicola a=lnicola

Fixes #9061

bors r+

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-05-30 11:48:59 +00:00
Laurențiu Nicola
36567eb9be Bump deps 2021-05-30 14:48:10 +03:00
Jonas Schievink
cb5454db86 Diagnose unimplemented built-in macros 2021-05-30 04:19:47 +02:00
bors[bot]
06b301e2f8
Merge #9059
9059: fix: Only complete derive proc macros in `#[derive]` r=jonas-schievink a=jonas-schievink

HIR now gives them `MacroKind::Derive` instead of `MacroKind::ProcMacro`

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-29 19:19:24 +00:00
Jonas Schievink
39533ad7dd Only complete derive proc macros in #[derive] 2021-05-29 21:18:14 +02:00
Jonas Schievink
acb5c227ed Update to prerelease 2021-05-29 21:10:00 +02:00
bors[bot]
505329b9bb
Merge #9057
9057: internal: Thread proc-macro types through the HIR r=jonas-schievink a=jonas-schievink

Should help with completion of derives. cc @Veykril 

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-29 18:33:49 +00:00
Jonas Schievink
8c639a87bd Thread proc-macro types through the HIR 2021-05-29 20:32:57 +02:00
bors[bot]
f6da603c7f
Merge #9050
9050: hir_ty: use async ret type for inference inside async bodies r=flodiebold a=cynecx

Fixes #9004.

Co-authored-by: cynecx <me@cynecx.net>
2021-05-29 17:39:15 +00:00
bors[bot]
0438e2ceaa
Merge #9054
9054: fix: fix `matches!` macro on nightly toolchains r=jonas-schievink a=jonas-schievink

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

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-29 16:33:20 +00:00
Jonas Schievink
4c4bcaebbe Treat pat_param like pat fragments 2021-05-29 18:32:32 +02:00
bors[bot]
11a1bd3259
Merge #9051
9051: Fix incorrect setting descriptions r=lnicola a=sclu1034

Descriptions for diagnostic warning hint and info display were swapped.

Fixes #8485.

Co-authored-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-05-29 16:23:59 +00:00
cynecx
54d60fdee9 hir_ty: use async ret type for inference inside async bodies 2021-05-29 18:17:45 +02:00
Lucas Schwiderski
9a057c0ff4
Fix incorrect setting descriptions
Descriptions for diagnostic warning hint and info display were swapped.

Fixes #8485.

Signed-off-by: Lucas Schwiderski <lucas@lschwiderski.de>
2021-05-29 18:08:14 +02:00
bors[bot]
3fa3343e47
Merge #9048
9048: Add some lint completion tests r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-29 15:33:57 +00:00
Lukas Wirth
c9598a4cbf Add some lint completion tests 2021-05-29 17:19:49 +02:00
bors[bot]
8cd98bde39
Merge #9046
9046: fix: make `include!` etc. work in expression position r=jonas-schievink a=jonas-schievink

This PR removes determination of fragment kinds from the eager macro implementations. The fragment kind is always determined by the syntax position in which a macro is invoked, not by the macro implementation, even for eager macros.

This makes `include!` work in expression position, and should have the same effect for all macros that may be used in different positions.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-29 15:19:44 +00:00
Jonas Schievink
31588aea04 Remove fragment kind knowledge from builtin macros 2021-05-29 17:17:08 +02:00
bors[bot]
247faf271b
Merge #9027
9027: feat: Attribute completion is context aware r=Veykril a=Veykril

This splits off the `lint` and `derive` completions into their own submodules of `attribute`.

The idea is to create a lazy global hashmap that maps `SyntaxKind` to attribute names(`&[&str]`) in which we index with the syntax kind of the "thing" we are attributing giving us the attributes back that are valid for this kind. Then we use this name to do a binary search on the attribute list to fetch and build the corresponding completion item.


Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-29 12:14:16 +00:00
Lukas Wirth
c9f0f47bbb simplify 2021-05-29 14:02:06 +02:00
bors[bot]
7869b01b70
Merge #9041
9041: internal: Implement prev sibling determination for `CompletionContext ` r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-05-28 21:21:37 +00:00
Lukas Wirth
e42c448077 More completion pattern tests 2021-05-28 22:19:52 +02:00
Lukas Wirth
47ad752e6c Implement prev sibling determination for CompletionContext 2021-05-28 22:03:31 +02:00
Lukas Wirth
a6b92a8cc0 simplify 2021-05-28 20:46:09 +02:00